-
Notifications
You must be signed in to change notification settings - Fork 156
Open
Description
Context
This issue tracks a pre-existing serialization concern with the LAST_INDEX constant identified during code review of PR #221.
Description
When LAST_INDEX (currently Integer.MIN_VALUE) is used in the append(int) method of AbstractJsonPointer (previously in JsonPointer), it creates a RefToken with the numeric string "-2147483648". Upon serialization via toString() and re-parsing:
- The numeric string "-2147483648" does not match the
VALID_ARRAY_INDregex pattern - The parser treats it as a property name instead of an array index sentinel
- The semantic meaning (append-to-end) is lost in the round-trip
This affects the RFC 6901 compliance where "-" is the standard sentinel for array append operations.
Source
Identified in code review of PR #221 (Jackson 3 support):
Requested by: @sondemar
Location
The logic exists in:
src/main/java/com/flipkart/zjsonpatch/AbstractJsonPointer.java(lines 115-132 after PR Add Jackson 3 support #221)- Originally in
src/main/java/com/flipkart/zjsonpatch/JsonPointer.javaon master branch
Metadata
Metadata
Assignees
Labels
No labels