Skip to content

fix(openapi3): emit valid deprecated parameter directives - #12042

Merged
Timothee Guerin (timotheeguerin) merged 1 commit into
microsoft:mainfrom
Miko997:fix/openapi3-deprecated-parameter-directive
Sep 23, 2026
Merged

Timothee Guerin (timotheeguerin) merged 1 commit into
microsoft:mainfrom
Miko997:fix/openapi3-deprecated-parameter-directive

Conversation

@Miko997

Copy link
Copy Markdown
Contributor

Fixes #10043.

Emit operation-parameter directives with their messages and place them on separate lines before decorators. Strengthen the existing regression with the OpenAPI 3.2 enum reference and default, and compile the generated TypeSpec.

Testing

  • pnpm --filter @typespec/openapi3 exec vitest run test/tsp-openapi3/ref-sibling-keywords.test.ts — fails before the fix, passes after.
  • pnpm --filter @typespec/openapi3 test
  • pnpm -r --filter "@typespec/openapi3..." build
  • pnpm build
  • pnpm test — 10,140 passed, 25 skipped.
  • pnpm format:check
  • pnpm lint
  • pnpm cspell

Lint passed after pnpm clean; running it after a build also fails on unchanged upstream due to a compiler declaration-output collision. The full test run passed after recreating the ignored packages/monarch/temp directory, which the cached rebuild did not restore.

Copilot AI lite review requested due to automatic review settings September 23, 2026 16:26
@microsoft-github-policy-service microsoft-github-policy-service Bot added emitter:openapi3 Issues for @typespec/openapi3 emitter openapi3:converter Issues for @typespec/openapi3 openapi to typespec converter labels Sep 23, 2026
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 1 pipeline(s).
1 pipeline(s) were filtered out due to trigger conditions.
There may be pipelines that require an authorized user to comment /azp run to run.

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.

Copilot review overview

🟢 Approval recommended

No unresolved blocking issues were identified.

Review effort: Lite
Findings: None

What changed in this PR

Fixes OpenAPI 3.2 conversion of deprecated parameters by emitting valid, message-bearing directives.

Changes:

  • Corrects parameter directive formatting.
  • Strengthens regression and compilation tests.
  • Adds an OpenAPI 3 fix changelog entry.
File Description
packages/​openapi3/​test/​tsp-openapi3/​ref-sibling-keywords.test.ts Adds regression and compilation validation.
packages/​openapi3/​src/​cli/​actions/​convert/​generators/​generate-operation.ts Corrects parameter directive rendering.
.chronus/​changes/​fix-openapi3-deprecated-parameter-directive-2026-8-23-19-13-13.md Records the bug fix.

💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@Miko997

Copy link
Copy Markdown
Contributor Author

@microsoft-github-policy-service agree

@pkg-pr-new

pkg-pr-new Bot commented Sep 23, 2026

Copy link
Copy Markdown

Open in StackBlitz

npm i https://pkg.pr.new/@typespec/openapi3@12042

commit: e187c2a

@github-actions

Copy link
Copy Markdown
Contributor

All changed packages have been documented.

  • @typespec/openapi3
Show changes

@typespec/openapi3 - fix ✏️

[converter] Emit valid #deprecated directives for converted operation parameters.

Merged via the queue into microsoft:main with commit 6da5df7 Sep 23, 2026
29 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

emitter:openapi3 Issues for @typespec/openapi3 emitter openapi3:converter Issues for @typespec/openapi3 openapi to typespec converter

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: OpenAPI 3.2 import incorrectly applies #deprecated

3 participants