kin-openapi icon indicating copy to clipboard operation
kin-openapi copied to clipboard

Improve openapi3filter HTTP Response Code Accuracy

Open msvechla opened this issue 2 years ago • 2 comments

Hi,

Currently, the request validation always returns 400 Bad Request as the HTTP response. Would you be open to making the codes more configurable/accurate?

Especially in regards to the security authentication middleware, as 401 or 403 error codes would be a better fit for requests failing the validation by the AuthenticationFunc.

I would also be open to creating a PR if required.

Thanks a lot!

msvechla avatar Jan 25 '22 14:01 msvechla

Do you have an update or opinion about this?

msvechla avatar Feb 08 '22 11:02 msvechla

Yes feel free to open a PR. Finer / more configurable error codes / responses is always welcomed.

fenollp avatar Feb 09 '22 11:02 fenollp