Skip to content

Question about section 8.2.4.6. Dereferencing; is the reference to $id incorrect? Should be $anchor? #990

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
jimblackler opened this issue Sep 15, 2020 · 1 comment · Fixed by #991
Labels
clarification Items that need to be clarified in the specification Priority: High

Comments

@jimblackler
Copy link

I'm trying to update my validator to 2019-09 and looking for precise info about how to handle new keyword $anchor.

I searched for $ahcnor references in the 2019-09 spec that I have.

"When an implementation encounters the <#/$defs/single> schema, it resolves the "$id" URI reference against the current base URI to form https://example.net/root.json#item."

When an implementation encounters the &lt;#/$defs/single&gt; schema,

However the snippet above does not include an $id property at defs/single; it has an $anchor property.

Is that incorrect or have I misunderstood?

@jdesrosiers
Copy link
Member

Yeah, that looks wrong. Probably something that slipped through the cracks when $anchor was split off of $id.

Prior to draft 2019-09, "$anchor": "item" from that example would have been "$id": "#item". In that form, the description makes sense. $anchor should behave exactly like an $id starting with a fragment did in previous drafts. The only difference is that the leading # is no longer used.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
clarification Items that need to be clarified in the specification Priority: High
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants