Skip to content

Commit

Permalink
introduce null-save JsonObjectBuilder.add and JsonGenerator.write met…
Browse files Browse the repository at this point in the history
…hods jakartaee#213

Signed-off-by: Jorge Bescos Gascon <[email protected]>
  • Loading branch information
jbescos committed Oct 18, 2021
1 parent 3c3b1b1 commit 5f1f592
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
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

0 comments on commit 5f1f592

Please sign in to comment.