Skip to content
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

How to Parse an Object with Unquoted Keys #12

Open
glassfishrobot opened this issue Dec 14, 2017 · 6 comments
Open

How to Parse an Object with Unquoted Keys #12

glassfishrobot opened this issue Dec 14, 2017 · 6 comments

Comments

@glassfishrobot
Copy link

It is very common to have unquoted keys in a JSON string, e.g.

{
  name : "Jason",
  age : 10
}

Other libraries, like Gson, handles this well, but on the Glassfish reference implementation this throws

Exception in thread "main" javax.json.stream.JsonParsingException: Unexpected char 97 at (line no=2, column no=8, offset=13), expecting 'u'
	at org.glassfish.json.JsonTokenizer.expectedChar(JsonTokenizer.java:607)
	at org.glassfish.json.JsonTokenizer.readNull(JsonTokenizer.java:339)
	at org.glassfish.json.JsonTokenizer.nextToken(JsonTokenizer.java:396)
	at org.glassfish.json.JsonParserImpl$ObjectContext.getNextEvent(JsonParserImpl.java:453)
	at org.glassfish.json.JsonParserImpl.next(JsonParserImpl.java:363)
	at org.glassfish.json.JsonParserImpl.getObject(JsonParserImpl.java:333)
	at org.glassfish.json.JsonParserImpl.getObject(JsonParserImpl.java:173)
	at org.glassfish.json.JsonReaderImpl.readObject(JsonReaderImpl.java:112)
@glassfishrobot
Copy link
Author

@keilw Commented
So it works when both "name" and "age" are in quotes?

@glassfishrobot
Copy link
Author

@isapir Commented
Yes

On Dec 20, 2017 4:29 AM, "Werner Keil" [email protected] wrote:

So it works when both "name" and "age" are in quotes?


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
https://github.com/javaee/jsonp/issues/75#issuecomment-353050792, or mute
the thread
https://github.com/notifications/unsubscribe-auth/AA2Ek9htvMx1eQv-_PZ5cIjI0tdewApeks5tCP2jgaJpZM4RCnb_
.

@glassfishrobot
Copy link
Author

@m0mus Commented
Changing label to Enchancement.

@glassfishrobot
Copy link
Author

@keilw Commented
Good, btw. what about the EE4J integration of this project? JSON-B already did.

@glassfishrobot
Copy link
Author

@m0mus Commented
@keilw It's in progress. Initial proposal is created for JSON-P and It's in the first batch of transferred projects. It starts are aligned it will be in EE4J before the new year. If they aren't then in January 2018.

@glassfishrobot
Copy link
Author

@lukasj lukasj transferred this issue from jakartaee/jsonp-api Jun 8, 2021
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

No branches or pull requests

1 participant