Skip to content

Handle missing array indexes in Jackson tree providers - #1090

Open
PHJ2000 wants to merge 1 commit into
json-path:masterfrom
PHJ2000:fix/jackson-missing-array-index
Open

PHJ2000 wants to merge 1 commit into
json-path:masterfrom
PHJ2000:fix/jackson-missing-array-index

Conversation

@PHJ2000

@PHJ2000 PHJ2000 commented Oct 13, 2026

Copy link
Copy Markdown

Fixes #1028.

Jackson's ArrayNode.get returns Java null for an out-of-bounds index. The tree providers passed that through as a result, so missing indexes became JSON null values.

Throw IndexOutOfBoundsException in both Jackson tree providers so the existing path evaluation handles missing indexes consistently with the other providers. Existing JSON null elements are preserved.

Tests cover positive and negative indexes, empty arrays, suppressed exceptions and result lists. The full build passes on Java 17 and 21 (1,021 tests passed, 13 skipped on each).

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Reading array out of bound with JacksonJsonNodeJsonProvider

1 participant