cuelang.org/go@v0.13.0/encoding/jsonschema/testdata/external/tests/draft6/optional/format/json-pointer.json (about)

     1  [
     2  	{
     3  		"description": "validation of JSON-pointers (JSON String Representation)",
     4  		"schema": {
     5  			"format": "json-pointer"
     6  		},
     7  		"tests": [
     8  			{
     9  				"description": "all string formats ignore integers",
    10  				"data": 12,
    11  				"valid": true
    12  			},
    13  			{
    14  				"description": "all string formats ignore floats",
    15  				"data": 13.7,
    16  				"valid": true
    17  			},
    18  			{
    19  				"description": "all string formats ignore objects",
    20  				"data": {},
    21  				"valid": true
    22  			},
    23  			{
    24  				"description": "all string formats ignore arrays",
    25  				"data": [],
    26  				"valid": true
    27  			},
    28  			{
    29  				"description": "all string formats ignore booleans",
    30  				"data": false,
    31  				"valid": true
    32  			},
    33  			{
    34  				"description": "all string formats ignore nulls",
    35  				"data": null,
    36  				"valid": true
    37  			},
    38  			{
    39  				"description": "a valid JSON-pointer",
    40  				"data": "/foo/bar~0/baz~1/%a",
    41  				"valid": true
    42  			},
    43  			{
    44  				"description": "not a valid JSON-pointer (~ not escaped)",
    45  				"data": "/foo/bar~",
    46  				"valid": false,
    47  				"skip": {
    48  					"v2": "unexpected success",
    49  					"v3": "unexpected success"
    50  				}
    51  			},
    52  			{
    53  				"description": "valid JSON-pointer with empty segment",
    54  				"data": "/foo//bar",
    55  				"valid": true
    56  			},
    57  			{
    58  				"description": "valid JSON-pointer with the last empty segment",
    59  				"data": "/foo/bar/",
    60  				"valid": true
    61  			},
    62  			{
    63  				"description": "valid JSON-pointer as stated in RFC 6901 #1",
    64  				"data": "",
    65  				"valid": true
    66  			},
    67  			{
    68  				"description": "valid JSON-pointer as stated in RFC 6901 #2",
    69  				"data": "/foo",
    70  				"valid": true
    71  			},
    72  			{
    73  				"description": "valid JSON-pointer as stated in RFC 6901 #3",
    74  				"data": "/foo/0",
    75  				"valid": true
    76  			},
    77  			{
    78  				"description": "valid JSON-pointer as stated in RFC 6901 #4",
    79  				"data": "/",
    80  				"valid": true
    81  			},
    82  			{
    83  				"description": "valid JSON-pointer as stated in RFC 6901 #5",
    84  				"data": "/a~1b",
    85  				"valid": true
    86  			},
    87  			{
    88  				"description": "valid JSON-pointer as stated in RFC 6901 #6",
    89  				"data": "/c%d",
    90  				"valid": true
    91  			},
    92  			{
    93  				"description": "valid JSON-pointer as stated in RFC 6901 #7",
    94  				"data": "/e^f",
    95  				"valid": true
    96  			},
    97  			{
    98  				"description": "valid JSON-pointer as stated in RFC 6901 #8",
    99  				"data": "/g|h",
   100  				"valid": true
   101  			},
   102  			{
   103  				"description": "valid JSON-pointer as stated in RFC 6901 #9",
   104  				"data": "/i\\j",
   105  				"valid": true
   106  			},
   107  			{
   108  				"description": "valid JSON-pointer as stated in RFC 6901 #10",
   109  				"data": "/k\"l",
   110  				"valid": true
   111  			},
   112  			{
   113  				"description": "valid JSON-pointer as stated in RFC 6901 #11",
   114  				"data": "/ ",
   115  				"valid": true
   116  			},
   117  			{
   118  				"description": "valid JSON-pointer as stated in RFC 6901 #12",
   119  				"data": "/m~0n",
   120  				"valid": true
   121  			},
   122  			{
   123  				"description": "valid JSON-pointer used adding to the last array position",
   124  				"data": "/foo/-",
   125  				"valid": true
   126  			},
   127  			{
   128  				"description": "valid JSON-pointer (- used as object member name)",
   129  				"data": "/foo/-/bar",
   130  				"valid": true
   131  			},
   132  			{
   133  				"description": "valid JSON-pointer (multiple escaped characters)",
   134  				"data": "/~1~0~0~1~1",
   135  				"valid": true
   136  			},
   137  			{
   138  				"description": "valid JSON-pointer (escaped with fraction part) #1",
   139  				"data": "/~1.1",
   140  				"valid": true
   141  			},
   142  			{
   143  				"description": "valid JSON-pointer (escaped with fraction part) #2",
   144  				"data": "/~0.1",
   145  				"valid": true
   146  			},
   147  			{
   148  				"description": "not a valid JSON-pointer (URI Fragment Identifier) #1",
   149  				"data": "#",
   150  				"valid": false,
   151  				"skip": {
   152  					"v2": "unexpected success",
   153  					"v3": "unexpected success"
   154  				}
   155  			},
   156  			{
   157  				"description": "not a valid JSON-pointer (URI Fragment Identifier) #2",
   158  				"data": "#/",
   159  				"valid": false,
   160  				"skip": {
   161  					"v2": "unexpected success",
   162  					"v3": "unexpected success"
   163  				}
   164  			},
   165  			{
   166  				"description": "not a valid JSON-pointer (URI Fragment Identifier) #3",
   167  				"data": "#a",
   168  				"valid": false,
   169  				"skip": {
   170  					"v2": "unexpected success",
   171  					"v3": "unexpected success"
   172  				}
   173  			},
   174  			{
   175  				"description": "not a valid JSON-pointer (some escaped, but not all) #1",
   176  				"data": "/~0~",
   177  				"valid": false,
   178  				"skip": {
   179  					"v2": "unexpected success",
   180  					"v3": "unexpected success"
   181  				}
   182  			},
   183  			{
   184  				"description": "not a valid JSON-pointer (some escaped, but not all) #2",
   185  				"data": "/~0/~",
   186  				"valid": false,
   187  				"skip": {
   188  					"v2": "unexpected success",
   189  					"v3": "unexpected success"
   190  				}
   191  			},
   192  			{
   193  				"description": "not a valid JSON-pointer (wrong escape character) #1",
   194  				"data": "/~2",
   195  				"valid": false,
   196  				"skip": {
   197  					"v2": "unexpected success",
   198  					"v3": "unexpected success"
   199  				}
   200  			},
   201  			{
   202  				"description": "not a valid JSON-pointer (wrong escape character) #2",
   203  				"data": "/~-1",
   204  				"valid": false,
   205  				"skip": {
   206  					"v2": "unexpected success",
   207  					"v3": "unexpected success"
   208  				}
   209  			},
   210  			{
   211  				"description": "not a valid JSON-pointer (multiple characters not escaped)",
   212  				"data": "/~~",
   213  				"valid": false,
   214  				"skip": {
   215  					"v2": "unexpected success",
   216  					"v3": "unexpected success"
   217  				}
   218  			},
   219  			{
   220  				"description": "not a valid JSON-pointer (isn't empty nor starts with /) #1",
   221  				"data": "a",
   222  				"valid": false,
   223  				"skip": {
   224  					"v2": "unexpected success",
   225  					"v3": "unexpected success"
   226  				}
   227  			},
   228  			{
   229  				"description": "not a valid JSON-pointer (isn't empty nor starts with /) #2",
   230  				"data": "0",
   231  				"valid": false,
   232  				"skip": {
   233  					"v2": "unexpected success",
   234  					"v3": "unexpected success"
   235  				}
   236  			},
   237  			{
   238  				"description": "not a valid JSON-pointer (isn't empty nor starts with /) #3",
   239  				"data": "a/a",
   240  				"valid": false,
   241  				"skip": {
   242  					"v2": "unexpected success",
   243  					"v3": "unexpected success"
   244  				}
   245  			}
   246  		]
   247  	}
   248  ]