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

     1  [
     2  	{
     3  		"description": "maximum validation",
     4  		"schema": {
     5  			"maximum": 3.0
     6  		},
     7  		"tests": [
     8  			{
     9  				"description": "below the maximum is valid",
    10  				"data": 2.6,
    11  				"valid": true
    12  			},
    13  			{
    14  				"description": "boundary point is valid",
    15  				"data": 3.0,
    16  				"valid": true
    17  			},
    18  			{
    19  				"description": "above the maximum is invalid",
    20  				"data": 3.5,
    21  				"valid": false
    22  			},
    23  			{
    24  				"description": "ignores non-numbers",
    25  				"data": "x",
    26  				"valid": true
    27  			}
    28  		]
    29  	},
    30  	{
    31  		"description": "maximum validation with unsigned integer",
    32  		"schema": {
    33  			"maximum": 300
    34  		},
    35  		"tests": [
    36  			{
    37  				"description": "below the maximum is invalid",
    38  				"data": 299.97,
    39  				"valid": true
    40  			},
    41  			{
    42  				"description": "boundary point integer is valid",
    43  				"data": 300,
    44  				"valid": true
    45  			},
    46  			{
    47  				"description": "boundary point float is valid",
    48  				"data": 300.00,
    49  				"valid": true
    50  			},
    51  			{
    52  				"description": "above the maximum is invalid",
    53  				"data": 300.5,
    54  				"valid": false
    55  			}
    56  		]
    57  	},
    58  	{
    59  		"description": "maximum validation (explicit false exclusivity)",
    60  		"schema": {
    61  			"maximum": 3.0,
    62  			"exclusiveMaximum": false
    63  		},
    64  		"tests": [
    65  			{
    66  				"description": "below the maximum is valid",
    67  				"data": 2.6,
    68  				"valid": true
    69  			},
    70  			{
    71  				"description": "boundary point is valid",
    72  				"data": 3.0,
    73  				"valid": true,
    74  				"skip": {
    75  					"v2": "6 errors in empty disjunction:\nconflicting values 3.0 and [...] (mismatched types float and list):\n    generated.cue:2:1\n    generated.cue:2:31\n    instance.json:1:1\nconflicting values 3.0 and bool (mismatched types float and bool):\n    generated.cue:2:1\n    generated.cue:2:8\n    instance.json:1:1\nconflicting values 3.0 and null (mismatched types float and null):\n    generated.cue:2:1\n    instance.json:1:1\nconflicting values 3.0 and string (mismatched types float and string):\n    generated.cue:2:1\n    generated.cue:2:22\n    instance.json:1:1\nconflicting values 3.0 and {...} (mismatched types float and struct):\n    generated.cue:2:1\n    generated.cue:2:39\n    instance.json:1:1\ninvalid value 3.0 (out of bound \u003c3.0):\n    generated.cue:2:15\n    instance.json:1:1\n",
    76  					"v3": "6 errors in empty disjunction:\nconflicting values 3.0 and [...] (mismatched types float and list):\n    generated.cue:2:31\n    instance.json:1:1\nconflicting values 3.0 and bool (mismatched types float and bool):\n    generated.cue:2:8\n    instance.json:1:1\nconflicting values 3.0 and null (mismatched types float and null):\n    generated.cue:2:1\n    instance.json:1:1\nconflicting values 3.0 and string (mismatched types float and string):\n    generated.cue:2:22\n    instance.json:1:1\nconflicting values 3.0 and {...} (mismatched types float and struct):\n    generated.cue:2:39\n    instance.json:1:1\ninvalid value 3.0 (out of bound \u003c3.0):\n    generated.cue:2:15\n    instance.json:1:1\n"
    77  				}
    78  			},
    79  			{
    80  				"description": "above the maximum is invalid",
    81  				"data": 3.5,
    82  				"valid": false
    83  			},
    84  			{
    85  				"description": "ignores non-numbers",
    86  				"data": "x",
    87  				"valid": true
    88  			}
    89  		]
    90  	},
    91  	{
    92  		"description": "exclusiveMaximum validation",
    93  		"schema": {
    94  			"maximum": 3.0,
    95  			"exclusiveMaximum": true
    96  		},
    97  		"tests": [
    98  			{
    99  				"description": "below the maximum is still valid",
   100  				"data": 2.2,
   101  				"valid": true
   102  			},
   103  			{
   104  				"description": "boundary point is invalid",
   105  				"data": 3.0,
   106  				"valid": false
   107  			}
   108  		]
   109  	}
   110  ]