python-jsonschema / python-jsonschema/jsonschema
Support encountering of a `"deprecated": true` keyword by propagating a deprecation warning
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 5k
- Forks
- 671
- Avg merge
- 1d 1h
- Merged PRs (30d)
- 10
Description
New in draft 2019-09 The
deprecatedkeyword is a boolean that indicates that the instance value the keyword applies to should not be used and may be removed in the future.[1]
Usage example:
from jsonschema import validators
schema = {
"properties": {
"id": {"type": "integer"},
"name": {"type": "string", "deprecated": True},
},
}
instance={"id": 1, "name": "abc"}
validator = validators.Draft202012Validator(schema, check_deprecated=True)
validator.validate(instance) # raises ValidationError
I can start working on a PR if the maintainers are interested and the suggested API makes sense.
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
Start with validators.Draft202012Validator and its validate entry point, then trace how keyword annotations are handled. Clarify and test the requested check_deprecated behavior, including whether a deprecated property should produce a warning or the ValidationError shown in the example.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- backend-api-design
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100