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

introduce null-save JsonObjectBuilder.add and JsonGenerator.write met… #311

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions api/src/main/java/jakarta/json/JsonConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,12 @@
*/
public final class JsonConfig {

/**
* Configuration property to ignore null values. All providers
* must support this property. The value of the property is boolean.
*/
public static final String IGNORE_NULL = "jakarta.json.JsonConfig.ignoreNull";

/**
* Configuration property to define the strategy for handling duplicate keys.
*
Expand Down
5 changes: 3 additions & 2 deletions api/src/main/java/jakarta/json/JsonObjectBuilder.java
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,9 @@
* </code>
* </pre>
*
* <p>This class does <em>not</em> allow <code>null</code> to be used as a name or
* value while building the JSON object
* <p>By default, this class does <em>not</em> allow <code>null</code> to be used as a name or
* value while building the JSON object. It is possible to change this behavior with configuration
* {@link JsonConfig#IGNORE_NULL}
*
* @see JsonArrayBuilder
*/
Expand Down