Skip to content

fix(wrapper-generator): singularizer corrections and naming edge-case catalog - #3694

Open
Joywambui-maina wants to merge 3 commits into
powershell-v3from
fix/singularizer-oracle-findings
Open

fix(wrapper-generator): singularizer corrections and naming edge-case catalog#3694
Joywambui-maina wants to merge 3 commits into
powershell-v3from
fix/singularizer-oracle-findings

Conversation

@Joywambui-maina

Copy link
Copy Markdown

Changes proposed in this pull request

  • Correct five singularization words found by auditing the naming rules against the full MgCommandMetadata.json inventory: cookies, skus, dns, ios, and statistics (the last surfaced by the DEVX API's Humanizer exception list) — each pinned by a test citing the shipped cmdlet.
  • Deliberately correct Get-MgSecurityThreatIntelligenceHostWhoi...HostWhois: only 2 of the 30 shipped whois-family commands truncate "Whois", an AutoRest inflection defect. Per review discussion, corrected names ship with no alias for the old name. The parity gate gains a small allowlist and reports these as [CORRECTED] instead of failing.
  • Start the naming edge-case catalog (tools/WrapperGenerator/edge-cases/naming-edge-cases.md): one Markdown file per class of issue with fixed entry fields.
  • Map numeric parameter types by OpenAPI format so number+int32/int64 properties emit int/long matching the Kiota client's model types instead of double.

…racle audit

Auditing every v1.0 GET command in MgCommandMetadata.json against the
singularizer surfaced four words where the rules disagree with shipped
cmdlet names: Cookies -> "Cooky" (ships as ...HostCookie), Skus kept
as-is (ships as Get-MgSubscribedSku), Dns -> "Dn" (ships as
Get-MgDomainVerificationDnsRecord), Ios -> "Io" (ships as
Get-MgDeviceAppManagementIosManagedAppProtection). Adds two irregulars
and two invariants, each with a pinned test, and refreshes the README
test count.

82 tests passing. Full-inventory match after fix: 796 of 870 noun
segments; the remaining 74 are action/function segments and AutoRest
hand renames, tracked separately.
…nt, start edge-case catalog

Only 2 of 30 shipped whois-family commands truncate "Whois" to "Whoi"; per
review decision the generator emits the corrected ...HostWhois (no alias for
the old name), and the parity gate reports it as [CORRECTED] instead of
failing. "Statistics" joins the invariants, found via the DEVX Humanizer
exception list. edge-cases/naming-edge-cases.md starts the per-class
catalog of naming defects. 88 tests passing.
Graph declares Edm.Int32/Int64 as "number" with the real type in the
format; mapping by type alone emitted double? against Kiota's int? and
did not compile. An explicit format now decides the CLR type, mirroring
Kiota's own mapping.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates the wrapper-generator’s naming and schema type mapping so regenerated Microsoft Graph PowerShell cmdlets more accurately match (or intentionally correct) published cmdlet names and Kiota model types.

Changes:

  • Adds new singularizer irregulars/invariants for Cookies, Skus, Dns, Ios, and Statistics, with additional pinned naming tests.
  • Introduces a deliberate-corrections mechanism for known published AutoRest naming defects (notably ...HostWhoi...HostWhois) including parity-gate allowlisting and documentation.
  • Improves numeric parameter type mapping by honoring OpenAPI format for both integer and number schemas (e.g., number+int32int).

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated no comments.

Show a summary per file
File Description
tools/WrapperGenerator/Singularizer.cs Extends singularization rules with new irregulars/invariants and clarifies the is/us/ss guard behavior for the Whois correction.
tools/WrapperGenerator/SchemaProperties.cs Maps numeric CLR types using OpenAPI format for better alignment with Kiota model property types.
tools/WrapperGenerator/README.md Documents the intentional naming-correction policy and updates test guidance/output examples.
tools/WrapperGenerator/edge-cases/naming-edge-cases.md Adds the initial naming edge-case catalog and documents the Whois correction and related policies.
tools/WrapperGenerator.Tests/SchemaPropertiesTests.cs Adds test coverage for numeric number schemas whose actual intended type is carried via format.
tools/WrapperGenerator.Tests/NamingTests.cs Adds pinned tests for new singularization exceptions and introduces a dedicated test for deliberate naming corrections (HostWhois).
tools/Compare-WrapperCmdletNames.ps1 Adds a deliberate-corrections allowlist so parity checks report [CORRECTED] rather than failing on intentional divergences.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants