-
Notifications
You must be signed in to change notification settings - Fork 128
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
export and validate: Substantially improve validation errors
All errors are reported in the case of subschemas inside a "oneOf" validator, such as used by our "tree" property. Previously only the top-level error was reported and it was worse than useless as it was incredibly long and contained no actionable information. Suberrors are grouped by the validator arm they failed, making it clear why each element of a "oneOf" failed. Errors avoid being overly long by consistently shortening output that might be long. Different shortening strategies are used for different values in an attempt to preserve the most useful information. Paths in error messages now index into the given JSON being validated, not the JSON Schema. This disconnect was confusing as the schema path refers to properties that don't exist in the JSON being validated. Resolves <#1044>.
- Loading branch information
Showing
2 changed files
with
148 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters