Repository navigation
Preserve plus signs in JSONPointer URI fragments - #1090
JimmyLiuJia wants to merge 2 commits into
Conversation
|
@JimmyLiuJia Please resolve conflicts in JSONPointerTest |
| @@ -1,287 +1,288 @@ | |||
| package org.json; | |||
There was a problem hiding this comment.
Looks like you have inserted CRLFs throughout the file. Please restore the original formatting in this file, and potentially in JSONPointerTest.java
|
|
What problem does this code solve? Risks Changes to the Existing Behavior Changes to the API Will this require a new release? Should the documentation be updated? Unit Tests Refactoring Review status Starting 3-day comment window |



With both
"a+b"and"a b"in a document,query("#/a+b")currently returns the space-containing member.JSONPointeruses form decoding for URI fragments, so it converts a literal+into a space. Conversely,toURIFragment()emits spaces as+rather than%20.Preserve literal plus signs during UTF-8 percent decoding and emit spaces as
%20. This follows RFC 6901 section 6 and the URI fragment syntax in RFC 3986. The regressions cover colliding keys,%2B/%20/%252B, UTF-8, pointer escapes, and generated-fragment round trips.Validation against the updated
master:mvn clean verify -Dgpg.skip=trueandmvn clean test -P test-strict-modeeach complete with 818 passing tests, six existing skips, and zero failures/errors (824 tests reported).mvn clean testcompletes with the same 818 passing tests, six existing skips, and zero failures/errors (824 tests reported).-source 1.6 -target 1.6using JDK 8; no Java 6 runtime test is claimed.AI assistance: OpenAI Codex assisted with the investigation, implementation, regression tests, conflict resolution, and this description.