cuelang.org/go@v0.13.0/encoding/jsonschema/testdata/external/tests/draft4/maxProperties.json (about)

     1  [
     2  	{
     3  		"description": "maxProperties validation",
     4  		"schema": {
     5  			"maxProperties": 2
     6  		},
     7  		"tests": [
     8  			{
     9  				"description": "shorter is valid",
    10  				"data": {
    11  					"foo": 1
    12  				},
    13  				"valid": true
    14  			},
    15  			{
    16  				"description": "exact length is valid",
    17  				"data": {
    18  					"foo": 1,
    19  					"bar": 2
    20  				},
    21  				"valid": true
    22  			},
    23  			{
    24  				"description": "too long is invalid",
    25  				"data": {
    26  					"foo": 1,
    27  					"bar": 2,
    28  					"baz": 3
    29  				},
    30  				"valid": false
    31  			},
    32  			{
    33  				"description": "ignores arrays",
    34  				"data": [
    35  					1,
    36  					2,
    37  					3
    38  				],
    39  				"valid": true
    40  			},
    41  			{
    42  				"description": "ignores strings",
    43  				"data": "foobar",
    44  				"valid": true
    45  			},
    46  			{
    47  				"description": "ignores other non-objects",
    48  				"data": 12,
    49  				"valid": true
    50  			}
    51  		]
    52  	},
    53  	{
    54  		"description": "maxProperties = 0 means the object is empty",
    55  		"schema": {
    56  			"maxProperties": 0
    57  		},
    58  		"tests": [
    59  			{
    60  				"description": "no properties is valid",
    61  				"data": {},
    62  				"valid": true
    63  			},
    64  			{
    65  				"description": "one property is invalid",
    66  				"data": {
    67  					"foo": 1
    68  				},
    69  				"valid": false
    70  			}
    71  		]
    72  	}
    73  ]