cuelang.org/go@v0.13.0/encoding/jsonschema/testdata/external/tests/draft2020-12/optional/anchor.json (about)

     1  [
     2  	{
     3  		"description": "$anchor inside an enum is not a real identifier",
     4  		"comment": "the implementation must not be confused by an $anchor buried in the enum",
     5  		"schema": {
     6  			"$schema": "https://json-schema.org/draft/2020-12/schema",
     7  			"$defs": {
     8  				"anchor_in_enum": {
     9  					"enum": [
    10  						{
    11  							"$anchor": "my_anchor",
    12  							"type": "null"
    13  						}
    14  					]
    15  				},
    16  				"real_identifier_in_schema": {
    17  					"$anchor": "my_anchor",
    18  					"type": "string"
    19  				},
    20  				"zzz_anchor_in_const": {
    21  					"const": {
    22  						"$anchor": "my_anchor",
    23  						"type": "null"
    24  					}
    25  				}
    26  			},
    27  			"anyOf": [
    28  				{
    29  					"$ref": "#/$defs/anchor_in_enum"
    30  				},
    31  				{
    32  					"$ref": "#my_anchor"
    33  				}
    34  			]
    35  		},
    36  		"skip": {
    37  			"v2": "extract error: keyword \"$anchor\" not yet implemented (and 3 more errors)",
    38  			"v3": "extract error: keyword \"$anchor\" not yet implemented (and 3 more errors)"
    39  		},
    40  		"tests": [
    41  			{
    42  				"description": "exact match to enum, and type matches",
    43  				"data": {
    44  					"$anchor": "my_anchor",
    45  					"type": "null"
    46  				},
    47  				"valid": true,
    48  				"skip": {
    49  					"v2": "could not compile schema",
    50  					"v3": "could not compile schema"
    51  				}
    52  			},
    53  			{
    54  				"description": "in implementations that strip $anchor, this may match either $def",
    55  				"data": {
    56  					"type": "null"
    57  				},
    58  				"valid": false,
    59  				"skip": {
    60  					"v2": "could not compile schema",
    61  					"v3": "could not compile schema"
    62  				}
    63  			},
    64  			{
    65  				"description": "match $ref to $anchor",
    66  				"data": "a string to match #/$defs/anchor_in_enum",
    67  				"valid": true,
    68  				"skip": {
    69  					"v2": "could not compile schema",
    70  					"v3": "could not compile schema"
    71  				}
    72  			},
    73  			{
    74  				"description": "no match on enum or $ref to $anchor",
    75  				"data": 1,
    76  				"valid": false,
    77  				"skip": {
    78  					"v2": "could not compile schema",
    79  					"v3": "could not compile schema"
    80  				}
    81  			}
    82  		]
    83  	}
    84  ]