fix(openapi3): convert deprecated: true on operations to #deprecated directive - #10901
Merged
Conversation
3 tasks
Co-authored-by: baywet <7905502+baywet@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add import for deprecated operations
fix(openapi3): convert Jun 5, 2026
deprecated: true on operations to #deprecated directive
baywet
approved these changes
Jun 5, 2026
baywet
marked this pull request as ready for review
June 5, 2026 18:20
baywet
requested review from
bterlson,
catalinaperalta,
iscai-msft,
markcowl,
timotheeguerin and
witemple-msft
as code owners
June 5, 2026 18:20
timotheeguerin
approved these changes
Jun 5, 2026
baywet
enabled auto-merge
June 5, 2026 18:21
commit: |
|
You can try these changes here
|
github-merge-queue
Bot
removed this pull request from the merge queue due to failed status checks
Jun 5, 2026
JennyPng
pushed a commit
to JennyPng/typespec
that referenced
this pull request
Jun 10, 2026
…ed` directive (microsoft#10901) PR microsoft#4453 added `deprecated` import support for models and properties but missed operations. An OpenAPI operation with `deprecated: true` would be silently dropped during conversion. ## Changes - **`transform-paths.ts`**: Extract `operation.deprecated` as a `TypeSpecDirective` and attach it to the resulting `TypeSpecOperation` (including through `splitOperationByContentType`). - **`generate-operation.ts`**: Add `generateDirectives` emission; refactor line-joining so directives render on their own line (preamble: doc + directives `\n`-joined; body: tags + decorators + `op` space-joined) — `#deprecated` inline with decorators is invalid TypeSpec syntax. ## Example ```yaml # Input paths: /widgets: get: operationId: Widgets_list deprecated: true responses: ... ``` ```tsp // Before (deprecated silently dropped) op Widgets_list(): ...; // After #deprecated "deprecated" op Widgets_list(): ...; ``` --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: baywet <7905502+baywet@users.noreply.github.com>
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.
PR #4453 added
deprecatedimport support for models and properties but missed operations. An OpenAPI operation withdeprecated: truewould be silently dropped during conversion.Changes
transform-paths.ts: Extractoperation.deprecatedas aTypeSpecDirectiveand attach it to the resultingTypeSpecOperation(including throughsplitOperationByContentType).generate-operation.ts: AddgenerateDirectivesemission; refactor line-joining so directives render on their own line (preamble: doc + directives\n-joined; body: tags + decorators +opspace-joined) —#deprecatedinline with decorators is invalid TypeSpec syntax.Example