[C++][Pistache] Do not use JSON for primitive types in request body (#3509)

* [C++][Pistache] Do not use JSON for primitive types in request body

Request body can contain any input, simple strings, CSV text or something else

* [C++][Pistache] Update Petstore sample version
This commit is contained in:
Mateusz Szychowski (Muttley)
2019-08-01 13:49:17 +02:00
committed by sunn
parent eca8ec3cf8
commit 4d285939a6
2 changed files with 6 additions and 1 deletions

View File

@@ -70,7 +70,12 @@ void {{classname}}::{{operationIdSnakeCase}}_handler(const Pistache::Rest::Reque
try {
{{#hasBodyParam}}
{{#bodyParam}}
{{^isPrimitiveType}}
nlohmann::json::parse(request.body()).get_to({{paramName}});
{{/isPrimitiveType}}
{{#isPrimitiveType}}
{{paramName}} = request.body();
{{/isPrimitiveType}}
{{/bodyParam}}
{{/hasBodyParam}}
this->{{operationIdSnakeCase}}({{#allParams}}{{paramName}}{{#hasMore}}, {{/hasMore}}{{/allParams}}{{#hasParams}}, {{/hasParams}}response);

View File

@@ -1 +1 @@
4.0.3-SNAPSHOT
4.1.0-SNAPSHOT