1
0
mirror of https://github.com/nlohmann/json.git synced 2025-07-28 12:02:00 +03:00

🐛 proper JSON Pointer escape in diagnostic messages

This commit is contained in:
Niels Lohmann
2021-01-16 15:33:05 +01:00
parent 7633a21e6c
commit e9d641130d
5 changed files with 252 additions and 199 deletions

View File

@ -8651,7 +8651,7 @@ class basic_json
for (auto it = source.cbegin(); it != source.cend(); ++it)
{
// escape the key name to be used in a JSON patch
const auto key = json_pointer::escape(it.key());
const auto key = detail::escape(it.key());
if (target.find(it.key()) != target.end())
{
@ -8675,7 +8675,7 @@ class basic_json
if (source.find(it.key()) == source.end())
{
// found a key that is not in this -> add it
const auto key = json_pointer::escape(it.key());
const auto key = detail::escape(it.key());
result.push_back(
{
{"op", "add"}, {"path", path + "/" + key},