Repository navigation
feat(openapi-generator): support multiple body types on single operation - #7040
Open
davidkna-sap wants to merge 1 commit into
Open
davidkna-sap wants to merge 1 commit into
davidkna-sap wants to merge 1 commit into
Conversation
davidkna-sap
force-pushed
the
davidkna-sap/openapi-generator-fix-multi
branch
from
October 20, 2026 09:36
50a7e48 to
dfb10ee
Compare
davidkna-sap
marked this pull request as ready for review
October 20, 2026 10:36
Comment on lines
+40
to
46
| if (parsedMediaTypes.length) { | ||
| return parsedMediaTypes.map(mediaType => ({ | ||
| required: !!resolvedRequestBody.required, | ||
| description: resolvedRequestBody.description, | ||
| ...mediaType | ||
| }; | ||
| })); | ||
| } |
Member
There was a problem hiding this comment.
This early return skips the parseMediaType fallback, so a json+xml body loses its old anyOf:[json, any] widening and emits JSON-only. Intentional?
Member
Author
There was a problem hiding this comment.
It should be fine, XML isn't really supported as a payload for OpenAPI-defined specifications.
InjunPark-sap
approved these changes
Oct 20, 2026
This branch has not been deployed
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.
When an OpenAPI operation declares multiple request body representations
(e.g.
application/jsonandmultipart/form-data), the generator previouslycollapsed them into a single generated operation. This PR makes the generator
emit one operation per supported media type.
Fixes #7039
Related https://github.com/SAP/ai-sdk-js-backlog/issues/699.