The form can't seem to output multiple of the same error

If I am using an array schema type with the uniqueItems schema set on it I can only ever receive one unique error at a time. For example if I add the same entry three times in a row into the array only the last two entries will appear as duplicate (items 2,3), but items (1,2) error disappears from the error array when the items (2,3) error appears.

First errors array
[
{
dataPath: "options"
keyword: "uniqueItems"
message: "should NOT have duplicate items (items ## 1 and 2 are identical)"
params: {i: 2, j: 1}
parentSchema: {items: {…}, minItems: 1, type: "array", uniqueItems: true}
schema: true
schemaPath: "#/properties/options/uniqueItems"
}
]

Second errors array, missing the first error even though it hasn't been resolved.
[
{
dataPath: "options"
keyword: "uniqueItems"
message: "should NOT have duplicate items (items ## 2 and 3 are identical)"
params: {i: 3, j: 2}
parentSchema: {items: {…}, minItems: 1, type: "array", uniqueItems: true}
schema: true
schemaPath: "#/properties/options/uniqueItems"
}
]

Is this intended functionality?

Hi @kiwdahc, I’m not aware of any error consolidation on the side of JSON Forms. Of course there could be something which we do wrong.

There are some points which can be investigated:

  • Which errors are reported by JSON Forms programmatically?
  • Which errors are reported when invoking AJV directly

Based on this information we can determine whether this is a fault with JSON Forms or a limitation of AJV.