Skip to content

Getting $ref history #1146

Open
Open
@atsuoishimoto

Description

@atsuoishimoto

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Dialects v2Issues which will likely be addressed as part of reworked dialect supportEnhancementSome new desired functionalityError ReportingIssues related to clearer or more robust validation error reporting

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions