Skip to content

Extra backslashes in nested json #2020

Description

@machadors

There is an extra backslash when adding nested json.

This operations
json foo;
foo["key"] ="{\"hey\":\"hou\"}";
std::string result = foo.dump();

gives
result = "{\"key\":\"{\\\"hey\\\":\\\"hou\\\"}\"}"
with an extra backslashes in the nested json.

Is this a bug or there is another way to adding nested json ?

PD: This is my first ever github question, sorry in advance about format and so

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions