-
-
Notifications
You must be signed in to change notification settings - Fork 607
Open
Labels
Dialects v2Issues which will likely be addressed as part of reworked dialect supportIssues which will likely be addressed as part of reworked dialect supportEnhancementSome new desired functionalitySome new desired functionality
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 ValidationErrorI can start working on a PR if the maintainers are interested and the suggested API makes sense.
Metadata
Metadata
Assignees
Labels
Dialects v2Issues which will likely be addressed as part of reworked dialect supportIssues which will likely be addressed as part of reworked dialect supportEnhancementSome new desired functionalitySome new desired functionality