[
  {
    "description": "maxContains without contains is ignored",
    "database": {
      "schemas": [
        {
          "maxContains": 1,
          "extensible": true,
          "$id": "maxContains_0_0"
        }
      ]
    },
    "tests": [
      {
        "description": "one item valid against lone maxContains",
        "data": [
          1
        ],
        "schema_id": "maxContains_0_0",
        "action": "validate",
        "expect": {
          "success": true
        }
      },
      {
        "description": "two items still valid against lone maxContains",
        "data": [
          1,
          2
        ],
        "schema_id": "maxContains_0_0",
        "action": "validate",
        "expect": {
          "success": true
        }
      }
    ]
  },
  {
    "description": "maxContains with contains",
    "database": {
      "schemas": [
        {
          "contains": {
            "const": 1
          },
          "maxContains": 1,
          "extensible": true,
          "$id": "maxContains_1_0"
        }
      ]
    },
    "tests": [
      {
        "description": "empty data",
        "data": [],
        "schema_id": "maxContains_1_0",
        "action": "validate",
        "expect": {
          "success": false
        }
      },
      {
        "description": "all elements match, valid maxContains",
        "data": [
          1
        ],
        "schema_id": "maxContains_1_0",
        "action": "validate",
        "expect": {
          "success": true
        }
      },
      {
        "description": "all elements match, invalid maxContains",
        "data": [
          1,
          1
        ],
        "schema_id": "maxContains_1_0",
        "action": "validate",
        "expect": {
          "success": false
        }
      },
      {
        "description": "some elements match, valid maxContains",
        "data": [
          1,
          2
        ],
        "schema_id": "maxContains_1_0",
        "action": "validate",
        "expect": {
          "success": true
        }
      },
      {
        "description": "some elements match, invalid maxContains",
        "data": [
          1,
          2,
          1
        ],
        "schema_id": "maxContains_1_0",
        "action": "validate",
        "expect": {
          "success": false
        }
      }
    ]
  },
  {
    "description": "maxContains with contains, value with a decimal",
    "database": {
      "schemas": [
        {
          "contains": {
            "const": 1
          },
          "maxContains": 1,
          "extensible": true,
          "$id": "maxContains_2_0"
        }
      ]
    },
    "tests": [
      {
        "description": "one element matches, valid maxContains",
        "data": [
          1
        ],
        "schema_id": "maxContains_2_0",
        "action": "validate",
        "expect": {
          "success": true
        }
      },
      {
        "description": "too many elements match, invalid maxContains",
        "data": [
          1,
          1
        ],
        "schema_id": "maxContains_2_0",
        "action": "validate",
        "expect": {
          "success": false
        }
      }
    ]
  },
  {
    "description": "minContains < maxContains",
    "database": {
      "schemas": [
        {
          "contains": {
            "const": 1
          },
          "minContains": 1,
          "maxContains": 3,
          "extensible": true,
          "$id": "maxContains_3_0"
        }
      ]
    },
    "tests": [
      {
        "description": "actual < minContains < maxContains",
        "data": [],
        "schema_id": "maxContains_3_0",
        "action": "validate",
        "expect": {
          "success": false
        }
      },
      {
        "description": "minContains < actual < maxContains",
        "data": [
          1,
          1
        ],
        "schema_id": "maxContains_3_0",
        "action": "validate",
        "expect": {
          "success": true
        }
      },
      {
        "description": "minContains < maxContains < actual",
        "data": [
          1,
          1,
          1,
          1
        ],
        "schema_id": "maxContains_3_0",
        "action": "validate",
        "expect": {
          "success": false
        }
      }
    ]
  },
  {
    "description": "extensible: true allows non-matching items in maxContains",
    "database": {
      "schemas": [
        {
          "contains": {
            "const": 1
          },
          "maxContains": 1,
          "extensible": true,
          "$id": "maxContains_4_0"
        }
      ]
    },
    "tests": [
      {
        "description": "extra items disregarded for maxContains",
        "data": [
          1,
          2
        ],
        "schema_id": "maxContains_4_0",
        "action": "validate",
        "expect": {
          "success": true
        }
      }
    ]
  }
]