From e26a4222c70efd74d5775562f68f253748c49a68 Mon Sep 17 00:00:00 2001 From: Anthony Rouneau Date: Mon, 17 Aug 2020 03:51:03 +0200 Subject: [PATCH] C-Libcurl client: fix enum model generation (#5604) The "..._parseFromJSON" template was buggy because the name of the _e type used was not the same than the generated. See the first argument of "..._convertToJSON" to see that the _e type used there was not the same --- .../src/main/resources/C-libcurl/model-body.mustache | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/C-libcurl/model-body.mustache b/modules/openapi-generator/src/main/resources/C-libcurl/model-body.mustache index 06f23c4d942..8547193db45 100644 --- a/modules/openapi-generator/src/main/resources/C-libcurl/model-body.mustache +++ b/modules/openapi-generator/src/main/resources/C-libcurl/model-body.mustache @@ -48,8 +48,8 @@ fail: return NULL; } -{{classFilename}}_{{classname}}_e {{classFilename}}_{{classname}}_parseFromJSON(cJSON *{{classname}}JSON) { - {{classFilename}}_{{classname}}_e *{{classname}} = NULL; +{{projectName}}_{{classVarName}}_{{enumName}}_e {{classFilename}}_{{classname}}_parseFromJSON(cJSON *{{classname}}JSON) { + {{projectName}}_{{classVarName}}_{{enumName}}_e *{{classname}} = NULL; {{#isEnum}} {{#isNumeric}} cJSON *{{{classname}}}Var = cJSON_GetObjectItemCaseSensitive({{classname}}JSON, "{{{classname}}}"); @@ -59,7 +59,7 @@ fail: } {{/isNumeric}} {{#isString}} - {{classFilename}}_{{{classname}}}_e {{classname}}Variable; + {{projectName}}_{{classVarName}}_{{enumName}}_e {{classname}}Variable; cJSON *{{{classname}}}Var = cJSON_GetObjectItemCaseSensitive({{classname}}JSON, "{{{classname}}}"); if(!cJSON_IsString({{{classname}}}Var) || ({{{classname}}}Var->valuestring == NULL)){ goto end;