OpenAPITools / OpenAPITools/openapi-generator
[REQ] Select a specific media type when generating classes from swagger
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 26.8k
- Forks
- 7.7k
- PR merge metrics
- PR metrics pending
Description
I have 2 media type(because of versioning) for a response in my swagger the first "application/v1+json" and the second "application/v2+json" like this :


but when i generate the classes from the swagger i have just the controllerApi for version 2 generated there is no version 1 :

Is there a possibility to choose which media type we want to use , and why we dont have 2 controllers one for each version for example ?
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the generation described with the Swagger/OpenAPI document and determine which generator and target language are being used; the issue names no source files, tests, or entry points. Clarify whether the expected result is selecting one media type or generating separate controllers for both versions, then define completion around that behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- openapi
- Domain
- api, tooling
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100