Skip to content

syntax error on right json string #1276

Description

@wkoroy

I've been trying to implement this solution and I have been getting the same error:

terminate called after throwing an instance of 'nlohmann::detail::parse_error'
  what():  [json.exception.parse_error.101] parse error at 97: syntax error - unexpected '}'; expected string literal

My code:



  auto s =  create_json_config(); // return content from file jsonstr.txt
   cout<<s;
   json uuid;
   
   uuid.parse(s);
    if (uuid.is_object())
    {
        auto obj = uuid.get<json::object_t>();
        for (auto& kvp : obj)
        {
            std::cout << kvp.first << ":" << kvp.second << "\n";
        }
    }

jsonstr.txt

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions