FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

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

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 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.

stleary commented Mar 21, 2025
edited
Loading

Copy link
Copy Markdown
Owner

What problem does this code solve?
When parsing a map, store null value as JSON null instead of omitting the key/value pair. This optional behavior is only available when parsing maps.

Does the code still compile with Java6?
Yes

Risks
Low

Changes to the API?
Adds a new JSONParserConfiguration option

Will this require a new release?
No

Should the documentation be updated?
No

Does it break the unit tests?
No. New unit tests were added

Was any code refactored in this commit?
No

Review status
APPROVED

Starting 3-day comment window.

@effad Thanks for the PR. If you get a chance to make the code updates, they will be included in this PR.
Otherwise, someone will make the changes in a subsequent commit.

effad commented Mar 21, 2025
edited
Loading

Copy link
Copy Markdown
Contributor Author

@effad Thanks for the PR. If you get a chance to make the code updates, they will be included in this PR. Otherwise, someone will make the changes in a subsequent commit.

On it.

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 merged commit d4c5136 into stleary:master Mar 23, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
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


Back | FazBrowse Home | New Git URL