forked from loafle/openapi-generator-original
[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:
committed by
sunn
parent
eca8ec3cf8
commit
4d285939a6
@@ -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);
|
||||
|
||||
@@ -1 +1 @@
|
||||
4.0.3-SNAPSHOT
|
||||
4.1.0-SNAPSHOT
|
||||
Reference in New Issue
Block a user