[
  {
    "description": "minContains without contains is ignored",
    "database": {
      "schemas": [
        {
          "minContains": 1,
          "extensible": true,
          "$id": "minContains_0_0"
        }
      ]
    },
    "tests": [
      {
        "description": "one item valid against lone minContains",
        "data": [
          1
        ],
        "schema_id": "minContains_0_0",
        "action": "validate",
        "expect": {
          "success": true
        }
      },
      {
        "description": "zero items still valid against lone minContains",
        "data": [],
        "schema_id": "minContains_0_0",
        "action": "validate",
        "expect": {
          "success": true
        }
      }
    ]
  },
  {
    "description": "minContains=1 with contains",
    "database": {
      "schemas": [
        {
          "contains": {
            "const": 1
          },
          "minContains": 1,
          "extensible": true,
          "$id": "minContains_1_0"
        }
      ]
    },
    "tests": [
      {
        "description": "empty data",
        "data": [],
        "schema_id": "minContains_1_0",
        "action": "validate",
        "expect": {
          "success": false
        }
      },
      {
        "description": "no elements match",
        "data": [
          2
        ],
        "schema_id": "minContains_1_0",
        "action": "validate",
        "expect": {
          "success": false
        }
      },
      {
        "description": "single element matches, valid minContains",
        "data": [
          1
        ],
        "schema_id": "minContains_1_0",
        "action": "validate",
        "expect": {
          "success": true
        }
      },
      {
        "description": "some elements match, valid minContains",
        "data": [
          1,
          2
        ],
        "schema_id": "minContains_1_0",
        "action": "validate",
        "expect": {
          "success": true
        }
      },
      {
        "description": "all elements match, valid minContains",
        "data": [
          1,
          1
        ],
        "schema_id": "minContains_1_0",
        "action": "validate",
        "expect": {
          "success": true
        }
      }
    ]
  },
  {
    "description": "minContains=2 with contains",
    "database": {
      "schemas": [
        {
          "contains": {
            "const": 1
          },
          "minContains": 2,
          "extensible": true,
          "$id": "minContains_2_0"
        }
      ]
    },
    "tests": [
      {
        "description": "empty data",
        "data": [],
        "schema_id": "minContains_2_0",
        "action": "validate",
        "expect": {
          "success": false
        }
      },
      {
        "description": "all elements match, invalid minContains",
        "data": [
          1
        ],
        "schema_id": "minContains_2_0",
        "action": "validate",
        "expect": {
          "success": false
        }
      },
      {
        "description": "some elements match, invalid minContains",
        "data": [
          1,
          2
        ],
        "schema_id": "minContains_2_0",
        "action": "validate",
        "expect": {
          "success": false
        }
      },
      {
        "description": "all elements match, valid minContains (exactly as needed)",
        "data": [
          1,
          1
        ],
        "schema_id": "minContains_2_0",
        "action": "validate",
        "expect": {
          "success": true
        }
      },
      {
        "description": "all elements match, valid minContains (more than needed)",
        "data": [
          1,
          1,
          1
        ],
        "schema_id": "minContains_2_0",
        "action": "validate",
        "expect": {
          "success": true
        }
      },
      {
        "description": "some elements match, valid minContains",
        "data": [
          1,
          2,
          1
        ],
        "schema_id": "minContains_2_0",
        "action": "validate",
        "expect": {
          "success": true
        }
      }
    ]
  },
  {
    "description": "minContains=2 with contains with a decimal value",
    "database": {
      "schemas": [
        {
          "contains": {
            "const": 1
          },
          "minContains": 2,
          "extensible": true,
          "$id": "minContains_3_0"
        }
      ]
    },
    "tests": [
      {
        "description": "one element matches, invalid minContains",
        "data": [
          1
        ],
        "schema_id": "minContains_3_0",
        "action": "validate",
        "expect": {
          "success": false
        }
      },
      {
        "description": "both elements match, valid minContains",
        "data": [
          1,
          1
        ],
        "schema_id": "minContains_3_0",
        "action": "validate",
        "expect": {
          "success": true
        }
      }
    ]
  },
  {
    "description": "maxContains = minContains",
    "database": {
      "schemas": [
        {
          "contains": {
            "const": 1
          },
          "maxContains": 2,
          "minContains": 2,
          "extensible": true,
          "$id": "minContains_4_0"
        }
      ]
    },
    "tests": [
      {
        "description": "empty data",
        "data": [],
        "schema_id": "minContains_4_0",
        "action": "validate",
        "expect": {
          "success": false
        }
      },
      {
        "description": "all elements match, invalid minContains",
        "data": [
          1
        ],
        "schema_id": "minContains_4_0",
        "action": "validate",
        "expect": {
          "success": false
        }
      },
      {
        "description": "all elements match, invalid maxContains",
        "data": [
          1,
          1,
          1
        ],
        "schema_id": "minContains_4_0",
        "action": "validate",
        "expect": {
          "success": false
        }
      },
      {
        "description": "all elements match, valid maxContains and minContains",
        "data": [
          1,
          1
        ],
        "schema_id": "minContains_4_0",
        "action": "validate",
        "expect": {
          "success": true
        }
      }
    ]
  },
  {
    "description": "maxContains < minContains",
    "database": {
      "schemas": [
        {
          "contains": {
            "const": 1
          },
          "maxContains": 1,
          "minContains": 3,
          "extensible": true,
          "$id": "minContains_5_0"
        }
      ]
    },
    "tests": [
      {
        "description": "empty data",
        "data": [],
        "schema_id": "minContains_5_0",
        "action": "validate",
        "expect": {
          "success": false
        }
      },
      {
        "description": "invalid minContains",
        "data": [
          1
        ],
        "schema_id": "minContains_5_0",
        "action": "validate",
        "expect": {
          "success": false
        }
      },
      {
        "description": "invalid maxContains",
        "data": [
          1,
          1,
          1
        ],
        "schema_id": "minContains_5_0",
        "action": "validate",
        "expect": {
          "success": false
        }
      },
      {
        "description": "invalid maxContains and minContains",
        "data": [
          1,
          1
        ],
        "schema_id": "minContains_5_0",
        "action": "validate",
        "expect": {
          "success": false
        }
      }
    ]
  },
  {
    "description": "minContains = 0",
    "database": {
      "schemas": [
        {
          "contains": {
            "const": 1
          },
          "minContains": 0,
          "extensible": true,
          "$id": "minContains_6_0"
        }
      ]
    },
    "tests": [
      {
        "description": "empty data",
        "data": [],
        "schema_id": "minContains_6_0",
        "action": "validate",
        "expect": {
          "success": true
        }
      },
      {
        "description": "minContains = 0 makes contains always pass",
        "data": [
          2
        ],
        "schema_id": "minContains_6_0",
        "action": "validate",
        "expect": {
          "success": true
        }
      }
    ]
  },
  {
    "description": "minContains = 0 with maxContains",
    "database": {
      "schemas": [
        {
          "contains": {
            "const": 1
          },
          "minContains": 0,
          "maxContains": 1,
          "extensible": true,
          "$id": "minContains_7_0"
        }
      ]
    },
    "tests": [
      {
        "description": "empty data",
        "data": [],
        "schema_id": "minContains_7_0",
        "action": "validate",
        "expect": {
          "success": true
        }
      },
      {
        "description": "not more than maxContains",
        "data": [
          1
        ],
        "schema_id": "minContains_7_0",
        "action": "validate",
        "expect": {
          "success": true
        }
      },
      {
        "description": "too many",
        "data": [
          1,
          1
        ],
        "schema_id": "minContains_7_0",
        "action": "validate",
        "expect": {
          "success": false
        }
      }
    ]
  },
  {
    "description": "extensible: true allows non-matching items in minContains",
    "database": {
      "schemas": [
        {
          "contains": {
            "const": 1
          },
          "minContains": 1,
          "extensible": true,
          "$id": "minContains_8_0"
        }
      ]
    },
    "tests": [
      {
        "description": "extra items disregarded for minContains",
        "data": [
          1,
          2
        ],
        "schema_id": "minContains_8_0",
        "action": "validate",
        "expect": {
          "success": true
        }
      }
    ]
  }
]