oapi-codegen / nethttp-middleware

Apache License 2.0
8 stars 6 forks source link

[Meta] Middlewares have different HTTP response codes for auth errors #17

Open jamietanna opened 3 months ago

jamietanna commented 3 months ago

Looks like this should be aligned everywhere.

https://github.com/oapi-codegen/nethttp-middleware/blob/ac41b5931767285e49769942ec8578f0bc0b0dda/oapi_validate.go#L105-L106

https://github.com/oapi-codegen/echo-middleware/blob/bd401ffc8b5c352e067dc6a2bf2a47fcb6b4e2d2/oapi_validate.go#L174

mromaszewicz commented 3 months ago

IMO, every bug we hit where a hardcoded behavior is incorrect or inconsistent is an opportunity to allow the user to parameterize the response. I'll think about how to do this. We don't want to change existing behavior, but also we need to allow users to handle that error themselves.