Closed hugoam closed 6 years ago
I have an example use case if you don't see why a user could possibly need this : When deserializing the delta values of a c++ object from a json representation (by which I mean, only what has changed), a null value for the key would mean that the value needs to be set to null, and an absence of key would mean that the value is not set. Currently I believe this library doesn't provide a way to differentiate between the two.
You could use .object_items().count(key)
It seems like there is no way to check if a json object contains a given key. The only way, if I'm not mistaken, is to call
operator[]
and check the returned object for null, however this will not produce the appropriate behavior if the object actually contains a null value for this key (in which case there is not way to verify if the key is present in the json or not). It would be nice if there was something like ahas_key()
function ? Happy to be corrected if I missed something.