Skip to content

additionalItems meta-schema dependency #209

Closed
@epoberezkin

Description

@epoberezkin

At the moment the spec says:

Otherwise [if items is not an array], "additionalItems" MUST be ignored, as the "items" schema (possibly the default value of an empty schema) is applied to all elements.

That causes a lot of confusion from users. The suggestion is to prohibit additionalItems (rather then require ignoring it) and enforce it via meta-schema unless items is present and it is an array.

The meta-schema will be inside dependencies, together with exclusiveMaximum and exclusiveMinimum (#189 (comment))

"dependencies": {
  "additionalItems": {
    "required": ["items"],
    "properties": { "items": { "type": "array" } }
  }
}

The spec also becomes simpler:

Otherwise [if items is not an array], "additionalItems" MUST NOT be present

@awwright @handrews @Relequestual if that makes sense, I can make a PR

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions