Skip to content

Align Kiota-compatible OpenAPI operation IDs with PowerShell - #3861

Merged
Ramses Sanchez-Hernandez (ramsessanchez) merged 1 commit into
powershell-v3from
ramsessanchez-openapi-operation-ids
Oct 23, 2026
Merged

Ramses Sanchez-Hernandez (ramsessanchez) merged 1 commit into
powershell-v3from
ramsessanchez-openapi-operation-ids

Conversation

@ramsessanchez

Copy link
Copy Markdown
Contributor

Changes proposed in this pull request

DevX ignores singularizeOperationIds with style=Plain. Switching the Kiota-compatible download to style=Powershell would remove schema features needed by Kiota. This change retains the Plain document and changes only its operation IDs, reducing the translation needed to migrate existing operation-ID-based directives.

  • Enable singularized operation IDs in the v1.0 and beta Kiota-compatible refreshes. Download the document with fileName=openapi&style=Plain, request a companion view of the same source with style=Powershell&singularizeOperationIds=true&format=json, and copy only the IDs matched by exact path and HTTP method. Missing or ambiguous mappings fail explicitly; reference request failures cannot silently leave mixed naming.
  • Run TweakOpenApi.ps1 -OperationIdsOnly for the Kiota-compatible documents. Reuse the existing preposition/word corrections without rewriting response codes, navigation properties, schemas, parameters, or other content. Preserve quotes, comments and line endings; ignore JSON removal reports and subdirectories. The default PowerShell tweak behavior remains enabled for the existing flow.
  • Add focused regression coverage and document the refresh behavior. Allow empty lines in the deprecation pruner's line-array parameters so normal YAML final newlines do not break the combined refresh.

Example: auditLogs.auditLogRoot.UpdateAuditLogRoot becomes auditLog.auditLogRoot_UpdateAuditLogRoot, while discriminators, anyOf/oneOf, additional properties and navigation properties remain intact.

Validation

  • Invoke-Pester -Path @('.\tools\Tests\KiotaCompatOperationIds.Tests.ps1', '.\tools\Tests\Remove-ExpiredDeprecatedOpenApiOperations.Tests.ps1') -Output None -PassThru — passed: 30 tests. Includes both refresh profiles, exact non-ID content preservation, quoted IDs, compatibility corrections, missing mappings, retries/reference failures, unchanged default tweaks, and deprecation pruning.
  • Live Reports downloads for v1.0 and beta — passed: after masking operation-ID lines, output matched the Plain source exactly; all 110 v1.0 / 381 beta common operations matched the IDs in the PowerShell-source document after the existing tweaks. Pruning also completed for both profiles.
  • kiota generate -d (Join-Path $validationRoot 'v1.0\Reports.yml') -l CSharp -c ReportsClient -n Microsoft.Graph.OperationIdValidation -o (Join-Path $validationRoot 'client') --log-level Warning — passed with Kiota 1.34.1, generating 326 C# source files ($validationRoot was temporary validation output). Kiota reported unresolved discriminator-reference warnings in the sliced schema, but no operation-ID/duplicate warnings.
  • git --no-pager diff --cached --check — passed.

No committed OpenAPI corpus, generated clients/wrappers, or directive migration ledgers are regenerated here; the naming changes take effect on the next refresh. Full wrapper gates were not run because this PR changes refresh tooling rather than generated wrapper output.

Other links

Preserve Plain Kiota schemas while copying singularized PowerShell operation IDs and applying operation-ID-only compatibility tweaks. Cover both refresh profiles, schema preservation, failure handling, and deprecation pruning.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: b803bea4-5e52-445b-8d8b-ecfb22cfbca6
@ramsessanchez
Ramses Sanchez-Hernandez (ramsessanchez) merged commit 5c92f8d into powershell-v3 Oct 23, 2026
4 checks passed
@ramsessanchez
Ramses Sanchez-Hernandez (ramsessanchez) deleted the ramsessanchez-openapi-operation-ids branch October 23, 2026 18:56
This was referenced Oct 27, 2026
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.

1 participant