-
-
Notifications
You must be signed in to change notification settings - Fork 798
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
Array element and field token spans include previous comma #229
Comments
That does not look right.
So, first things first: |
@cowtowncoder thanks for the confirmation. Here's a repro in Scala (using Jackson 2.6.3). val json = "[1, 2, 3]"
val parser = new JsonFactory().createParser(json)
while(parser.nextToken() != null) {
val tok = parser.getCurrentToken
val tokStart = parser.getTokenLocation.getCharOffset.toInt
val currLoc = parser.getCurrentLocation.getCharOffset.toInt
val slice = json.substring(tokStart, currLoc)
println(f"$tok%-20s Start: $tokStart%2d End: $currLoc%2d Slice: {$slice}")
} Output:
|
And for reference, the corresponding behavior for object fields also occurs, and is mentioned here #37 (comment) |
@latkin Thank you! Field name case was known already, and can hopefully be fixed for 2.7.0. Array element one is new to me. |
Yes, I can reproduce this, and can see where it goes wrong, as well as how it can be fixed. |
Consider JSON blob
The spans from
getTokenLocation
togetCurrentLocation
when sitting on eachVALUE_NUMBER_INT
are currentlyI would expect them to each be 1-char wide, i.e.
Is this expected/per-spec?
The text was updated successfully, but these errors were encountered: