huma
huma copied to clipboard
Override ErrorModel for single operations
Currently the default error model can be overridden globally for the API. Would you consider adding a feature to set a custom error model at the level of operations ?
As far as I understand, it is already kinda possible to do so by setting the Operation.Responses
, but this is cumbersome since one must provide Schema
definitions instead of simply providing a Go struct type.
Operation
could be extended with an ErrorModel
field which would implement the StatusError
interface. I am willing to try and submit a PR if this idea finds approval.