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

     1  [
     2  	{
     3  		"description": "minLength validation",
     4  		"schema": {
     5  			"$schema": "https://json-schema.org/draft/2020-12/schema",
     6  			"minLength": 2
     7  		},
     8  		"tests": [
     9  			{
    10  				"description": "longer is valid",
    11  				"data": "foo",
    12  				"valid": true
    13  			},
    14  			{
    15  				"description": "exact length is valid",
    16  				"data": "fo",
    17  				"valid": true
    18  			},
    19  			{
    20  				"description": "too short is invalid",
    21  				"data": "f",
    22  				"valid": false
    23  			},
    24  			{
    25  				"description": "ignores non-strings",
    26  				"data": 1,
    27  				"valid": true
    28  			},
    29  			{
    30  				"description": "one grapheme is not long enough",
    31  				"data": "💩",
    32  				"valid": false
    33  			}
    34  		]
    35  	},
    36  	{
    37  		"description": "minLength validation with a decimal",
    38  		"schema": {
    39  			"$schema": "https://json-schema.org/draft/2020-12/schema",
    40  			"minLength": 2.0
    41  		},
    42  		"tests": [
    43  			{
    44  				"description": "longer is valid",
    45  				"data": "foo",
    46  				"valid": true
    47  			},
    48  			{
    49  				"description": "too short is invalid",
    50  				"data": "f",
    51  				"valid": false
    52  			}
    53  		]
    54  	}
    55  ]