You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
strangely, this code doesn't work and I can't find out what I'm doing wrong....
nlohmann::json out;
out[accessTokenField] = (const string&)accessToken; // key and value std::strings
std::string tmp1 = out[accessTokenField]; // this works
std::string dump = out.dump(); // 'dump' is - {"accessToken": "b9c6f71f-0a10-4025-9628"}
nlohmann::json in;
in.parse(dump);
std::string tmp2 = in[accessTokenField]; // this fails!! error message- "type must be string, but is null"
update: using the static json::parse method works fine-
.
.
nlohmann::json in;
in = nlohmann::json::parse(dump);
std::string tmp2 = in[accessTokenField];
The text was updated successfully, but these errors were encountered:
Hi,
strangely, this code doesn't work and I can't find out what I'm doing wrong....
nlohmann::json out;
out[accessTokenField] = (const string&)accessToken; // key and value std::strings
std::string tmp1 = out[accessTokenField]; // this works
std::string dump = out.dump(); // 'dump' is - {"accessToken": "b9c6f71f-0a10-4025-9628"}
nlohmann::json in;
in.parse(dump);
std::string tmp2 = in[accessTokenField]; // this fails!! error message- "type must be string, but is null"
update: using the static json::parse method works fine-
.
.
nlohmann::json in;
in = nlohmann::json::parse(dump);
std::string tmp2 = in[accessTokenField];
The text was updated successfully, but these errors were encountered: