Forum Discussion

berlinGuy's avatar
Occasional Visitor
3 years ago

custom error message for component validation


Im using OpenAPI 3.0.1, and use components that have type/value validations. (i.e. type/enum/range).

When I access the relevant paths with wrong type/values, I get a default message which isn't human readable

such as:

"message": "request body has an error: doesn't match the schema: Error at <fieldName>: Doesn't match schema \"oneOf\"".
I'd like to create a custom error message for each component.
I'd appreciate your help 🙂
No RepliesBe the first to reply