OptimumCode / json-schema-validator

The JSON schema validation library that works with https://github.com/Kotlin/kotlinx.serialization

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Bug: implementation doesn’t pass new dynamicRef test suites

OptimumCode opened this issue · comments

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

Test suite $dynamicRef skips over intermediate resources - direct reference is marked as failed

Expected Behavior

Test suite $dynamicRef skips over intermediate resources - direct reference must be successful

JSON schema

{
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "$id": "https://test.json-schema.org/dynamic-ref-skips-intermediate-resource/main",
    "type": "object",
    "properties": {
        "bar-item": {
            "$ref": "item"
        }
    },
    "$defs": {
        "bar": {
            "$id": "bar",
            "type": "array",
            "items": {
                "$ref": "item"
            },
            "$defs": {
                "item": {
                    "$id": "item",
                    "type": "object",
                    "properties": {
                        "content": {
                            "$dynamicRef": "#content"
                        }
                    },
                    "$defs": {
                        "defaultContent": {
                            "$dynamicAnchor": "content",
                            "type": "integer"
                        }
                    }
                },
                "content": {
                    "$dynamicAnchor": "content",
                    "type": "string"
                }
            }
        }
    }
}

Library version

0.0.12

Anything else?

https://github.com/json-schema-org/JSON-Schema-Test-Suite/blob/ff29264c29b75623ffd06d1aae4bdd6ba546f847/tests/draft2020-12/dynamicRef.json#L761