swagger-codegen contains a template-driven engine to generate documentation, API clients and server stubs in different languages by parsing your OpenAPI / Swagger definition.
When generating a new API interface, the response headers declared in the swagger file is not included in the @ApiResponse annotation, they are simply ignored
Swagger-codegen version
2.4.0
Swagger declaration file content or url
"201DomesticPaymentConsentsCreated": {
"description": "Domestic Payment Consents Created",
"headers": {
"x-fapi-interaction-id": {
"type": "string",
"description": "An RFC4122 UID used as a correlation id."
},
"x-jws-signature": {
"type": "string",
"description": "Header containing a detached JWS signature of the body of the payload."
}
},
"schema": {
"$ref": "#/definitions/OBWriteDomesticConsentResponse1"
}
}
Description
When generating a new API interface, the response headers declared in the swagger file is not included in the @ApiResponse annotation, they are simply ignored
Swagger-codegen version
2.4.0
Swagger declaration file content or url
Generated annotation missing the headers
Command line used for generation
java -jar swagger-codegen-cli.jar generate -i swagger.json -l spring --additional-properties interfaceOnly=true,dateLibrary=java8,serializableModel=true,java8=true
Steps to reproduce
Retrieve swagger file from openbanking uk repo https://github.com/OpenBankingUK/read-write-api-specs/blob/v3.0.0/dist/payment-initiation-swagger.json
Generate using command line above
Related issues/PRs
Suggest a fix/enhancement
How the @ApiResponse annotation should look like