Hi, Feature request: I would like the JSON parse to inform me that duplicate keys were encountered. I believe they are currently silently handled (with a last-one-wins strategy). Thanks, John Abbott
On 6/4/24 12:14, John Abbott via Boost wrote:
Hi,
Feature request:
I would like the JSON parse to inform me that duplicate keys were encountered. I believe they are currently silently handled (with a last-one-wins strategy).
You should probably create an issue for Boost.JSON here: https://github.com/boostorg/json/issues BTW, there are these issues that might be related: https://github.com/boostorg/json/issues/127 https://github.com/boostorg/json/issues/842
On Jun 4, 2024, at 2:14 AM, John Abbott via Boost
Hi,
Feature request:
I would like the JSON parse to inform me that duplicate keys were encountered. I believe they are currently silently handled (with a last-one-wins strategy).
Thanks, John Abbott
As a data point, I use the technique described here (a custom parsing hook) to find duplicate keys when parsing JSON using Python. https://stackoverflow.com/questions/14902299/json-loads-allows-duplicate-key... — Marshall
вт, 4 июн. 2024 г. в 17:43, Marshall Clow via Boost
As a data point, I use the technique described here (a custom parsing hook) to find duplicate keys when parsing JSON using Python.
https://stackoverflow.com/questions/14902299/json-loads-allows-duplicate-key...
You kinda can do this with Boost.JSON using basic_parser with a custom handler: https://www.boost.org/doc/libs/release/libs/json/doc/html/json/ref/boost__js... The main issue is that it's not exactly trivial to use currently, as the default handler is not a part of the public API. If it was, you'd be able to do this: https://godbolt.org/z/hn6dKzqGM
participants (4)
-
abbott@dima.unige.it
-
Andrey Semashev
-
Marshall Clow
-
Дмитрий Архипов