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
This commit is contained in:
Anthony Rouneau 2020-08-17 03:51:03 +02:00 committed by GitHub
parent 9a03850828
commit e26a4222c7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -48,8 +48,8 @@ fail:
return NULL; return NULL;
} }
{{classFilename}}_{{classname}}_e {{classFilename}}_{{classname}}_parseFromJSON(cJSON *{{classname}}JSON) { {{projectName}}_{{classVarName}}_{{enumName}}_e {{classFilename}}_{{classname}}_parseFromJSON(cJSON *{{classname}}JSON) {
{{classFilename}}_{{classname}}_e *{{classname}} = NULL; {{projectName}}_{{classVarName}}_{{enumName}}_e *{{classname}} = NULL;
{{#isEnum}} {{#isEnum}}
{{#isNumeric}} {{#isNumeric}}
cJSON *{{{classname}}}Var = cJSON_GetObjectItemCaseSensitive({{classname}}JSON, "{{{classname}}}"); cJSON *{{{classname}}}Var = cJSON_GetObjectItemCaseSensitive({{classname}}JSON, "{{{classname}}}");
@ -59,7 +59,7 @@ fail:
} }
{{/isNumeric}} {{/isNumeric}}
{{#isString}} {{#isString}}
{{classFilename}}_{{{classname}}}_e {{classname}}Variable; {{projectName}}_{{classVarName}}_{{enumName}}_e {{classname}}Variable;
cJSON *{{{classname}}}Var = cJSON_GetObjectItemCaseSensitive({{classname}}JSON, "{{{classname}}}"); cJSON *{{{classname}}}Var = cJSON_GetObjectItemCaseSensitive({{classname}}JSON, "{{{classname}}}");
if(!cJSON_IsString({{{classname}}}Var) || ({{{classname}}}Var->valuestring == NULL)){ if(!cJSON_IsString({{{classname}}}Var) || ({{{classname}}}Var->valuestring == NULL)){
goto end; goto end;