(Split off from T296676: Propagate Validator Errors as Z5s.)
When a validation error occurs, several errors may be created. For example, { Z1K1: Z6, Z6K1: true } might fail on the Z6K1 key as the value is not a string, and at the object level that it's not a valid Z6 (and others). These errors are both correct, but the user only has one thing to fix. Showing lots of errors could over-whelm the user and make for a less fun experience.
We discussed a few filtering strategy options, with pros and cons:
- Pick the single error with the "longest" chain. [Pro: Simple. Con: Will miss issues where there are two distinct errors.]
- Only filter out errors about Z9s and Z18s and similar "easy" ones. [Pro: Relatively simple. Con: Will leave in over-lapping errors still, and relies on us making good judgements about what is and isn't 'easy'.]
- Filter errors where they share a [Pro: This is what we did in the PHP code. Con: Quite hard to do with AJV, possibly?]
- Explore feasibility of the options above (and any others).
- Agree with the team what route we're going with.
- Implement it.