python-jsonschema / python-jsonschema/jsonschema
Ensure extended validators can create keywords which override exception messages
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 5k
- Forks
- 671
- Avg merge
- 1d 1h
- Merged PRs (30d)
- 10
Description
Hi, first of all, thanks for all your work with this package.
All in all i think it works great and really does what it should and is supposed to do.
I think that if i should mention anything that i think could be better it would probably be better error messages, now i do understand that it is really hard to generate good error messages for all use cases but something that could be very useful is the option to add custom error messages.
Here is an example.
{
"type": "object",
"properties": {
"templates": {
"type": "object",
"properties": {
"path": {"type": "string", "minLength": 1, "pattern": "^(/[^/]+)+$", "message": {"pattern": "You must use a valid full path with no trailing slashes"}}},
"required": ["path"],
},
},
"required": ["templates"],
}
I've read the documentation and haven't been able to find a way to define custom messages in the schema, but maybe i have missed something?
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
No file or test entry point is named in the issue. Start by reading the validator and extended-validator documentation, then locate how exception messages are produced; done means an extended validator can define schema keywords that override those messages, with coverage for the example behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- backend
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100