Skip to content

Add valid test instance for {"contains": false} schema #273

Closed
@Zac-HD

Description

@Zac-HD

I make rather unconventional use of this test corpus for hypothesis-jsonschema: instead of checking that the examples validate against each schema, I check that I can generate an instance if and only if there is a valid example for that schema (and then that whatever I generated validates).

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

The clear intention is that nothing should validation against this, but the effect is that only non-array instances validate. So it would be convenient for my downstream use and clear for other users to add an explicit "type": "array" to this schema.

I intend to do this myself or as a mentored good first issue at the PyCon Australia sprints next week 😄

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