jakartaee / jakartaee/jsonp-api
Inconsistent spec for Parser and Generator w.r.t. generating/parsing a sequence of Objects
- Dominant language
- Java
- Stars
- 160
- Forks
- 64
- Avg merge
- 4d 5h
- Merged PRs (30d)
- 4
Description
The JsonParser [documentation ](https://jakarta.ee/specifications/jsonp/2.0/apidocs/jakarta.json/jakarta/json/stream/jsonparser) 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.
Contributor guide
Research direction
Start with the linked JsonParser API documentation and the corresponding JsonGenerator API to compare how sequences of JSON objects are parsed and generated. Determine the intended behavior and whether the inconsistency requires an API or specification change; done means the Parser and Generator behavior is consistently defined and documented.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- api
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100