[
    {
        "description": "$id must be evaluated before $ref to get the proper $ref destination (with $anchors)",
        "schema": {
            "$id": "/ref-and-id1/base.json",
            "$ref": "#bigint",
            "$defs": {
                "bigint": {
                    "$comment": "canonical uri: /ref-and-id1/base.json/$defs/bigint; another valid uri for this location: /ref-and-id1/base.json#bigint",
                    "$anchor": "bigint",
                    "maximum": 10
                },
                "smallint": {
                    "$comment": "canonical uri: /ref-and-id1#/$defs/smallint; another valid uri for this location: /ref-and-id1/#bigint",
                    "$id": "/ref-and-id1/",
                    "$anchor": "bigint",
                    "maximum": 2
                }
            }
        },
        "tests": [
            {
                "description": "data is valid against first definition",
                "data": 5,
                "valid": true
            },
            {
                "description": "data is invalid against first definition",
                "data": 50,
                "valid": false
            }
        ]
    },
    {
        "description": "$id must be evaluated before $ref to get the proper $ref destination",
        "schema": {
            "$id": "/ref-and-id2/base.json",
            "$ref": "int.json",
            "$defs": {
                "bigint": {
                    "$comment": "canonical uri: /ref-and-id2/int.json",
                    "$id": "int.json",
                    "maximum": 10
                },
                "smallint": {
                    "$comment": "canonical uri: /ref-and-id2-int.json",
                    "$id": "/ref-and-id2-int.json",
                    "maximum": 2
                }
            }
        },
        "tests": [
            {
                "description": "data is valid against first definition",
                "data": 5,
                "valid": true
            },
            {
                "description": "data is invalid against first definition",
                "data": 50,
                "valid": false
            }
        ]
    }
]