python-jsonschema / python-jsonschema/jsonschema
Getting $ref history
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 5k
- Forks
- 671
- Avg merge
- 1d 1h
- Merged PRs (30d)
- 10
Description
In large schemas, understanding which $ref is being referenced when an error occurs can be helpful in debugging. We used to refer to the history of $ref with (ill-mannered) code like this:
for error in validator.iter_errors(instance):
print(validator.resolver._scopes_stack)
print(error)
However, with the current version of jsonschema, validator.resolver is deprecated, and it will be not possible to refer to it.
Is there a legitimate way to retrieve this information in jsonschema?
Reference: #1144
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 the validator.iter_errors example in the issue and review reference #1144, then trace how the deprecated validator.resolver exposes the $ref scope history. Done means the project has a supported way to retrieve this debugging information without relying on the deprecated resolver, with the expected behavior documented or covered by tests.
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
- Needs clarification
- Newbie friendliness
- 25/100