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

Feature Request - Add specifier for optionally parsing a field. #21

Open
tarbomb opened this issue Sep 26, 2021 · 0 comments
Open

Feature Request - Add specifier for optionally parsing a field. #21

tarbomb opened this issue Sep 26, 2021 · 0 comments

Comments

@tarbomb
Copy link
Contributor

tarbomb commented Sep 26, 2021

When parsing JSON, it is possible for a dictionary for example to be provided, or be NULL. It might be useful to have the option to detect NULL fields, and decide not to parse them if they are NULL. See example JSON below.

{"id":50919991711,"serialNumber":null,"owner":{"id":1344078314,"type":"User"},"created":"2019-12-03T02:49:36.457Z","updated":"2019-12-03T02:49:36.457Z"}

{"id":50920076429,"serialNumber":null,"owner":{"id":1344182127,"type":"User"},"created":"2019-12-03T02:52:36.14Z","updated":"2019-12-03T02:52:36.14Z"}

{"id":51542420781,"serialNumber":null,"owner":null,"created":"2019-12-14T17:20:50.357Z","updated":"2019-12-14T17:20:50.357Z"}

As shown, the first two have their owner fields filled in with information, but the other has it set to NULL. The behavior I am thinking of is similar to using the strstr function to detect if the key is NULL, but rather, built into the JSON parser as a feature.

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

No branches or pull requests

1 participant