swagger-api / swagger-api/swagger-codegen

Response Media Types are not set in CodegenResponse contents attribute

Open
#10,207 1 comment 0 reactions 0 assignees View on GitHub

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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.