cuelang.org/go@v0.13.0/encoding/jsonschema/testdata/external/tests/draft2019-09/content.json (about)

     1  [
     2  	{
     3  		"description": "validation of string-encoded content based on media type",
     4  		"schema": {
     5  			"$schema": "https://json-schema.org/draft/2019-09/schema",
     6  			"contentMediaType": "application/json"
     7  		},
     8  		"tests": [
     9  			{
    10  				"description": "a valid JSON document",
    11  				"data": "{\"foo\": \"bar\"}",
    12  				"valid": true
    13  			},
    14  			{
    15  				"description": "an invalid JSON document; validates true",
    16  				"data": "{:}",
    17  				"valid": true
    18  			},
    19  			{
    20  				"description": "ignores non-strings",
    21  				"data": 100,
    22  				"valid": true
    23  			}
    24  		]
    25  	},
    26  	{
    27  		"description": "validation of binary string-encoding",
    28  		"schema": {
    29  			"$schema": "https://json-schema.org/draft/2019-09/schema",
    30  			"contentEncoding": "base64"
    31  		},
    32  		"tests": [
    33  			{
    34  				"description": "a valid base64 string",
    35  				"data": "eyJmb28iOiAiYmFyIn0K",
    36  				"valid": true
    37  			},
    38  			{
    39  				"description": "an invalid base64 string (% is not a valid character); validates true",
    40  				"data": "eyJmb28iOi%iYmFyIn0K",
    41  				"valid": true
    42  			},
    43  			{
    44  				"description": "ignores non-strings",
    45  				"data": 100,
    46  				"valid": true
    47  			}
    48  		]
    49  	},
    50  	{
    51  		"description": "validation of binary-encoded media type documents",
    52  		"schema": {
    53  			"$schema": "https://json-schema.org/draft/2019-09/schema",
    54  			"contentMediaType": "application/json",
    55  			"contentEncoding": "base64"
    56  		},
    57  		"tests": [
    58  			{
    59  				"description": "a valid base64-encoded JSON document",
    60  				"data": "eyJmb28iOiAiYmFyIn0K",
    61  				"valid": true
    62  			},
    63  			{
    64  				"description": "a validly-encoded invalid JSON document; validates true",
    65  				"data": "ezp9Cg==",
    66  				"valid": true
    67  			},
    68  			{
    69  				"description": "an invalid base64 string that is valid JSON; validates true",
    70  				"data": "{}",
    71  				"valid": true
    72  			},
    73  			{
    74  				"description": "ignores non-strings",
    75  				"data": 100,
    76  				"valid": true
    77  			}
    78  		]
    79  	},
    80  	{
    81  		"description": "validation of binary-encoded media type documents with schema",
    82  		"schema": {
    83  			"$schema": "https://json-schema.org/draft/2019-09/schema",
    84  			"contentMediaType": "application/json",
    85  			"contentEncoding": "base64",
    86  			"contentSchema": {
    87  				"type": "object",
    88  				"required": [
    89  					"foo"
    90  				],
    91  				"properties": {
    92  					"foo": {
    93  						"type": "string"
    94  					}
    95  				}
    96  			}
    97  		},
    98  		"skip": {
    99  			"v2": "extract error: keyword \"contentSchema\" not yet implemented",
   100  			"v3": "extract error: keyword \"contentSchema\" not yet implemented"
   101  		},
   102  		"tests": [
   103  			{
   104  				"description": "a valid base64-encoded JSON document",
   105  				"data": "eyJmb28iOiAiYmFyIn0K",
   106  				"valid": true,
   107  				"skip": {
   108  					"v2": "could not compile schema",
   109  					"v3": "could not compile schema"
   110  				}
   111  			},
   112  			{
   113  				"description": "another valid base64-encoded JSON document",
   114  				"data": "eyJib28iOiAyMCwgImZvbyI6ICJiYXoifQ==",
   115  				"valid": true,
   116  				"skip": {
   117  					"v2": "could not compile schema",
   118  					"v3": "could not compile schema"
   119  				}
   120  			},
   121  			{
   122  				"description": "an invalid base64-encoded JSON document; validates true",
   123  				"data": "eyJib28iOiAyMH0=",
   124  				"valid": true,
   125  				"skip": {
   126  					"v2": "could not compile schema",
   127  					"v3": "could not compile schema"
   128  				}
   129  			},
   130  			{
   131  				"description": "an empty object as a base64-encoded JSON document; validates true",
   132  				"data": "e30=",
   133  				"valid": true,
   134  				"skip": {
   135  					"v2": "could not compile schema",
   136  					"v3": "could not compile schema"
   137  				}
   138  			},
   139  			{
   140  				"description": "an empty array as a base64-encoded JSON document",
   141  				"data": "W10=",
   142  				"valid": true,
   143  				"skip": {
   144  					"v2": "could not compile schema",
   145  					"v3": "could not compile schema"
   146  				}
   147  			},
   148  			{
   149  				"description": "a validly-encoded invalid JSON document; validates true",
   150  				"data": "ezp9Cg==",
   151  				"valid": true,
   152  				"skip": {
   153  					"v2": "could not compile schema",
   154  					"v3": "could not compile schema"
   155  				}
   156  			},
   157  			{
   158  				"description": "an invalid base64 string that is valid JSON; validates true",
   159  				"data": "{}",
   160  				"valid": true,
   161  				"skip": {
   162  					"v2": "could not compile schema",
   163  					"v3": "could not compile schema"
   164  				}
   165  			},
   166  			{
   167  				"description": "ignores non-strings",
   168  				"data": 100,
   169  				"valid": true,
   170  				"skip": {
   171  					"v2": "could not compile schema",
   172  					"v3": "could not compile schema"
   173  				}
   174  			}
   175  		]
   176  	}
   177  ]