mirror of
https://github.com/OpenAPITools/openapi-generator.git
synced 2025-12-19 19:17:05 +00:00
[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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user