fix: rename

fix: new jsoncpp version
This commit is contained in:
Tobias Reisinger 2019-07-29 12:10:45 +02:00
parent 8d4ad2f631
commit d1d1de221f
2 changed files with 13 additions and 4 deletions

View file

@ -4,6 +4,7 @@
#include <helpers.h>
#include <cmath>
#include <models/controller_dbo.h>
#include <fstream>
#include "api_v1_controllers.h"
using namespace api::v1;
@ -93,11 +94,19 @@ void controllers::post_discover(const HttpRequestPtr &req, std::function<void(co
}
answer_payload[payload_length] = '\0';
std::ifstream answer_payload_stream(answer_payload);
Json::Reader json_reader;
Json::CharReaderBuilder json_reader;
std::string errs;
Json::Value client_info;
json_reader.parse(answer_payload, &answer_payload[payload_length], client_info, false);
if (!Json::parseFromStream(json_reader, answer_payload_stream, &client_info, &errs))
{
// report to the user the failure and their locations in the document.
std::cout << "Failed to parse configuration\n"
<< errs;
return;
}
free(answer_payload);