Closed Bjwebb closed 3 years ago
That is very cool.
I'm conscious that it's passing an English-language string, though. Is the intention that the string gets caught and identified? (is that what we do for other places where we override validation messages?).
Yes, it's passing an English-language string. The name of the validator ("startswith") is attached to the ValidationError by the jsonschema library. So, when there's only 1 message per validator function, it's possible to know which it is. However, me and @odscjames have discussed previously that even in this case, it's better to pass an explicit error_id ([example]), so I will add this.
Currently there's some code for overwriting these messages in lib-cove-web, but its not currently easy to change. I discussed with @robredpath that eventually we want an admin to be able to put a message overwrite file in the right place, with which they can change any of the messages.
https://github.com/OpenDataServices/standards-lab/issues/26
Example: Schema:
API process endpoint: