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 98bbfd37998f..e8f0841d6095 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 @@ -845,7 +845,7 @@ fail: {{^isPrimitiveType}} {{#isModel}} {{#isEnum}} - {{^required}}{{{name}}} ? {{/required}}{{{name}}}_local_nonprim_enum{{^required}} : -1{{/required}}{{^-last}},{{/-last}} + {{^required}}{{{name}}} ? {{/required}}{{{name}}}_local_nonprim_enum{{^required}} : {{projectName}}_{{classVarName}}_{{enumName}}_NULL{{/required}}{{^-last}},{{/-last}} {{/isEnum}} {{^isEnum}} {{^required}}{{{name}}} ? {{/required}}{{{name}}}_local_nonprim{{^required}} : NULL{{/required}}{{^-last}},{{/-last}} @@ -875,7 +875,7 @@ fail: {{/isBoolean}} {{#isEnum}} {{#isString}} - {{^required}}{{{name}}} ? {{/required}}{{name}}Variable{{^required}} : -1{{/required}}{{^-last}},{{/-last}} + {{^required}}{{{name}}} ? {{/required}}{{name}}Variable{{^required}} : {{projectName}}_{{classVarName}}_{{enumName}}_NULL{{/required}}{{^-last}},{{/-last}} {{/isString}} {{/isEnum}} {{^isEnum}} diff --git a/samples/client/petstore/c/model/order.c b/samples/client/petstore/c/model/order.c index 734ff110252c..b18413bf6e7b 100644 --- a/samples/client/petstore/c/model/order.c +++ b/samples/client/petstore/c/model/order.c @@ -182,7 +182,7 @@ order_t *order_parseFromJSON(cJSON *orderJSON){ pet_id ? pet_id->valuedouble : 0, quantity ? quantity->valuedouble : 0, ship_date && !cJSON_IsNull(ship_date) ? strdup(ship_date->valuestring) : NULL, - status ? statusVariable : -1, + status ? statusVariable : openapi_petstore_order_STATUS_NULL, complete ? complete->valueint : 0 ); diff --git a/samples/client/petstore/c/model/pet.c b/samples/client/petstore/c/model/pet.c index 7ca8b7a422a2..b84be2a3511b 100644 --- a/samples/client/petstore/c/model/pet.c +++ b/samples/client/petstore/c/model/pet.c @@ -263,7 +263,7 @@ pet_t *pet_parseFromJSON(cJSON *petJSON){ strdup(name->valuestring), photo_urlsList, tags ? tagsList : NULL, - status ? statusVariable : -1 + status ? statusVariable : openapi_petstore_pet_STATUS_NULL ); return pet_local_var;