Open itsjef opened 3 years ago
Looks like I can derive from https://github.com/pyeve/cerberus/issues/174 :thinking:
I came here looking similar to the Mongo Schema Validation, where I could write in a field description the requirements of the field. Unfortunately looks like Cerberror is the closest solution to what I want. But this is too deep inside Eve to just "replace".
Is this still relevant? If so, what is blocking it? Is there anything you can do to help move it forward?
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.
It is still relevant.
I am developing a dictionary application. On the backend side, there are certain validation rules for a dictionary entry. This is the error response when one of them is violated:
However, when the frontend client consumes this response, the error message is not user-friendly enough to display directly on the web page. Additionally, to support i18n, it must also provide the message in another language (e.g: Japanese).
It would be nice if I can provide 2 new attributes besides the default message:
detail
: A human-readable, lengthier explanation of the error, suitable for direct display.error
: An unique identifier to the error in the response. It could be the class name of an exception. The client can also map this identifier to any custom messages instead of using thedetail
string above.The response would look like this:
Environment
@nicolaiarocci Thank you for reading and please tell me what you think.