Option to store null value in JSONObject when parsing a map by effad · Pull Request #961 · stleary/JSON-java · GitHub
Skip to content

Option to store null value in JSONObject when parsing a map#961

Merged
stleary merged 5 commits into
stleary:masterfrom
effad:master
Mar 23, 2025
Merged

Option to store null value in JSONObject when parsing a map#961
stleary merged 5 commits into
stleary:masterfrom
effad:master

Conversation

@effad

@effad effad commented Mar 19, 2025

Copy link
Copy Markdown
Contributor

This PR provides a new JSONParserConfiguration option to allow a Java Map.of("foo", null) to be converted into {"foo": null} instead of {}.

See also Issue #296 and PR #338, which was rejected due to API concerns. Since now we have a proper configuration object these concerns are addressed.

Comment thread src/main/java/org/json/JSONParserConfiguration.java Outdated
Comment thread src/main/java/org/json/JSONParserConfiguration.java Outdated
@stleary

stleary commented Mar 21, 2025

Copy link
Copy Markdown
Owner

@effad

effad commented Mar 21, 2025

Copy link
Copy Markdown
Contributor Author

Comment thread src/main/java/org/json/JSONParserConfiguration.java
@stleary stleary changed the title Allow alternative handling of Java null values (fix for Issue #296) Option to store null value in JSONObject when parsing a map Mar 23, 2025
@stleary stleary merged commit d4c5136 into stleary:master Mar 23, 2025
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.

3 participants