Created by: wtrocki
https://github.com/OpenAPITools/openapi-generator/issues/10340
When API returns mixed content - 200 returns File/Binary and 500 returns JSON which is typical for error handling. Generated code will include two accept headers. Problem is that selectHeaderAccept function that builds headers always forces accept headers to be JSON. This will crash as the server only knows how to return zip content type.
Request is mixed with zip and json on 500:
],
"responses": {
"200": {
"content": {
"application/zip": {
"schema": {
"$ref": "#/components/schemas/FileContent"
}
}
},
"description": "Response when the export is successful."
},
"500": {
"$ref": "#/components/responses/ServerError"
}
},
Headers are generated properly but request is later made with "application/json"
HTTPHeaderAccepts := []string{"application/zip", "application/json"}