'scope_plmn' key missing completely from the outer "scope" object. In this case it would be a violation of the JSON schema in this application, and hence to be rejected
'scope_plmn' key present but with an empty value part. This is perfectly legal and acceptable in the use case at hand.
It seems that json_object_get(scope_obj, "scope_plmn") returns NULL in both cases. I don't understand why. An empty object is prefectly legal, and json_object() itself returns an empty object.
I can iterate over the "scope" object using the iterator functions and then see that the "scope_plnn" key is actually present, and that it is of type JSON_OBJECT. So why does json_object_get() not simply return that object?
What is the logic here? How is the user application expected to distinguish those two cases? Any help is greatly appreciated.
I'm assuming the following JSON input:
How can I distinguish the two cases:
It seems that json_object_get(scope_obj, "scope_plmn") returns NULL in both cases. I don't understand why. An empty object is prefectly legal, and json_object() itself returns an empty object.
I can iterate over the "scope" object using the iterator functions and then see that the "scope_plnn" key is actually present, and that it is of type JSON_OBJECT. So why does json_object_get() not simply return that object?
What is the logic here? How is the user application expected to distinguish those two cases? Any help is greatly appreciated.