Skip to content

Commit

Permalink
[C++][Restbed] Fix inconsistent get_parameter in restbed
Browse files Browse the repository at this point in the history
for some reason std::string is returned by value when others are returned by reference
  • Loading branch information
muttleyxd committed May 23, 2019
1 parent f0ceb01 commit 609d0a1
Showing 1 changed file with 36 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,13 @@ void {{classname}}{{vendorExtensions.x-codegen-resourceName}}Resource::{{httpMet
// Getting the path params
{{#pathParams}}
{{#isPrimitiveType}}
{{^isString}}
{{{dataType}}} {{{paramName}}};
request->get_path_parameter("{{paramName}}", {{{paramName}}}, {{{defaultValue}}});
{{/isString}}
{{#isString}}
const {{{dataType}}} {{{paramName}}} = request->get_path_parameter("{{paramName}}", {{{defaultValue}}});
{{/isString}}
{{/isPrimitiveType}}
{{/pathParams}}
{{/hasPathParams}}
Expand All @@ -101,7 +107,13 @@ void {{classname}}{{vendorExtensions.x-codegen-resourceName}}Resource::{{httpMet
// Getting the query params
{{#queryParams}}
{{#isPrimitiveType}}
{{^isString}}
{{{dataType}}} {{{paramName}}};
request->get_query_parameter("{{paramName}}", {{{paramName}}}, {{{defaultValue}}});
{{/isString}}
{{#isString}}
const {{{dataType}}} {{{paramName}}} = request->get_query_parameter("{{paramName}}", {{{defaultValue}}});
{{/isString}}
{{/isPrimitiveType}}
{{/queryParams}}
{{/hasQueryParams}}
Expand All @@ -110,7 +122,13 @@ void {{classname}}{{vendorExtensions.x-codegen-resourceName}}Resource::{{httpMet
// Getting the headers
{{#headerParams}}
{{#isPrimitiveType}}
{{^isString}}
{{{dataType}}} {{{paramName}}};
request->get_header("{{paramName}}", {{{paramName}}}, {{{defaultValue}}});
{{/isString}}
{{#isString}}
const {{{dataType}}} {{{paramName}}} = request->get_header("{{paramName}}", {{{defaultValue}}});
{{/isString}}
{{/isPrimitiveType}}
{{/headerParams}}
{{/hasHeaderParams}}
Expand Down Expand Up @@ -165,7 +183,13 @@ void {{classname}}{{vendorExtensions.x-codegen-resourceName}}Resource::{{httpMet
// Getting the path params
{{#pathParams}}
{{#isPrimitiveType}}
{{^isString}}
{{{dataType}}} {{{paramName}}};
request->get_path_parameter("{{paramName}}", {{{paramName}}}, {{{defaultValue}}});
{{/isString}}
{{#isString}}
const {{{dataType}}} {{{paramName}}} = request->get_path_parameter("{{paramName}}", {{{defaultValue}}});
{{/isString}}
{{/isPrimitiveType}}
{{/pathParams}}
{{/hasPathParams}}
Expand All @@ -174,7 +198,13 @@ void {{classname}}{{vendorExtensions.x-codegen-resourceName}}Resource::{{httpMet
// Getting the query params
{{#queryParams}}
{{#isPrimitiveType}}
{{^isString}}
{{{dataType}}} {{{paramName}}};
request->get_query_parameter("{{paramName}}", {{{paramName}}}, {{{defaultValue}}});
{{/isString}}
{{#isString}}
const {{{dataType}}} {{{paramName}}} = request->get_query_parameter("{{paramName}}", {{{defaultValue}}});
{{/isString}}
{{/isPrimitiveType}}
{{/queryParams}}
{{/hasQueryParams}}
Expand All @@ -183,7 +213,13 @@ void {{classname}}{{vendorExtensions.x-codegen-resourceName}}Resource::{{httpMet
// Getting the headers
{{#headerParams}}
{{#isPrimitiveType}}
{{^isString}}
{{{dataType}}} {{{paramName}}};
request->get_header("{{paramName}}", {{{paramName}}}, {{{defaultValue}}});
{{/isString}}
{{#isString}}
const {{{dataType}}} {{{paramName}}} = request->get_header("{{paramName}}", {{{defaultValue}}});
{{/isString}}
{{/isPrimitiveType}}
{{/headerParams}}
{{/hasHeaderParams}}
Expand Down

0 comments on commit 609d0a1

Please sign in to comment.