basic_json::operator[key] and basic_json::value(key) return different values #4626
Labels
documentation
solution: proposed fix
a fix for the issue has been proposed and waits for confirmation
Milestone
Description
When parsing the following json,
operator[key]
andvalue(key)
return different results despite 'key' being a valid field.In this case
j["array"][0]["id"] != j["array"][0].value("id",0)
.Reproduction steps
See minimal example below.
Expected vs. actual results
If a key exists in a json object, I would expect
j[key]
to return the same value asj.value(key, default)
.Minimal code example
Error messages
Compiler and operating system
msvc (VS2022), windows 11
Library version
json-3.11.3
Validation
develop
branch is used.The text was updated successfully, but these errors were encountered: