cuelang.org/go@v0.13.0/encoding/jsonschema/testdata/external/tests/draft7/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 validation with a decimal",
    55  		"schema": {
    56  			"maxProperties": 2.0
    57  		},
    58  		"tests": [
    59  			{
    60  				"description": "shorter is valid",
    61  				"data": {
    62  					"foo": 1
    63  				},
    64  				"valid": true
    65  			},
    66  			{
    67  				"description": "too long is invalid",
    68  				"data": {
    69  					"foo": 1,
    70  					"bar": 2,
    71  					"baz": 3
    72  				},
    73  				"valid": false
    74  			}
    75  		]
    76  	},
    77  	{
    78  		"description": "maxProperties = 0 means the object is empty",
    79  		"schema": {
    80  			"maxProperties": 0
    81  		},
    82  		"tests": [
    83  			{
    84  				"description": "no properties is valid",
    85  				"data": {},
    86  				"valid": true
    87  			},
    88  			{
    89  				"description": "one property is invalid",
    90  				"data": {
    91  					"foo": 1
    92  				},
    93  				"valid": false
    94  			}
    95  		]
    96  	}
    97  ]