swagger-api / swagger-api/swagger-codegen
Response Media Types are not set in CodegenResponse contents attribute
Nobody has claimed this yet.
- Dominant language
- Mustache
- Stars
- 17.8k
- Forks
- 6k
- PR merge metrics
- No merged PRs in 30d
Description
#9786 ### Description
if we set Response Media Types in swagger file, CodegenResponse contents attribute are not set.
Swagger-codegen version
swagger-codegen 3.0.19
Swagger declaration file content or url
"responses": {
"200": {
"content": {
"application/json": {
"schema": {
"type": "array",
"items": {
"$ref": "#/components/schemas/Datas"
}
}
},
"text/csv": {
"schema": {
"description": "File",
"type": "string",
"format": "binary"
}
}
},
"description": "Succes"
},
Command line used for generation
Steps to reproduce
Related issues/PRs
Suggest a fix/enhancement
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 locating CodegenResponse and the response-processing path for the shown OpenAPI response. Reproduce with the declaration containing application/json and text/csv, then verify that the contents attribute records both media types; use that as the completion check.
Written by the indexing model from the issue text.
Assessment
- Domain
- api, tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100