Bug Report Checklist
OpenAPI declaration file content or url
{
"openapi": "3.0.0",
"components": {
"schemas": {
"StringMap": {
"type": "object",
"properties": {
"zh-Hans": {
"type": "string",
"description": "Text in Chinese (Simplified)."
},
}
}
}
}
Description
Generator: cpp-restsdk-client
Produces uncompilable code if there is a "-" (or other characters like a space etc.) in a property name of an object.
if(multipart->hasContent(utility::conversions::to_string_t(U("zh-Hant"))))
{
utility::string_t refVal_zh-Hant;
ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("zh-Hant"))), refVal_zh-Hant );
setZhHant(refVal_zh-Hant);
}
Suggest a fix
#12288
Resulting cpp code looks like this:
if(multipart->hasContent(utility::conversions::to_string_t(U("zh-Hant"))))
{
utility::string_t refVal_setZhHant;
ok &= ModelBase::fromHttpContent(multipart->getContent(utility::conversions::to_string_t(U("zh-Hant"))), refVal_setZhHant );
setZhHant(refVal_setZhHant);
}
Bug Report Checklist
Compilable C++ code
OpenAPI declaration file content or url
{ "openapi": "3.0.0", "components": { "schemas": { "StringMap": { "type": "object", "properties": { "zh-Hans": { "type": "string", "description": "Text in Chinese (Simplified)." }, } } } }Description
Generator: cpp-restsdk-client
Produces uncompilable code if there is a "-" (or other characters like a space etc.) in a property name of an object.
Suggest a fix
#12288
Resulting cpp code looks like this: