jakartaee / jakartaee/jsonb-api

Add jsonb.close() to all code examples in documentation

Open
#223 1 comment 4 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
95
Forks
41
Avg merge
1d 6h
Merged PRs (30d)
35

Description

Docs show using `jsonb.fromJson()` and `jsonb.toJson()` following `Jsonb jsonb = JsonbBuilder.create()`, but the docs are highly misleading in not showing the required `jsonb.close()` calls.

Update the docs to show the use of `jsonb.close()` or try-with-resources in **all** examples where a `Jsonb` instance is retrieved.

JSON-B implementations can memory-leak if `close()` is never called.

Johnzon is confirmed to leak if a local-scope `Jsonb` instance is never closed in a frequently used method (for example, in a MicroProfile Health implementation).

Contributor guide

Open the contributing guide

Research direction

Search the documentation for every example that retrieves a Jsonb instance with JsonbBuilder.create(), then review how each instance is used. Done means all such examples show jsonb.close() or use try-with-resources, including the fromJson() and toJson() examples.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
documentation
Issue type
Documentation
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.