Skip to content

description of additionalItems test case is insufficient / misleading #768

Open
@gregsdennis

Description

@gregsdennis

Test:

{
"description": "additionalItems does not look in applicators, valid case",
"schema": {
"allOf": [
{ "items": [ { "type": "integer" } ] }
],
"additionalItems": { "type": "boolean" }
},
"tests": [
{
"description": "items defined in allOf are not examined",
"data": [ 1, null ],
"valid": true
}
]
},

While it's true that additionalItems can't see into applicators, the reason this passes validation is actually because the default value for items is an empty schema, which evaluates all items, leaving none for additionalItems to operate on.

We already have a test for default items, though, which kind of makes this one redundant.

We also have an invalid test immediately below the test in question that could easily have a valid test data case added to it. This test properly verifies that the additionalItems is failing on the second element.

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