Skip to content

"$ref" with "$recursiveAnchor": true should not change behavior #296

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
handrews opened this issue Nov 11, 2019 · 3 comments
Closed

"$ref" with "$recursiveAnchor": true should not change behavior #296

handrews opened this issue Nov 11, 2019 · 3 comments
Labels
missing test A request to add a test to the suite that is currently not covered elsewhere.
Milestone

Comments

@handrews
Copy link
Contributor

We should have a test that verifies that $ref is not affected by $recursiveAnchor

@handrews handrews added this to the 2019-09 milestone Nov 11, 2019
@Julian Julian added the missing test A request to add a test to the suite that is currently not covered elsewhere. label Nov 29, 2019
@Vinit-Pandit
Copy link
Contributor

Vinit-Pandit commented Apr 5, 2024

@Julian
Could you please confirm is this test aligns with the requirements of this issue?

{
        "description": "$ref with $recursiveAnchor",
        "schema": {
            "$schema": "https://json-schema.org/draft/2019-09/schema",
            "$id": "https://example.com/schemas/array-without-unevaluatedItems",
            "$ref": "/schemas/array-with-unevaluatedItems",
            "$recursiveAnchor": true,
            "unevaluatedItems": false,
            "$defs": {
                "/schemas/array-with-unevaluatedItems": {
                    "$schema": "https://json-schema.org/draft/2019-09/schema",
                    "$id": "/schemas/array-with-unevaluatedItems",
                    "$recursiveAnchor": true,
                    "type": "array",
                    "items": [
                        {
                            "type": "string"
                        },
                        {
                            "$ref": "#"
                        }
                    ]
                }
            }
        },
        "tests": [
            {
                "description": "$ref pointing to the array-with-unevaluatedItems",
                "data" : ["foo",["bar" , [] , 8]],
                "valid": true
            },
            {
                "description": "on root array-without-unevaluatedItems is apply",
                "data" : ["foo",["bar" , [] , 8], 8],
                "valid": false
            }
        ]
    }

@jdesrosiers
Copy link
Member

This looks correct to me.

@Vinit-Pandit
Copy link
Contributor

Done in this #731, so if requirements for this issue are covered, I kindly request to close this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
missing test A request to add a test to the suite that is currently not covered elsewhere.
Projects
None yet
Development

No branches or pull requests

5 participants