Replies: 1 comment 5 replies
-
j.contains("company") && j["company"].is_null() |
Beta Was this translation helpful? Give feedback.
5 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
A sample JSON object like this can validly contain null values:
{
"firstName": "Bellina",
"lastName": "Cornewell",
"company": null,
"age": 18
}
But the contains() method always returns false for fields of null value. How can I detect null fields in a parsed object?
doing obj["company"] will not tell me anything, because it will create the field if it doesn't already exist
Beta Was this translation helpful? Give feedback.
All reactions