Skip to content

Regarding uniqueItems error interpretation #1099

Closed
@nuno-andre

Description

@nuno-andre

JSON Schema specs define an array as an ordered sequence of zero or more values and its instance equality as both are arrays and have an equal value item-for-item but, AFAIK, do not state which mathematical object corresponds to this type and therefore neither its concept of multiplicity.

So, for instance, in a uniqueItems validation against [1, 1, 2, 2, 2, 3], how many errors should we say have occurred?

  • Two errors: 1 and 2 are not unique.
  • Three errors: the second 1, the second 2, and the third 2 are repeated elements.
  • Five errors: {1, 1, 2, 2, 2}.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    Status

    Closed

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions