...

Text file src/github.com/qri-io/jsonschema/testdata/draft7/optional/format/json-pointer.json

Documentation: github.com/qri-io/jsonschema/testdata/draft7/optional/format

     1[
     2    {
     3        "description": "validation of JSON-pointers (JSON String Representation)",
     4        "schema": {"format": "json-pointer"},
     5        "tests": [
     6            {
     7                "description": "a valid JSON-pointer",
     8                "data": "/foo/bar~0/baz~1/%a",
     9                "valid": true
    10            },
    11            {
    12                "description": "not a valid JSON-pointer (~ not escaped)",
    13                "data": "/foo/bar~",
    14                "valid": false
    15            },
    16            {
    17                "description": "valid JSON-pointer with empty segment",
    18                "data": "/foo//bar",
    19                "valid": true
    20            },
    21            {
    22                "description": "valid JSON-pointer with the last empty segment",
    23                "data": "/foo/bar/",
    24                "valid": true
    25            },
    26            {
    27                "description": "valid JSON-pointer as stated in RFC 6901 #1",
    28                "data": "",
    29                "valid": true
    30            },
    31            {
    32                "description": "valid JSON-pointer as stated in RFC 6901 #2",
    33                "data": "/foo",
    34                "valid": true
    35            },
    36            {
    37                "description": "valid JSON-pointer as stated in RFC 6901 #3",
    38                "data": "/foo/0",
    39                "valid": true
    40            },
    41            {
    42                "description": "valid JSON-pointer as stated in RFC 6901 #4",
    43                "data": "/",
    44                "valid": true
    45            },
    46            {
    47                "description": "valid JSON-pointer as stated in RFC 6901 #5",
    48                "data": "/a~1b",
    49                "valid": true
    50            },
    51            {
    52                "description": "valid JSON-pointer as stated in RFC 6901 #6",
    53                "data": "/c%d",
    54                "valid": true
    55            },
    56            {
    57                "description": "valid JSON-pointer as stated in RFC 6901 #7",
    58                "data": "/e^f",
    59                "valid": true
    60            },
    61            {
    62                "description": "valid JSON-pointer as stated in RFC 6901 #8",
    63                "data": "/g|h",
    64                "valid": true
    65            },
    66            {
    67                "description": "valid JSON-pointer as stated in RFC 6901 #9",
    68                "data": "/i\\j",
    69                "valid": true
    70            },
    71            {
    72                "description": "valid JSON-pointer as stated in RFC 6901 #10",
    73                "data": "/k\"l",
    74                "valid": true
    75            },
    76            {
    77                "description": "valid JSON-pointer as stated in RFC 6901 #11",
    78                "data": "/ ",
    79                "valid": true
    80            },
    81            {
    82                "description": "valid JSON-pointer as stated in RFC 6901 #12",
    83                "data": "/m~0n",
    84                "valid": true
    85            },
    86            {
    87                "description": "valid JSON-pointer used adding to the last array position",
    88                "data": "/foo/-",
    89                "valid": true
    90            },
    91            {
    92                "description": "valid JSON-pointer (- used as object member name)",
    93                "data": "/foo/-/bar",
    94                "valid": true
    95            },
    96            {
    97                "description": "valid JSON-pointer (multiple escaped characters)",
    98                "data": "/~1~0~0~1~1",
    99                "valid": true
   100            },
   101            {
   102                "description": "valid JSON-pointer (escaped with fraction part) #1",
   103                "data": "/~1.1",
   104                "valid": true
   105            },
   106            {
   107                "description": "valid JSON-pointer (escaped with fraction part) #2",
   108                "data": "/~0.1",
   109                "valid": true
   110            },
   111            {
   112                "description": "not a valid JSON-pointer (URI Fragment Identifier) #1",
   113                "data": "#",
   114                "valid": false
   115            },
   116            {
   117                "description": "not a valid JSON-pointer (URI Fragment Identifier) #2",
   118                "data": "#/",
   119                "valid": false
   120            },
   121            {
   122                "description": "not a valid JSON-pointer (URI Fragment Identifier) #3",
   123                "data": "#a",
   124                "valid": false
   125            },
   126            {
   127                "description": "not a valid JSON-pointer (some escaped, but not all) #1",
   128                "data": "/~0~",
   129                "valid": false
   130            },
   131            {
   132                "description": "not a valid JSON-pointer (some escaped, but not all) #2",
   133                "data": "/~0/~",
   134                "valid": false
   135            },
   136            {
   137                "description": "not a valid JSON-pointer (wrong escape character) #1",
   138                "data": "/~2",
   139                "valid": false
   140            },
   141            {
   142                "description": "not a valid JSON-pointer (wrong escape character) #2",
   143                "data": "/~-1",
   144                "valid": false
   145            },
   146            {
   147                "description": "not a valid JSON-pointer (multiple characters not escaped)",
   148                "data": "/~~",
   149                "valid": false
   150            },
   151            {
   152                "description": "not a valid JSON-pointer (isn't empty nor starts with /) #1",
   153                "data": "a",
   154                "valid": false
   155            },
   156            {
   157                "description": "not a valid JSON-pointer (isn't empty nor starts with /) #2",
   158                "data": "0",
   159                "valid": false
   160            },
   161            {
   162                "description": "not a valid JSON-pointer (isn't empty nor starts with /) #3",
   163                "data": "a/a",
   164                "valid": false
   165            }
   166        ]
   167    }
   168]

View as plain text