Skip to content

Commit

Permalink
C-Libcurl client: fix enum model generation (OpenAPITools#5604)
Browse files Browse the repository at this point in the history
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
  • Loading branch information
Angeall authored Aug 17, 2020
1 parent 9a03850 commit e26a422
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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}}}");
Expand All @@ -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;
Expand Down

0 comments on commit e26a422

Please sign in to comment.