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

Do not close passed-in Writer (#604) #662

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

greek1979
Copy link
Contributor

Do not close the Writer resources that has been supplied to the JsonBinding methods by the caller. Let the latter manage the lifecycle of the output writer. This prevents java.io.IOException: Stream closed errors with Spring Native and Spring Boot when generating a JSON response from an HTTP method, for example, as Spring assumes the JSON-B implementation serializes the passed in POJO into JSON, writes it to a supplied Writer but does not close it yet. Flushing the output is perfectly fine and is acceptable, of course.

See #604 for details of the regression introduced in Yasson 3.0.3 and #389 for the description of the original bug.

@greek1979 greek1979 force-pushed the keep-writers-open branch 2 times, most recently from 860bd27 to 5688945 Compare February 12, 2025 10:56
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

Successfully merging this pull request may close these issues.

1 participant