Skip to content
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

Drop the initial resolve step for dynamic references #1142

Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 7 additions & 14 deletions jsonschema-core.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1510,22 +1510,15 @@
<t>
Together with "$dynamicAnchor", "$dynamicRef" implements a cooperative
extension mechanism that is primarily useful with recursive schemas
(schemas that reference themselves). The extension point is defined with
"$dynamicAnchor" and only exhibits runtime dynamic behavior when referenced
with "$dynamicRef".
(schemas that reference themselves). The extension point is defined
with "$dynamicAnchor", and only exhibits runtime dynamic behavior when
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The comma isn't necessary in the current form. If you want to include a comma, the second half of the sentence needs to be a complete sentence.

Suggested change
with "$dynamicAnchor", and only exhibits runtime dynamic behavior when
with "$dynamicAnchor", and it only exhibits runtime dynamic behavior when

referenced with "$dynamicRef".
Comment on lines +1514 to +1515
Copy link
Member

@gregsdennis gregsdennis Sep 24, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In order to remove the "$dynamicAnchor produces a $ref-able anchor" behavior, we need to adjust this sentence. We decided that dynamic behavior always occurs because referencing with $ref is now impossible.

We'll likely need to make changes in the $dynamicAnchor section as well.

</t>
<t>
The value of the "$dynamicRef" property MUST be a string which is a
IRI-Reference that contains a valid <xref target="anchor">plain name
fragment</xref>. Resolved against the current IRI base, it indicates
Comment on lines -1518 to -1520
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We still need the first sentence, which describes the value form.

the schema resource used as the starting point for runtime resolution.
This initial resolution is safe to perform on schema load.
</t>
<t>
The schema to apply is the outermost schema resource in the
<xref target="scopes">dynamic scope</xref> that defines a
"$dynamicAnchor" that matches the plain name fragment in the initially
resolved IRI.
The value of the "$dynamicRef" property MUST be a valid
<xref target="anchor">plain name fragment</xref>. The schema to apply is
the outermost schema resource in the <xref target="scopes">dynamic scope</xref>
that defines a "$dynamicAnchor" matching the value of this keyword.
</t>
<t>
For a full example using these keyword, see appendix
Expand Down