mirror of
https://github.com/nlohmann/json.git
synced 2026-11-02 19:05:35 +00:00
#5990 dropped the found flag from diagnostics(), reasoning that a value value_path() does not find leaves no tokens, like the root. But the node of a value that is no longer part of the document still holds the bytes it had in the source, so with JSON_DIAGNOSTICS and JSON_DIAGNOSTIC_POSITIONS its exceptions gained "(bytes 1-4)" for text that is no longer there. The test #5997 added for exactly this case (unit-json_view_positions.cpp, "views of values that are no longer part of the document") has failed on develop since both were merged. Restore the flag: a value that is not found gets no context, the root keeps its byte range. Signed-off-by: Niels Lohmann <mail@nlohmann.me>