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

Inconsistent spec for Parser and Generator w.r.t. generating/parsing a sequence of Objects #306

Open
bergtwvd opened this issue Sep 27, 2021 · 0 comments

Comments

@bergtwvd
Copy link

The JsonParser documentation shows:

JsonParser can be used to parse sequence of JSON values that are not enclosed in a JSON array, e.g. { } { }. The following code demonstrates how to parse such sequence.

 JsonParser parser = Json.createParser(...);
 while (parser.hasNext) {
     parser.next(); // advance parser state
     JsonValue value = parser.getValue();
 }

But with the JsonGenerator there is no way to create such a sequence. The only way to create a sequence is by putting the objects in an array. But this is different from the Parser.

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