Skip to content

"contains with false if subschema" in draft 6 shouldn't be applicable - "if" was not defined until draft 7 #535

Closed
@jimmylewis

Description

@jimmylewis

I'm working on an implementation for draft 6, and noticed this test (added in #485). I'm guessing it was oversight to add this to draft 6. For convenience, I've copied the test fragment here:

{
    "description": "contains with false if subschema",
    "schema": {
        "contains": {
            "if": false,
            "else": true
        }
    },
    "tests": [
        {
            "description": "any non-empty array is valid",
            "data": ["foo"],
            "valid": true
        },
        {
            "description": "empty array is invalid",
            "data": [],
            "valid": false
        }
    ]
}

With "if" and "else" not defined in draft 6, this schema is equivalent to "contains": {}, making it redundant with the "contains keyword with boolean schema true" test.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions