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

     1  [
     2  	{
     3  		"description": "propertyNames validation",
     4  		"schema": {
     5  			"$schema": "https://json-schema.org/draft/2020-12/schema",
     6  			"propertyNames": {
     7  				"maxLength": 3
     8  			}
     9  		},
    10  		"skip": {
    11  			"v2": "extract error: cannot compile resulting schema: reference \"strings\" in label expression refers to field against which it would be matched:\n    generated.cue:6:3\n",
    12  			"v3": "extract error: cannot compile resulting schema: reference \"strings\" in label expression refers to field against which it would be matched:\n    generated.cue:6:3\n"
    13  		},
    14  		"tests": [
    15  			{
    16  				"description": "all property names valid",
    17  				"data": {
    18  					"f": {},
    19  					"foo": {}
    20  				},
    21  				"valid": true,
    22  				"skip": {
    23  					"v2": "could not compile schema",
    24  					"v3": "could not compile schema"
    25  				}
    26  			},
    27  			{
    28  				"description": "some property names invalid",
    29  				"data": {
    30  					"foo": {},
    31  					"foobar": {}
    32  				},
    33  				"valid": false,
    34  				"skip": {
    35  					"v2": "could not compile schema",
    36  					"v3": "could not compile schema"
    37  				}
    38  			},
    39  			{
    40  				"description": "object without properties is valid",
    41  				"data": {},
    42  				"valid": true,
    43  				"skip": {
    44  					"v2": "could not compile schema",
    45  					"v3": "could not compile schema"
    46  				}
    47  			},
    48  			{
    49  				"description": "ignores arrays",
    50  				"data": [
    51  					1,
    52  					2,
    53  					3,
    54  					4
    55  				],
    56  				"valid": true,
    57  				"skip": {
    58  					"v2": "could not compile schema",
    59  					"v3": "could not compile schema"
    60  				}
    61  			},
    62  			{
    63  				"description": "ignores strings",
    64  				"data": "foobar",
    65  				"valid": true,
    66  				"skip": {
    67  					"v2": "could not compile schema",
    68  					"v3": "could not compile schema"
    69  				}
    70  			},
    71  			{
    72  				"description": "ignores other non-objects",
    73  				"data": 12,
    74  				"valid": true,
    75  				"skip": {
    76  					"v2": "could not compile schema",
    77  					"v3": "could not compile schema"
    78  				}
    79  			}
    80  		]
    81  	},
    82  	{
    83  		"description": "propertyNames with boolean schema true",
    84  		"schema": {
    85  			"$schema": "https://json-schema.org/draft/2020-12/schema",
    86  			"propertyNames": true
    87  		},
    88  		"tests": [
    89  			{
    90  				"description": "object with any properties is valid",
    91  				"data": {
    92  					"foo": 1
    93  				},
    94  				"valid": true
    95  			},
    96  			{
    97  				"description": "empty object is valid",
    98  				"data": {},
    99  				"valid": true
   100  			}
   101  		]
   102  	},
   103  	{
   104  		"description": "propertyNames with boolean schema false",
   105  		"schema": {
   106  			"$schema": "https://json-schema.org/draft/2020-12/schema",
   107  			"propertyNames": false
   108  		},
   109  		"tests": [
   110  			{
   111  				"description": "object with any properties is invalid",
   112  				"data": {
   113  					"foo": 1
   114  				},
   115  				"valid": false,
   116  				"skip": {
   117  					"v3": "unexpected success"
   118  				}
   119  			},
   120  			{
   121  				"description": "empty object is valid",
   122  				"data": {},
   123  				"valid": true,
   124  				"skip": {
   125  					"v3": "6 errors in empty disjunction:\nconflicting values [...] and {} (mismatched types list and struct):\n    generated.cue:3:33\n    instance.json:1:1\nconflicting values bool and {} (mismatched types bool and struct):\n    generated.cue:3:8\n    instance.json:1:1\nconflicting values null and {} (mismatched types null and struct):\n    generated.cue:3:1\n    instance.json:1:1\nconflicting values number and {} (mismatched types number and struct):\n    generated.cue:3:15\n    instance.json:1:1\nconflicting values string and {} (mismatched types string and struct):\n    generated.cue:3:24\n    instance.json:1:1\nexplicit error (_|_ literal) in source:\n    generated.cue:4:3\n"
   126  				}
   127  			}
   128  		]
   129  	}
   130  ]