GeezerVison is showing github.com — Fix: Allow multiple JSON types to be generated by jamietanna · Pull Request #1159 · oapi-codegen/oapi-codegen
Conversation
jamietanna
commented
Jul 31, 2023
•
edited
Loading
Uh oh!
There was an error while loading. Please reload this page.
As flagged in #1127, the use of IsMediaTypeJson leads to potentially
having duplicate types generated, leading to compilation errors.
We can instead only generate i.e. CreateWhateverJSONRequestBody for
the application/json type, and then construct a specific type for each
media type with a matching name.
This requires we add a new utility method IsJSON to simplify our
checks, and wire it in in each place that requires we render
JSON-specific code.
Closes #1127.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
As flagged in #1127, the use of `IsMediaTypeJson` leads to potentially
having duplicate types generated, leading to compilation errors.
We can instead only generate i.e. `CreateWhateverJSONRequestBody` for
the `application/json` type, and then construct a specific type for each
media type with a matching name.
This requires we add a new utility method `IsJSON` to simplify our
checks, and wire it in in each place that requires we render
JSON-specific code.
Closes #1127.
This was referenced Aug 3, 2023
debuggerpk
pushed a commit
to breuHQ/oapi-codegen
that referenced
this pull request
Sep 18, 2023
As flagged in oapi-codegen#1127, the use of `IsMediaTypeJson` leads to potentially
having duplicate types generated, leading to compilation errors.
We can instead only generate i.e. `CreateWhateverJSONRequestBody` for
the `application/json` type, and then construct a specific type for each
media type with a matching name.
This requires we add a new utility method `IsJSON` to simplify our
checks, and wire it in in each place that requires we render
JSON-specific code.
Closes oapi-codegen#1127.
danicc097
pushed a commit
to danicc097/oapi-codegen
that referenced
this pull request
Aug 31, 2024
As flagged in oapi-codegen#1127, the use of `IsMediaTypeJson` leads to potentially
having duplicate types generated, leading to compilation errors.
We can instead only generate i.e. `CreateWhateverJSONRequestBody` for
the `application/json` type, and then construct a specific type for each
media type with a matching name.
This requires we add a new utility method `IsJSON` to simplify our
checks, and wire it in in each place that requires we render
JSON-specific code.
Closes oapi-codegen#1127.
This pull request was closed.
Uh oh!
There was an error while loading. Please reload this page.
Assignees
No one assigned
Milestone
No milestone
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.
|