[
    {
        "description": "maxContains without contains is ignored",
        "schema": {
            "$schema": "https://json-schema.org/draft/2020-12/schema",
            "maxContains": 1
        },
        "tests": [
            {
                "description": "one item valid against lone maxContains",
                "data": [ 1 ],
                "valid": true
            },
            {
                "description": "two items still valid against lone maxContains",
                "data": [ 1, 2 ],
                "valid": true
            }
        ]
    },
    {
        "description": "maxContains with contains",
        "schema": {
            "$schema": "https://json-schema.org/draft/2020-12/schema",
            "contains": {"const": 1},
            "maxContains": 1
        },
        "tests": [
            {
                "description": "empty data",
                "data": [ ],
                "valid": false
            },
            {
                "description": "all elements match, valid maxContains",
                "data": [ 1 ],
                "valid": true
            },
            {
                "description": "all elements match, invalid maxContains",
                "data": [ 1, 1 ],
                "valid": false
            },
            {
                "description": "some elements match, valid maxContains",
                "data": [ 1, 2 ],
                "valid": true
            },
            {
                "description": "some elements match, invalid maxContains",
                "data": [ 1, 2, 1 ],
                "valid": false
            }
        ]
    },
    {
        "description": "maxContains with contains, value with a decimal",
        "schema": {
            "$schema": "https://json-schema.org/draft/2020-12/schema",
            "contains": {"const": 1},
            "maxContains": 1.0
        },
        "tests": [
            {
                "description": "one element matches, valid maxContains",
                "data": [ 1 ],
                "valid": true
            },
            {
                "description": "too many elements match, invalid maxContains",
                "data": [ 1, 1 ],
                "valid": false
            }
        ]
    },
    {
        "description": "minContains < maxContains",
        "schema": {
            "$schema": "https://json-schema.org/draft/2020-12/schema",
            "contains": {"const": 1},
            "minContains": 1,
            "maxContains": 3
        },
        "tests": [
            {
                "description": "actual < minContains < maxContains",
                "data": [ ],
                "valid": false
            },
            {
                "description": "minContains < actual < maxContains",
                "data": [ 1, 1 ],
                "valid": true
            },
            {
                "description": "minContains < maxContains < actual",
                "data": [ 1, 1, 1, 1 ],
                "valid": false
            }
        ]
    }
]
