Open nlohmann opened 2 months ago
This indeed sounds like a bug. The documentation states
Discarded values in structured types are skipped. That is, the parser will behave as if the discarded value was never read.
This is true for arrays. For objects, we indeed keep the key and leave discarded
as value.
I am torn whether fixing this could be a breaking change, so I added the "please discuss" label.
Discussed in https://github.com/nlohmann/json/discussions/4336