Fix OpenAPI3 converter to generate separate operations for multiple content types#8830
Merged
Fix OpenAPI3 converter to generate separate operations for multiple content types#8830
Conversation
…PI3 conversion - Split operations with incompatible content types (multipart vs non-multipart) - Add @SharedRoute decorator to split operations - Add tests for multiple content type handling - Update existing test to reflect new behavior Co-authored-by: baywet <7905502+baywet@users.noreply.github.com>
Co-authored-by: baywet <7905502+baywet@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix generation of parameters for all declared content types
Fix OpenAPI3 converter to generate separate operations for multiple content types
Oct 27, 2025
Contributor
|
All changed packages have been documented.
Show changes
|
Signed-off-by: Vincent Biret <vibiret@microsoft.com>
baywet
approved these changes
Oct 28, 2025
timotheeguerin
approved these changes
Oct 28, 2025
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.
The OpenAPI3-to-TypeSpec converter was discarding non-multipart content types when multipart was present, generating only one operation instead of multiple operations with
@sharedRoute.Changes
transform-paths.ts: Split operations with incompatible content types (multipart vs non-multipart) into separate operations with@sharedRoutedecorator and content-type-based suffixesgenerate-operation.ts: Removed filtering logic that discarded non-multipart request bodies when multipart was presentExample
Input OpenAPI operation with multiple content types:
Now generates two operations instead of one:
Note: Operations with only non-multipart content types continue to be combined with unions (existing behavior).
Warning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
telemetry.astro.buildnode /home/REDACTED/work/typespec/typespec/website/node_modules/.bin/../astro/astro.js build(dns block)If you need me to access, download, or install something from one of these locations, you can either:
Original prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.