k8s.io/kube-openapi@v0.0.0-20240228011516-70dd3763d340/pkg/validation/validate/fixtures/jsonschema_suite/items.json (about)

     1  [
     2      {
     3          "description": "a schema given for items",
     4          "schema": {
     5              "items": {"type": "integer"}
     6          },
     7          "tests": [
     8              {
     9                  "description": "valid items",
    10                  "data": [ 1, 2, 3 ],
    11                  "valid": true
    12              },
    13              {
    14                  "description": "wrong type of items",
    15                  "data": [1, "x"],
    16                  "valid": false
    17              },
    18              {
    19                  "description": "ignores non-arrays",
    20                  "data": {"foo" : "bar"},
    21                  "valid": true
    22              },
    23              {
    24                  "description": "JavaScript pseudo-array is valid",
    25                  "data": {
    26                      "0": "invalid",
    27                      "length": 1
    28                  },
    29                  "valid": true
    30              }
    31          ]
    32      },
    33      {
    34          "description": "an array of schemas for items",
    35          "schema": {
    36              "items": [
    37                  {"type": "integer"},
    38                  {"type": "string"}
    39              ]
    40          },
    41          "tests": [
    42              {
    43                  "description": "correct types",
    44                  "data": [ 1, "foo" ],
    45                  "valid": true
    46              },
    47              {
    48                  "description": "wrong types",
    49                  "data": [ "foo", 1 ],
    50                  "valid": false
    51              },
    52              {
    53                  "description": "incomplete array of items",
    54                  "data": [ 1 ],
    55                  "valid": true
    56              },
    57              {
    58                  "description": "array with additional items",
    59                  "data": [ 1, "foo", true ],
    60                  "valid": true
    61              },
    62              {
    63                  "description": "empty array",
    64                  "data": [ ],
    65                  "valid": true
    66              },
    67              {
    68                  "description": "JavaScript pseudo-array is valid",
    69                  "data": {
    70                      "0": "invalid",
    71                      "1": "valid",
    72                      "length": 2
    73                  },
    74                  "valid": true
    75              }
    76          ]
    77      }
    78  ]