Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Validation errors should be able to indicate that a single error should be produced without collecting all of the details ahead of time #517

Open
Julian opened this issue Jan 14, 2019 · 0 comments
Labels
Dialects v2 Issues which will likely be addressed as part of reworked dialect support Enhancement Some new desired functionality Error Reporting Issues related to clearer or more robust validation error reporting

Comments

@Julian
Copy link
Member

Julian commented Jan 14, 2019

In general, validation is lazy -- if only one error is needed (in the sense that it is known that an instance is invalid), only one is produced.

There are however (somewhat unintentional) exceptions.

E.g.:

What's happening in these situations is that the validation function knows an error has occurred -- it wants to yield an error, but in order to do so, it needs to calculate the full details required so that the error is "complete".

We should instead have a way to indicate a validation error has occurred, but delay fully calculating its contents until/unless they are requested.

@Julian Julian added the Enhancement Some new desired functionality label Feb 16, 2019
@Julian Julian changed the title Consider replacing ValidationError.context with something lazy Validation errors should be able to indicate that a single error should be produced without collecting all of the details ahead of time Aug 23, 2021
Julian added a commit that referenced this issue Oct 19, 2021
ba3a90534 Merge pull request #523 from olegshtch/extendible-schema-test-suite
458e7ac1e Add test suite to test dynamic reference and anchor link and their independency of order
fe405a119 draft/future -> draft/next in $refs also
3d9d35a2a Merge pull request #522 from json-schema-org/ether/draft-next
11b5076f0 rename draft-future to draft-next
0245dcc94 Merge pull request #521 from olegshtch/add-recursive-ref-test-suite
e9fb9cf45 Merge pull request #517 from ChALkeR/chalker/date-time-leap
f1b230c69 Add test from Appendix C.  Example of recursive schema extension of the draft.
bb2e37317 Test date-time with leap second on a wrong hour/minute
8b797cfe6 Merge pull request #520 from json-schema-org/ether/custom-dialect
5d23f3112 Add tests for invalid date-time past leap second
63f8e93c1 Improve leap seconds test in optional/format/date-time
3d00f593d test the use of the $vocabulary keyword in a custom metaschema

git-subtree-dir: json
git-subtree-split: ba3a9053400dd6237aef9cc63601758b1d266818
@Julian Julian added the Error Reporting Issues related to clearer or more robust validation error reporting label Aug 19, 2022
@Julian Julian added the Dialects v2 Issues which will likely be addressed as part of reworked dialect support label Nov 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Dialects v2 Issues which will likely be addressed as part of reworked dialect support Enhancement Some new desired functionality Error Reporting Issues related to clearer or more robust validation error reporting
Projects
None yet
Development

No branches or pull requests

1 participant