json-schema-spec
json-schema-spec copied to clipboard
prefixItems does not explicitly mention instances arrays shorter than the keyword value length
The prefixItems keyword section says this:
Validation succeeds if each element of the instance validates against the schema at the same position, if any. This keyword does not constrain the length of the array. If the array is longer than this keyword's value, this keyword validates only the prefix of matching length.
Note that it explicitly mentions if the instance array is longer but nothing about when it's shorter. It does say that no length constraints are imposed, but it feels odd that it would mention one without the other.
We do have a test for this as well.
The wording does seem confusing. I'm not sure it's wrong, but just that I'm not sure means it should be clearer.
Yeah, it's definitely not wrong.