...

Text file src/github.com/qri-io/jsonschema/testdata/draft2019-09/unevaluatedItems_modified.json

Documentation: github.com/qri-io/jsonschema/testdata/draft2019-09

     1[
     2    {
     3        "description": "anyOf with false unevaluatedItems",
     4        "schema": {
     5            "$schema": "https://json-schema.org/draft/2019-09/schema",
     6            "unevaluatedItems": false,
     7            "anyOf": [
     8                {"items": {"type": "string"}},
     9                {"items": [true, true]}
    10            ]
    11        },
    12        "tests": [
    13            {
    14                "description": "all strings is valid",
    15                "data": ["foo", "bar", "baz"],
    16                "valid": true
    17            },
    18            {
    19                "description": "one item is valid",
    20                "data": [1],
    21                "valid": true
    22            },
    23            {
    24                "description": "two items are valid",
    25                "data": [1, "two"],
    26                "valid": true
    27            },
    28            {
    29                "description": "three items are invalid",
    30                "data": [1, "two", "three"],
    31                "valid": false
    32            },
    33            {
    34                "description": "four strings are valid",
    35                "data": ["one", "two", "three", "four"],
    36                "valid": true
    37            }
    38        ]
    39    },
    40    {
    41        "description": "complex unevaluated schema",
    42        "schema": {
    43            "$schema": "https://json-schema.org/draft/2019-09/schema",
    44            "unevaluatedItems": {
    45                "allOf": [{"minLength": 3}, {"type": "string"}]
    46            },
    47            "if": {"items": [{"type": "integer"}, {"type":  "array"}]},
    48            "then": {"items": [{"type": "integer"}, {"type":  "array"}]}
    49        },
    50        "tests": [
    51            {
    52                "description": "empty array",
    53                "data": [],
    54                "valid": true
    55            },
    56            {
    57                "description": "if passes with one item",
    58                "data": [1],
    59                "valid": true
    60            },
    61            {
    62                "description": "if passes with two items",
    63                "data": [1, [2, 3]],
    64                "valid": true
    65            },
    66            {
    67                "description": "if passes with third valid unevaluated item",
    68                "data": [1, [2, 3], "long-string"],
    69                "valid": true
    70            },
    71            {
    72                "description": "if passes with third invalid unevaluated item",
    73                "data": [1, [2, 3], "zz"],
    74                "valid": false
    75            },
    76            {
    77                "description": "if fails with all valid unevaluated items",
    78                "data": ["all", "long", "strings"],
    79                "valid": true
    80            },
    81            {
    82                "description": "if and unevaluated items fail",
    83                "data": ["a", "b", "c"],
    84                "valid": false
    85            }
    86        ]
    87    }
    88]

View as plain text