[
  {
    "description": "uniqueItems validation",
    "database": {
      "schemas": [
        {
          "uniqueItems": true,
          "extensible": true,
          "$id": "uniqueItems_0_0"
        }
      ]
    },
    "tests": [
      {
        "description": "unique array of integers is valid",
        "data": [
          1,
          2
        ],
        "schema_id": "uniqueItems_0_0",
        "action": "validate",
        "expect": {
          "success": true
        }
      },
      {
        "description": "non-unique array of integers is invalid",
        "data": [
          1,
          1
        ],
        "schema_id": "uniqueItems_0_0",
        "action": "validate",
        "expect": {
          "success": false
        }
      },
      {
        "description": "non-unique array of more than two integers is invalid",
        "data": [
          1,
          2,
          1
        ],
        "schema_id": "uniqueItems_0_0",
        "action": "validate",
        "expect": {
          "success": false
        }
      },
      {
        "description": "numbers are unique if mathematically unequal",
        "data": [
          1,
          1,
          1
        ],
        "schema_id": "uniqueItems_0_0",
        "action": "validate",
        "expect": {
          "success": false
        }
      },
      {
        "description": "false is not equal to zero",
        "data": [
          0,
          false
        ],
        "schema_id": "uniqueItems_0_0",
        "action": "validate",
        "expect": {
          "success": true
        }
      },
      {
        "description": "true is not equal to one",
        "data": [
          1,
          true
        ],
        "schema_id": "uniqueItems_0_0",
        "action": "validate",
        "expect": {
          "success": true
        }
      },
      {
        "description": "unique array of strings is valid",
        "data": [
          "foo",
          "bar",
          "baz"
        ],
        "schema_id": "uniqueItems_0_0",
        "action": "validate",
        "expect": {
          "success": true
        }
      },
      {
        "description": "non-unique array of strings is invalid",
        "data": [
          "foo",
          "bar",
          "foo"
        ],
        "schema_id": "uniqueItems_0_0",
        "action": "validate",
        "expect": {
          "success": false
        }
      },
      {
        "description": "unique array of objects is valid",
        "data": [
          {
            "foo": "bar"
          },
          {
            "foo": "baz"
          }
        ],
        "schema_id": "uniqueItems_0_0",
        "action": "validate",
        "expect": {
          "success": true
        }
      },
      {
        "description": "non-unique array of objects is invalid",
        "data": [
          {
            "foo": "bar"
          },
          {
            "foo": "bar"
          }
        ],
        "schema_id": "uniqueItems_0_0",
        "action": "validate",
        "expect": {
          "success": false
        }
      },
      {
        "description": "property order of array of objects is ignored",
        "data": [
          {
            "foo": "bar",
            "bar": "foo"
          },
          {
            "bar": "foo",
            "foo": "bar"
          }
        ],
        "schema_id": "uniqueItems_0_0",
        "action": "validate",
        "expect": {
          "success": false
        }
      },
      {
        "description": "unique array of nested objects is valid",
        "data": [
          {
            "foo": {
              "bar": {
                "baz": true
              }
            }
          },
          {
            "foo": {
              "bar": {
                "baz": false
              }
            }
          }
        ],
        "schema_id": "uniqueItems_0_0",
        "action": "validate",
        "expect": {
          "success": true
        }
      },
      {
        "description": "non-unique array of nested objects is invalid",
        "data": [
          {
            "foo": {
              "bar": {
                "baz": true
              }
            }
          },
          {
            "foo": {
              "bar": {
                "baz": true
              }
            }
          }
        ],
        "schema_id": "uniqueItems_0_0",
        "action": "validate",
        "expect": {
          "success": false
        }
      },
      {
        "description": "unique array of arrays is valid",
        "data": [
          [
            "foo"
          ],
          [
            "bar"
          ]
        ],
        "schema_id": "uniqueItems_0_0",
        "action": "validate",
        "expect": {
          "success": true
        }
      },
      {
        "description": "non-unique array of arrays is invalid",
        "data": [
          [
            "foo"
          ],
          [
            "foo"
          ]
        ],
        "schema_id": "uniqueItems_0_0",
        "action": "validate",
        "expect": {
          "success": false
        }
      },
      {
        "description": "non-unique array of more than two arrays is invalid",
        "data": [
          [
            "foo"
          ],
          [
            "bar"
          ],
          [
            "foo"
          ]
        ],
        "schema_id": "uniqueItems_0_0",
        "action": "validate",
        "expect": {
          "success": false
        }
      },
      {
        "description": "1 and true are unique",
        "data": [
          1,
          true
        ],
        "schema_id": "uniqueItems_0_0",
        "action": "validate",
        "expect": {
          "success": true
        }
      },
      {
        "description": "0 and false are unique",
        "data": [
          0,
          false
        ],
        "schema_id": "uniqueItems_0_0",
        "action": "validate",
        "expect": {
          "success": true
        }
      },
      {
        "description": "[1] and [true] are unique",
        "data": [
          [
            1
          ],
          [
            true
          ]
        ],
        "schema_id": "uniqueItems_0_0",
        "action": "validate",
        "expect": {
          "success": true
        }
      },
      {
        "description": "[0] and [false] are unique",
        "data": [
          [
            0
          ],
          [
            false
          ]
        ],
        "schema_id": "uniqueItems_0_0",
        "action": "validate",
        "expect": {
          "success": true
        }
      },
      {
        "description": "nested [1] and [true] are unique",
        "data": [
          [
            [
              1
            ],
            "foo"
          ],
          [
            [
              true
            ],
            "foo"
          ]
        ],
        "schema_id": "uniqueItems_0_0",
        "action": "validate",
        "expect": {
          "success": true
        }
      },
      {
        "description": "nested [0] and [false] are unique",
        "data": [
          [
            [
              0
            ],
            "foo"
          ],
          [
            [
              false
            ],
            "foo"
          ]
        ],
        "schema_id": "uniqueItems_0_0",
        "action": "validate",
        "expect": {
          "success": true
        }
      },
      {
        "description": "unique heterogeneous types are valid",
        "data": [
          {},
          [
            1
          ],
          true,
          null,
          1,
          "{}"
        ],
        "schema_id": "uniqueItems_0_0",
        "action": "validate",
        "expect": {
          "success": true
        }
      },
      {
        "description": "non-unique heterogeneous types are invalid",
        "data": [
          {},
          [
            1
          ],
          true,
          null,
          {},
          1
        ],
        "schema_id": "uniqueItems_0_0",
        "action": "validate",
        "expect": {
          "success": false
        }
      },
      {
        "description": "different objects are unique",
        "data": [
          {
            "a": 1,
            "b": 2
          },
          {
            "a": 2,
            "b": 1
          }
        ],
        "schema_id": "uniqueItems_0_0",
        "action": "validate",
        "expect": {
          "success": true
        }
      },
      {
        "description": "objects are non-unique despite key order",
        "data": [
          {
            "a": 1,
            "b": 2
          },
          {
            "b": 2,
            "a": 1
          }
        ],
        "schema_id": "uniqueItems_0_0",
        "action": "validate",
        "expect": {
          "success": false
        }
      },
      {
        "description": "{\"a\": false} and {\"a\": 0} are unique",
        "data": [
          {
            "a": false
          },
          {
            "a": 0
          }
        ],
        "schema_id": "uniqueItems_0_0",
        "action": "validate",
        "expect": {
          "success": true
        }
      },
      {
        "description": "{\"a\": true} and {\"a\": 1} are unique",
        "data": [
          {
            "a": true
          },
          {
            "a": 1
          }
        ],
        "schema_id": "uniqueItems_0_0",
        "action": "validate",
        "expect": {
          "success": true
        }
      }
    ]
  },
  {
    "description": "uniqueItems with an array of items",
    "database": {
      "schemas": [
        {
          "prefixItems": [
            {
              "type": "boolean"
            },
            {
              "type": "boolean"
            }
          ],
          "uniqueItems": true,
          "extensible": true,
          "$id": "uniqueItems_1_0"
        }
      ]
    },
    "tests": [
      {
        "description": "[false, true] from items array is valid",
        "data": [
          false,
          true
        ],
        "schema_id": "uniqueItems_1_0",
        "action": "validate",
        "expect": {
          "success": true
        }
      },
      {
        "description": "[true, false] from items array is valid",
        "data": [
          true,
          false
        ],
        "schema_id": "uniqueItems_1_0",
        "action": "validate",
        "expect": {
          "success": true
        }
      },
      {
        "description": "[false, false] from items array is not valid",
        "data": [
          false,
          false
        ],
        "schema_id": "uniqueItems_1_0",
        "action": "validate",
        "expect": {
          "success": false
        }
      },
      {
        "description": "[true, true] from items array is not valid",
        "data": [
          true,
          true
        ],
        "schema_id": "uniqueItems_1_0",
        "action": "validate",
        "expect": {
          "success": false
        }
      },
      {
        "description": "unique array extended from [false, true] is valid",
        "data": [
          false,
          true,
          "foo",
          "bar"
        ],
        "schema_id": "uniqueItems_1_0",
        "action": "validate",
        "expect": {
          "success": true
        }
      },
      {
        "description": "unique array extended from [true, false] is valid",
        "data": [
          true,
          false,
          "foo",
          "bar"
        ],
        "schema_id": "uniqueItems_1_0",
        "action": "validate",
        "expect": {
          "success": true
        }
      },
      {
        "description": "non-unique array extended from [false, true] is not valid",
        "data": [
          false,
          true,
          "foo",
          "foo"
        ],
        "schema_id": "uniqueItems_1_0",
        "action": "validate",
        "expect": {
          "success": false
        }
      },
      {
        "description": "non-unique array extended from [true, false] is not valid",
        "data": [
          true,
          false,
          "foo",
          "foo"
        ],
        "schema_id": "uniqueItems_1_0",
        "action": "validate",
        "expect": {
          "success": false
        }
      }
    ]
  },
  {
    "description": "uniqueItems with an array of items and additionalItems=false",
    "database": {
      "schemas": [
        {
          "prefixItems": [
            {
              "type": "boolean"
            },
            {
              "type": "boolean"
            }
          ],
          "uniqueItems": true,
          "items": false,
          "$id": "uniqueItems_2_0"
        }
      ]
    },
    "tests": [
      {
        "description": "[false, true] from items array is valid",
        "data": [
          false,
          true
        ],
        "schema_id": "uniqueItems_2_0",
        "action": "validate",
        "expect": {
          "success": true
        }
      },
      {
        "description": "[true, false] from items array is valid",
        "data": [
          true,
          false
        ],
        "schema_id": "uniqueItems_2_0",
        "action": "validate",
        "expect": {
          "success": true
        }
      },
      {
        "description": "[false, false] from items array is not valid",
        "data": [
          false,
          false
        ],
        "schema_id": "uniqueItems_2_0",
        "action": "validate",
        "expect": {
          "success": false
        }
      },
      {
        "description": "[true, true] from items array is not valid",
        "data": [
          true,
          true
        ],
        "schema_id": "uniqueItems_2_0",
        "action": "validate",
        "expect": {
          "success": false
        }
      },
      {
        "description": "extra items are invalid even if unique",
        "data": [
          false,
          true,
          null
        ],
        "schema_id": "uniqueItems_2_0",
        "action": "validate",
        "expect": {
          "success": false
        }
      }
    ]
  },
  {
    "description": "uniqueItems=false validation",
    "database": {
      "schemas": [
        {
          "uniqueItems": false,
          "extensible": true,
          "$id": "uniqueItems_3_0"
        }
      ]
    },
    "tests": [
      {
        "description": "unique array of integers is valid",
        "data": [
          1,
          2
        ],
        "schema_id": "uniqueItems_3_0",
        "action": "validate",
        "expect": {
          "success": true
        }
      },
      {
        "description": "non-unique array of integers is valid",
        "data": [
          1,
          1
        ],
        "schema_id": "uniqueItems_3_0",
        "action": "validate",
        "expect": {
          "success": true
        }
      },
      {
        "description": "numbers are unique if mathematically unequal",
        "data": [
          1,
          1,
          1
        ],
        "schema_id": "uniqueItems_3_0",
        "action": "validate",
        "expect": {
          "success": true
        }
      },
      {
        "description": "false is not equal to zero",
        "data": [
          0,
          false
        ],
        "schema_id": "uniqueItems_3_0",
        "action": "validate",
        "expect": {
          "success": true
        }
      },
      {
        "description": "true is not equal to one",
        "data": [
          1,
          true
        ],
        "schema_id": "uniqueItems_3_0",
        "action": "validate",
        "expect": {
          "success": true
        }
      },
      {
        "description": "unique array of objects is valid",
        "data": [
          {
            "foo": "bar"
          },
          {
            "foo": "baz"
          }
        ],
        "schema_id": "uniqueItems_3_0",
        "action": "validate",
        "expect": {
          "success": true
        }
      },
      {
        "description": "non-unique array of objects is valid",
        "data": [
          {
            "foo": "bar"
          },
          {
            "foo": "bar"
          }
        ],
        "schema_id": "uniqueItems_3_0",
        "action": "validate",
        "expect": {
          "success": true
        }
      },
      {
        "description": "unique array of nested objects is valid",
        "data": [
          {
            "foo": {
              "bar": {
                "baz": true
              }
            }
          },
          {
            "foo": {
              "bar": {
                "baz": false
              }
            }
          }
        ],
        "schema_id": "uniqueItems_3_0",
        "action": "validate",
        "expect": {
          "success": true
        }
      },
      {
        "description": "non-unique array of nested objects is valid",
        "data": [
          {
            "foo": {
              "bar": {
                "baz": true
              }
            }
          },
          {
            "foo": {
              "bar": {
                "baz": true
              }
            }
          }
        ],
        "schema_id": "uniqueItems_3_0",
        "action": "validate",
        "expect": {
          "success": true
        }
      },
      {
        "description": "unique array of arrays is valid",
        "data": [
          [
            "foo"
          ],
          [
            "bar"
          ]
        ],
        "schema_id": "uniqueItems_3_0",
        "action": "validate",
        "expect": {
          "success": true
        }
      },
      {
        "description": "non-unique array of arrays is valid",
        "data": [
          [
            "foo"
          ],
          [
            "foo"
          ]
        ],
        "schema_id": "uniqueItems_3_0",
        "action": "validate",
        "expect": {
          "success": true
        }
      },
      {
        "description": "1 and true are unique",
        "data": [
          1,
          true
        ],
        "schema_id": "uniqueItems_3_0",
        "action": "validate",
        "expect": {
          "success": true
        }
      },
      {
        "description": "0 and false are unique",
        "data": [
          0,
          false
        ],
        "schema_id": "uniqueItems_3_0",
        "action": "validate",
        "expect": {
          "success": true
        }
      },
      {
        "description": "unique heterogeneous types are valid",
        "data": [
          {},
          [
            1
          ],
          true,
          null,
          1
        ],
        "schema_id": "uniqueItems_3_0",
        "action": "validate",
        "expect": {
          "success": true
        }
      },
      {
        "description": "non-unique heterogeneous types are valid",
        "data": [
          {},
          [
            1
          ],
          true,
          null,
          {},
          1
        ],
        "schema_id": "uniqueItems_3_0",
        "action": "validate",
        "expect": {
          "success": true
        }
      }
    ]
  },
  {
    "description": "uniqueItems=false with an array of items",
    "database": {
      "schemas": [
        {
          "prefixItems": [
            {
              "type": "boolean"
            },
            {
              "type": "boolean"
            }
          ],
          "uniqueItems": false,
          "extensible": true,
          "$id": "uniqueItems_4_0"
        }
      ]
    },
    "tests": [
      {
        "description": "[false, true] from items array is valid",
        "data": [
          false,
          true
        ],
        "schema_id": "uniqueItems_4_0",
        "action": "validate",
        "expect": {
          "success": true
        }
      },
      {
        "description": "[true, false] from items array is valid",
        "data": [
          true,
          false
        ],
        "schema_id": "uniqueItems_4_0",
        "action": "validate",
        "expect": {
          "success": true
        }
      },
      {
        "description": "[false, false] from items array is valid",
        "data": [
          false,
          false
        ],
        "schema_id": "uniqueItems_4_0",
        "action": "validate",
        "expect": {
          "success": true
        }
      },
      {
        "description": "[true, true] from items array is valid",
        "data": [
          true,
          true
        ],
        "schema_id": "uniqueItems_4_0",
        "action": "validate",
        "expect": {
          "success": true
        }
      },
      {
        "description": "unique array extended from [false, true] is valid",
        "data": [
          false,
          true,
          "foo",
          "bar"
        ],
        "schema_id": "uniqueItems_4_0",
        "action": "validate",
        "expect": {
          "success": true
        }
      },
      {
        "description": "unique array extended from [true, false] is valid",
        "data": [
          true,
          false,
          "foo",
          "bar"
        ],
        "schema_id": "uniqueItems_4_0",
        "action": "validate",
        "expect": {
          "success": true
        }
      },
      {
        "description": "non-unique array extended from [false, true] is valid",
        "data": [
          false,
          true,
          "foo",
          "foo"
        ],
        "schema_id": "uniqueItems_4_0",
        "action": "validate",
        "expect": {
          "success": true
        }
      },
      {
        "description": "non-unique array extended from [true, false] is valid",
        "data": [
          true,
          false,
          "foo",
          "foo"
        ],
        "schema_id": "uniqueItems_4_0",
        "action": "validate",
        "expect": {
          "success": true
        }
      }
    ]
  },
  {
    "description": "uniqueItems=false with an array of items and additionalItems=false",
    "database": {
      "schemas": [
        {
          "prefixItems": [
            {
              "type": "boolean"
            },
            {
              "type": "boolean"
            }
          ],
          "uniqueItems": false,
          "items": false,
          "$id": "uniqueItems_5_0"
        }
      ]
    },
    "tests": [
      {
        "description": "[false, true] from items array is valid",
        "data": [
          false,
          true
        ],
        "schema_id": "uniqueItems_5_0",
        "action": "validate",
        "expect": {
          "success": true
        }
      },
      {
        "description": "[true, false] from items array is valid",
        "data": [
          true,
          false
        ],
        "schema_id": "uniqueItems_5_0",
        "action": "validate",
        "expect": {
          "success": true
        }
      },
      {
        "description": "[false, false] from items array is valid",
        "data": [
          false,
          false
        ],
        "schema_id": "uniqueItems_5_0",
        "action": "validate",
        "expect": {
          "success": true
        }
      },
      {
        "description": "[true, true] from items array is valid",
        "data": [
          true,
          true
        ],
        "schema_id": "uniqueItems_5_0",
        "action": "validate",
        "expect": {
          "success": true
        }
      },
      {
        "description": "extra items are invalid even if unique",
        "data": [
          false,
          true,
          null
        ],
        "schema_id": "uniqueItems_5_0",
        "action": "validate",
        "expect": {
          "success": false
        }
      }
    ]
  },
  {
    "description": "extensible: true allows extra items in uniqueItems",
    "database": {
      "schemas": [
        {
          "uniqueItems": true,
          "extensible": true,
          "$id": "uniqueItems_6_0"
        }
      ]
    },
    "tests": [
      {
        "description": "extra items must be unique",
        "data": [
          1,
          1
        ],
        "schema_id": "uniqueItems_6_0",
        "action": "validate",
        "expect": {
          "success": false
        }
      },
      {
        "description": "extra unique items valid",
        "data": [
          1,
          2
        ],
        "schema_id": "uniqueItems_6_0",
        "action": "validate",
        "expect": {
          "success": true
        }
      }
    ]
  }
]