I have Springfox annotations in the code as follows:
@ApiResponses(value = {
@ApiResponse(code = 200, message = "Options for the endpoint", responseHeaders = {@ResponseHeader(name = "Allow", description = "Verbs allowed")})})
However, the header is not being rendered below the response In Swagger UI.
If I add global response (for internal server error) through Docket, its header renders just fine.
Is this a misconfiguration or what is a problem here?
My problem was that annotation parameter "response" was not set to String.class. It defaults to Void.class and does not render with it.
Corrected code is:
@ApiResponse(code = 200, message = "Options for the endpoint", responseHeaders = {@ResponseHeader(name = "Allow", description = "Verbs allowed", response = String.class)})})
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With