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
Description
Currently, we have a way to document error HTTP status codes supported by an Operation with exceptionToStatus property, as well as adding our own documentation with openApi property.
That much is great, however by default we have limited information about errors in the OpenAPI documentation: an HTTP code, description and "string" as scheme.
With v3.2, we can now represent errors/exceptions as ErrorResource, which should give us the ability to show proper scheme of a response in documentation.
For that we need to have a way to map ErrorResources to specific Operations. Knowing what ErrorResources could be thrown, we can turn ErrorResource classes into OpenAPI documentation.
Example
A way to solve this would be by introducing to Operation class a new property errors, that contains a list of ErrorResources used:
I would also like to see something like this but IMHO, it should be nice to also handle generic ErrorResource (with no status code explicitely configured) such as:
Description
Currently, we have a way to document error HTTP status codes supported by an Operation with
exceptionToStatus
property, as well as adding our own documentation withopenApi
property.That much is great, however by default we have limited information about errors in the OpenAPI documentation: an HTTP code, description and "string" as scheme.
With v3.2, we can now represent errors/exceptions as ErrorResource, which should give us the ability to show proper scheme of a response in documentation.
For that we need to have a way to map ErrorResources to specific Operations. Knowing what ErrorResources could be thrown, we can turn ErrorResource classes into OpenAPI documentation.
Example
A way to solve this would be by introducing to Operation class a new property
errors
, that contains a list of ErrorResources used:The text was updated successfully, but these errors were encountered: