-
Thanks for all the work so far. We had a user catch an issue in our project that depends on From the old code: resolver = jsonschema.RefResolver(
base_uri=f"file://{variables.schemas}/",
referrer=f"{version}/{schema_name}",
store=variables.SCHEMA_CACHE,
) to this new code resolver = jsonschema.RefResolver(
base_uri=f"file://{variables.schemas}/{version}/",
referrer=f"{schema_name}",
store=variables.SCHEMA_CACHE,
) where we've moved the For example, when resolving {
"$schema": "http://json-schema.org/draft-06/schema#",
"$id": "https://scikit-hep.org/pyhf/schemas/1.0.0/workspace.json",
"$ref": "defs.json#/definitions/workspace"
} it will try to look for |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 7 replies
-
Hi! bf92aed is the commit which fixed this on draft 6 if that's what you're looking for? In the schema you're showing, the specified behavior is that your (Note by the way also that though it probably doesn't matter, you're not passing the right type of object to |
Beta Was this translation helpful? Give feedback.
Hi! bf92aed is the commit which fixed this on draft 6 if that's what you're looking for? In the schema you're showing, the specified behavior is that your
$id
should be ignored there, so it doesn't affect the resolution URI. In newer drafts though it'd work.(Note by the way also that though it probably doesn't matter, you're not passing the right type of object to
referrer
when constructing aRefResolver
. The argument is supposed to be the referrer document, i.e. a schema -- the one you want the precise URIf"file://{variables.schemas}/{version}/"
to resolve to. If you never actually use that URI and it's just used as a base URI, then yeah it doesn't matter, but just pointing out it's no…