jakartaee / jakartaee/jsonp-api
Clarification needed: Should JsonWriter write methods close the underlying writer/stream
- Dominant language
- Java
- Stars
- 160
- Forks
- 64
- Avg merge
- 4d 5h
- Merged PRs (30d)
- 4
Description
Hi,
I'm evaluating Johnzon [1] as JSON-P implementation. My concern is that Johnzon's JsonWriter implementation closes the writer/stream after invocation of any of the write*() methods: [2]. The javadoc does not explicitly mention that the stream/writer has to be closed, but says that the write* methods are one-time use only, which might be interpreted that they close the stream/writer.
Please clarify if it's ok for the write* methods to close the underlying stream/writer.
[1] https://github.com/apache/johnzon
[2] https://github.com/apache/johnzon/blob/180eb6133e4194832541bbd0c29b23e40765617c/johnzon-core/src/main/java/org/apache/johnzon/core/JsonWriterImpl.java#L43
Kind regards,
Svetlin
Contributor guide
Research direction
Start with the linked JsonWriterImpl.java implementation and the JsonWriter API javadocs, focusing on the write* methods and their underlying writer or stream behavior. Clarify the intended lifecycle contract and update the relevant API documentation if a documentation change is agreed.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- api, documentation
- Issue type
- Documentation
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100