What is the referrer
argument to RefResolver
?
#1044
-
What should the The documentation just says "The actual referring document". What does that mean? Is that:
The example in the FAQ uses I looked at the code implementing |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 6 replies
-
This is going to change in the next version when the referencing library replaces But it's the actual dictionary it sounds like in your case. In "official" JSON Schema dialects, schema documents are either mappings (dictionaries in Python) or boolean schemas, so in theory a referrer of But yeah these interfaces are old and not easy to understand, as I say, this should be easier with |
Beta Was this translation helpful? Give feedback.
-
Yes that helps. Should I write a PR to clarify the documentation, or is the upcoming change so imminent or substantial that it's not worth bothering? |
Beta Was this translation helpful? Give feedback.
This is going to change in the next version when the referencing library replaces
RefResolver
.But it's the actual dictionary it sounds like in your case. In "official" JSON Schema dialects, schema documents are either mappings (dictionaries in Python) or boolean schemas, so in theory a referrer of
True
is "sensical". The referrer is used for fragments / anchors / JSON Pointers -- e.g. for dereferencing#
or#/foo/bar
-- a referrer ofTrue
would contain no anchors (it contains no properties at all of course) so it should never hit code paths that dereference an anchor within but it's indeed possible to have a schematrue
be the root document for a ref resolver and to uselessly write#
and…