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
Hi,
In the OpenAPI specification of the request handlers, it is possible to declare response schemas for different response status, but if the response is generated by an exception handler, it will not be validated like normal responses.
This can lead to inconsistent OpenAPI specification and implementation.
What about wrapping the on_exception calls in the Operation class (e.g.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hi,
In the OpenAPI specification of the request handlers, it is possible to declare response schemas for different response status, but if the response is generated by an exception handler, it will not be validated like normal responses.
This can lead to inconsistent OpenAPI specification and implementation.
What about wrapping the
on_exception
calls in theOperation
class (e.g.django-ninja/ninja/operation.py
Line 127 in eecb05f
If it is a good idea, I can make a PR for it.
This proposal would be a solution for this question:
#1118 (comment)
Beta Was this translation helpful? Give feedback.
All reactions