I want to unpack a JSON that has an optional key. When the key is present, the value may be a string or null.
I was able to achieve the optional key with "{s?:s}", but I can't unpack this when the value is null. I have tried with "{s?:s?}".
Under this line there's a test for unpacking optional key, and another for optional value, but both have the same format specifier.
So I'm confused now.
I want to unpack a JSON that has an optional key. When the key is present, the value may be a string or null. I was able to achieve the optional key with "{s?:s}", but I can't unpack this when the value is null. I have tried with "{s?:s?}".
Then I found this: https://github.com/akheron/jansson/blob/0dffb4284e7872c6e26956ad85fe127ba77220dc/test/suites/api/test_unpack.c#L379
Under this line there's a test for unpacking optional key, and another for optional value, but both have the same format specifier. So I'm confused now.