From 10d5d27a7c3bcad00ab7522b256a54710033c094 Mon Sep 17 00:00:00 2001 From: Hui Yu Date: Sun, 1 Mar 2020 10:54:53 +0800 Subject: [PATCH] [C-libcurl] The name in API parameter should not be escaped even though it includes a C key word. (#5487) --- .../src/main/resources/C-libcurl/api-body.mustache | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/C-libcurl/api-body.mustache b/modules/openapi-generator/src/main/resources/C-libcurl/api-body.mustache index 6b38e15a1955..6180ad435d0f 100644 --- a/modules/openapi-generator/src/main/resources/C-libcurl/api-body.mustache +++ b/modules/openapi-generator/src/main/resources/C-libcurl/api-body.mustache @@ -120,7 +120,7 @@ {{#isPrimitiveType}}{{#isNumber}}{{{dataType}}}{{/isNumber}}{{#isLong}}{{{dataType}}}{{/isLong}}{{#isInteger}}{{{dataType}}}{{/isInteger}}{{#isDouble}}{{{dataType}}}{{/isDouble}}{{#isFloat}}{{{dataType}}}{{/isFloat}}{{#isBoolean}}{{dataType}}{{/isBoolean}}{{#isEnum}}{{#isString}}{{{baseName}}}_e{{/isString}}{{/isEnum}}{{^isEnum}}{{#isString}}{{{dataType}}} *{{/isString}}{{/isEnum}}{{#isByteArray}}{{{dataType}}}{{/isByteArray}}{{#isDate}}{{{dataType}}}{{/isDate}}{{#isDateTime}}{{{dataType}}}{{/isDateTime}}{{#isFile}}{{{dataType}}}{{/isFile}}{{/isPrimitiveType}}{{^isPrimitiveType}}{{#isModel}}{{#isEnum}}{{datatypeWithEnum}}_e{{/isEnum}}{{^isEnum}}{{{dataType}}}_t *{{/isEnum}}{{/isModel}}{{^isModel}}{{#isEnum}}{{datatypeWithEnum}}_e{{/isEnum}}{{/isModel}}{{#isUuid}}{{dataType}} *{{/isUuid}}{{#isEmail}}{{dataType}}{{/isEmail}}{{/isPrimitiveType}} valueHeader_{{{paramName}}}; keyValuePair_t *keyPairHeader_{{paramName}} = 0; if ({{paramName}}) { - keyHeader_{{{paramName}}} = strdup("{{{paramName}}}"); + keyHeader_{{{paramName}}} = strdup("{{{baseName}}}"); valueHeader_{{{paramName}}} = {{#isString}}{{^isEnum}}strdup({{/isEnum}}{{/isString}}({{{paramName}}}){{#isString}}{{^isEnum}}){{/isEnum}}{{/isString}}; keyPairHeader_{{paramName}} = keyValuePair_create(keyHeader_{{{paramName}}}, {{#isEnum}}(void *){{/isEnum}}{{^isString}}&{{/isString}}valueHeader_{{{paramName}}}); list_addElement(localVarHeaderParameters,keyPairHeader_{{paramName}}); @@ -164,13 +164,13 @@ if ({{paramName}} != NULL) { {{#isFile}} - keyForm_{{paramName}} = strdup("{{{paramName}}}"); + keyForm_{{paramName}} = strdup("{{{baseName}}}"); valueForm_{{paramName}} = {{paramName}}; keyPairForm_{{paramName}} = keyValuePair_create(keyForm_{{paramName}}, &valueForm_{{paramName}}); list_addElement(localVarFormParameters,keyPairForm_{{paramName}}); //file adding {{/isFile}} {{^isFile}} - keyForm_{{paramName}} = strdup("{{{paramName}}}"); + keyForm_{{paramName}} = strdup("{{{baseName}}}"); valueForm_{{paramName}} = {{#isString}}{{^isEnum}}strdup({{/isEnum}}{{/isString}}({{{paramName}}}){{#isString}}{{^isEnum}}){{/isEnum}}{{/isString}}; keyPairForm_{{paramName}} = keyValuePair_create(keyForm_{{paramName}},{{#isString}}{{#isEnum}}(void *){{/isEnum}}{{/isString}}{{^isString}}&{{/isString}}valueForm_{{paramName}}); list_addElement(localVarFormParameters,keyPairForm_{{paramName}});