Report contains sub-errors at the failing item's location - #154
Merged
pk-work merged 1 commit intoAug 9, 2026
Merged
Conversation
Contributor
|
@jnbdz could you rebase the PR? Then I will merge it. Thank you very much |
The contains loop iterates with j but built the sub-error instance location from the enclosing i, which points at the index where prefixItems/items processing stopped (0 when absent). Every failing item was therefore reported at the same wrong location. Fixes eclipse-vertx#153
jnbdz
force-pushed
the
fix-contains-instance-location
branch
from
August 9, 2026 17:14
d647ea9 to
5f0f634
Compare
Contributor
Author
Contributor
|
Thank you very much |
Contributor
Author
|
@pk-work should the branch be deleted? |
Contributor
|
@jnbdz ? I guess it's a branch on your fork. So you can decide. |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #153
Motivation
The
containsvalidation loop iterates with its own variablejbut built the sub-error instance location from the enclosing scope'si— the index whereprefixItems/itemsprocessing stopped, which is0when those keywords are absent. Every failing element was therefore reported at the same wrong location: validating[1, 2]against{"contains": {"type": "string"}, "minContains": 1}reported both per-item type errors at#/0.Changes
Build the location from
j. Added a regression test asserting each failing item is reported at its own location (#/0and#/1).Note: #152 touches the neighboring lines of the same loop (behavior-preserving hoist); whichever merges second will have a trivial conflict — happy to rebase either.