Bug Report Checklist
Description
The specification allows a "default" response to be used, typically for error payloads - https://swagger.io/specification/#path-item-object-example
If code is generated using a "default" response then the wrong HTTP return code is indicated;
@Operation(
operationId = "getPetsById",
summary = "Find pets by ID",
responses = {
@ApiResponse(responseCode = "200", description = "pet response", content = {
@Content(mediaType = "application/xml", array = @ArraySchema(schema = @Schema(implementation = Pet.class))),
@Content(mediaType = "application/json", array = @ArraySchema(schema = @Schema(implementation = Pet.class)))
}),
@ApiResponse(responseCode = "200", description = "error payload"
)
}
)
Note the responseCode for the "error payload" is 200. It should be "default".
This means anyone examining the generated code will get a misleading idea of what the response could be.
openapi-generator version
6.2.1
OpenAPI declaration file content or url
Generation Details
Steps to reproduce
Related issues/PRs
Suggest a fix
Bug Report Checklist
Description
The specification allows a "default" response to be used, typically for error payloads - https://swagger.io/specification/#path-item-object-example
If code is generated using a "default" response then the wrong HTTP return code is indicated;
Note the responseCode for the "error payload" is 200. It should be "default".
This means anyone examining the generated code will get a misleading idea of what the response could be.
openapi-generator version
6.2.1
OpenAPI declaration file content or url
Generation Details
Steps to reproduce
Related issues/PRs
Suggest a fix