You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The default MAY be used as a default response object for all HTTP codes that are not covered individually by the Responses Object.
The Responses Object MUST contain at least one response code, and if only one response code is provided it SHOULD be the response for a successful operation call.
You can use the default response to describe these errors collectively, not individually. “Default” means this response is used for all HTTP codes that are not covered individually for this operation.
Consequently:
JAX-RS endpoint is responding with 200
spec requires at least one success code in Responses Object
"default" is a fallback not to be interpreted as "success" and allowed only in addition to other responses
=> "default" should not be used as a single response code in Responses Object.
The text was updated successfully, but these errors were encountered:
#4482 introduces configuration property defaultResponseCode which allows to define the HTTP Status Code to use for such cases, replacing the default default.
Being this possibly opinionated and to maintain backward compatibility default is used when no config property is provided
Closing ticket, please reopen if still experiencing issues
Example endpoint implementation:
Generated openapi:
The openapi spec says:
https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#responsesObject
The Swagger OpenAPI guide (https://swagger.io/docs/specification/describing-responses/) says:
Consequently:
=> "default" should not be used as a single response code in Responses Object.
The text was updated successfully, but these errors were encountered: