Skip to content

Commit

Permalink
fix: Update base URI for jsonschema.RefResolver (#1976)
Browse files Browse the repository at this point in the history
* update baseuri to include the version of the HiFa JSON schema to provide forward-compatibility for jsonschema>=4.15.0
  • Loading branch information
kratsg authored Aug 31, 2022
1 parent 9842e82 commit 925769a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/pyhf/schema/validator.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ def validate(spec: Mapping, schema_name: str, version: Union[str, None] = None):

# note: trailing slash needed for RefResolver to resolve correctly
resolver = jsonschema.RefResolver(
base_uri=f"file://{variables.schemas}/",
referrer=f"{version}/{schema_name}",
base_uri=f"file://{variables.schemas}/{version}/",
referrer=f"{schema_name}",
store=variables.SCHEMA_CACHE,
)
validator = jsonschema.Draft6Validator(
Expand Down

0 comments on commit 925769a

Please sign in to comment.