Skip to content

Commit 9cb54aa

Browse files
BiekerUdanryanhulsker
authored andcommitted
fix(c): Remove duplicate code generation for UUID path parameters
The C generator was generating duplicate path parameter handling code when a parameter had format: uuid. This occurred because UUID parameters have both isString=true and isUuid=true flags set, causing both the {{#isString}} and {{#isUuid}} template blocks to execute. The duplicate {{#isUuid}} block has been removed since it generated identical code to the {{#isString}} block. This makes UUID parameters consistent with email parameters, which already work this way (isEmail=true and isString=true, but only use the {{#isString}} block). The generated code now compiles successfully without duplicate variable declarations.
1 parent 7ce0096 commit 9cb54aa

File tree

1 file changed

+0
-9
lines changed

1 file changed

+0
-9
lines changed

modules/openapi-generator/src/main/resources/C-libcurl/api-body.mustache

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -188,15 +188,6 @@ end:
188188

189189
localVarPath = strReplace(localVarPath, localVarToReplace_{{paramName}}, {{^isEnum}}{{paramName}}{{/isEnum}}{{#isEnum}}{{{operationId}}}_{{enumName}}_ToString({{paramName}}){{/isEnum}});
190190
{{/isString}}
191-
{{#isUuid}}
192-
if({{paramName}} == NULL) {
193-
goto end;
194-
}
195-
char* localVarToReplace_{{paramName}} = malloc(sizeOfPathParams_{{paramName}});
196-
sprintf(localVarToReplace_{{paramName}}, "{%s}", "{{baseName}}");
197-
198-
localVarPath = strReplace(localVarPath, localVarToReplace_{{paramName}}, {{paramName}});
199-
{{/isUuid}}
200191
{{/pathParams}}
201192

202193

0 commit comments

Comments
 (0)