[cpp-pistache]Add support for map (#1359)

* Add support for map
* Add support for nested maps
* Simplify Array and Map Helper
* Use const reference wherever possible
This commit is contained in:
sunn
2018-11-03 14:09:31 +01:00
committed by GitHub
parent 36991a4e14
commit f8f3a08282
21 changed files with 246 additions and 243 deletions

View File

@@ -71,7 +71,7 @@ void UserApi::create_users_with_array_input_handler(const Pistache::Rest::Reques
try {
nlohmann::json request_body = nlohmann::json::parse(request.body());
user = ModelArrayHelper::fromJson<User>(request_body);
user = ArrayHelper::fromJson<User>(request_body);
this->create_users_with_array_input(user, response);
} catch (std::runtime_error & e) {
//send a 400 error
@@ -87,7 +87,7 @@ void UserApi::create_users_with_list_input_handler(const Pistache::Rest::Request
try {
nlohmann::json request_body = nlohmann::json::parse(request.body());
user = ModelArrayHelper::fromJson<User>(request_body);
user = ArrayHelper::fromJson<User>(request_body);
this->create_users_with_list_input(user, response);
} catch (std::runtime_error & e) {
//send a 400 error