cuelang.org/go@v0.13.0/encoding/jsonschema/testdata/external/tests/draft2020-12/optional/id.json (about) 1 [ 2 { 3 "description": "$id inside an enum is not a real identifier", 4 "comment": "the implementation must not be confused by an $id buried in the enum", 5 "schema": { 6 "$schema": "https://json-schema.org/draft/2020-12/schema", 7 "$defs": { 8 "id_in_enum": { 9 "enum": [ 10 { 11 "$id": "https://localhost:1234/draft2020-12/id/my_identifier.json", 12 "type": "null" 13 } 14 ] 15 }, 16 "real_id_in_schema": { 17 "$id": "https://localhost:1234/draft2020-12/id/my_identifier.json", 18 "type": "string" 19 }, 20 "zzz_id_in_const": { 21 "const": { 22 "$id": "https://localhost:1234/draft2020-12/id/my_identifier.json", 23 "type": "null" 24 } 25 } 26 }, 27 "anyOf": [ 28 { 29 "$ref": "#/$defs/id_in_enum" 30 }, 31 { 32 "$ref": "https://localhost:1234/draft2020-12/id/my_identifier.json" 33 } 34 ] 35 }, 36 "tests": [ 37 { 38 "description": "exact match to enum, and type matches", 39 "data": { 40 "$id": "https://localhost:1234/draft2020-12/id/my_identifier.json", 41 "type": "null" 42 }, 43 "valid": true 44 }, 45 { 46 "description": "match $ref to $id", 47 "data": "a string to match #/$defs/id_in_enum", 48 "valid": true 49 }, 50 { 51 "description": "no match on enum or $ref to $id", 52 "data": 1, 53 "valid": false 54 } 55 ] 56 } 57 ]