Skip to content

Add annotation tests for $dynamicRef and $dynamicAnchor#862

Open
Anshikakalpana wants to merge 1 commit intojson-schema-org:mainfrom
Anshikakalpana:add-dynamicref-annotation-tests
Open

Add annotation tests for $dynamicRef and $dynamicAnchor#862
Anshikakalpana wants to merge 1 commit intojson-schema-org:mainfrom
Anshikakalpana:add-dynamicref-annotation-tests

Conversation

@Anshikakalpana
Copy link
Contributor

The annotation tests currently cover $ref resolving through $defs, but there are no equivalent tests for $dynamicRef resolving to a $dynamicAnchor.

This PR adds two annotation tests:

  1. A simple $dynamicRef resolving to a $dynamicAnchor.
  2. A case where $dynamicRef resolves to different $dynamicAnchors depending on dynamic scope, using the genericList/numberList/stringList pattern.

The second test uses $id to create separate schema resources so that $dynamicRef resolution follows the dynamic scope rules defined in the 2020-12 specification.

Both cases were verified using an annotation harness built with @hyperjump/json-schema.

Let me know if any adjustments are needed.

Closes #861

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add annotation test for $dynamicRef resolving to $dynamicAnchor

1 participant