Skip to content

Negative schema tests #662

Closed as not planned
Closed as not planned
@awwright

Description

@awwright

The JSON Schema test suite needs support for describing "negative tests": values that are not valid schemas, and are supposed to cause an error (according to the spec). For example, { "minimum": null } is invalid, and an example of a negative schema test.

Negative schema tests are necessary to test that implementations implement the interoperability rules.

In an earlier comment, I suggest that "tests" should be null for this case—but since the value for "schema" is deliberately invalid, and therefore not technically a schema, it should be specified in a separate property, e.g.

[
    {
        "description": "number in enum is invalid",
        "negativeSchema": { "enum": 4 }
    }
]

Related issues #386

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