fix(wrapper-generator): singularizer corrections and naming edge-case catalog - #3694
Open
Joywambui-maina wants to merge 3 commits into
Open
fix(wrapper-generator): singularizer corrections and naming edge-case catalog#3694Joywambui-maina wants to merge 3 commits into
Joywambui-maina wants to merge 3 commits into
Conversation
…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.
Joywambui-maina
requested review from
Peter Ombwa (peombwa) and
Ramses Sanchez-Hernandez (ramsessanchez)
August 4, 2026 22:36
Contributor
There was a problem hiding this comment.
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, andStatistics, 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
formatfor bothintegerandnumberschemas (e.g.,number+int32→int).
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changes proposed in this pull request
MgCommandMetadata.jsoninventory:cookies,skus,dns,ios, andstatistics(the last surfaced by the DEVX API's Humanizer exception list) — each pinned by a test citing the shipped cmdlet.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.tools/WrapperGenerator/edge-cases/naming-edge-cases.md): one Markdown file per class of issue with fixed entry fields.formatsonumber+int32/int64properties emitint/longmatching the Kiota client's model types instead ofdouble.