mirror of
https://github.com/OpenAPITools/openapi-generator.git
synced 2025-07-04 06:30:52 +00:00
Fix for cpp-rest-sdk-client generator producing uncompilable code if there is a "-" (or other characters like a space etc.) in a property name of an object. (#12288)
This commit is contained in:
parent
8fc85530e8
commit
c17679060b
@ -188,9 +188,9 @@ bool {{classname}}::fromJson(const web::json::value& val)
|
|||||||
const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("{{baseName}}")));
|
const web::json::value& fieldValue = val.at(utility::conversions::to_string_t(U("{{baseName}}")));
|
||||||
if(!fieldValue.is_null())
|
if(!fieldValue.is_null())
|
||||||
{
|
{
|
||||||
{{{dataType}}} refVal_{{baseName}};
|
{{{dataType}}} refVal_{{setter}};
|
||||||
ok &= ModelBase::fromJson(fieldValue, refVal_{{baseName}});
|
ok &= ModelBase::fromJson(fieldValue, refVal_{{setter}});
|
||||||
{{setter}}(refVal_{{baseName}});
|
{{setter}}(refVal_{{setter}});
|
||||||
}
|
}
|
||||||
}{{/isInherited}}{{/vars}}
|
}{{/isInherited}}{{/vars}}
|
||||||
return ok;
|
return ok;
|
||||||
@ -223,9 +223,9 @@ bool {{classname}}::fromMultiPart(std::shared_ptr<MultipartFormData> multipart,
|
|||||||
{{#vars}}
|
{{#vars}}
|
||||||
if(multipart->hasContent(utility::conversions::to_string_t(U("{{baseName}}"))))
|
if(multipart->hasContent(utility::conversions::to_string_t(U("{{baseName}}"))))
|
||||||
{
|
{
|
||||||
{{{dataType}}} refVal_{{baseName}};
|
{{{dataType}}} refVal_{{setter}};
|
||||||
ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("{{baseName}}"))), refVal_{{baseName}} );
|
ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("{{baseName}}"))), refVal_{{setter}} );
|
||||||
{{setter}}(refVal_{{baseName}});
|
{{setter}}(refVal_{{setter}});
|
||||||
}
|
}
|
||||||
{{/vars}}
|
{{/vars}}
|
||||||
return ok;
|
return ok;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user