From 9825dfc735d77bab075786a4150b10a587181c05 Mon Sep 17 00:00:00 2001 From: philicious Date: Tue, 14 Jun 2016 00:13:12 +0200 Subject: [PATCH] fixed Qt5 api-body template bug with form params --- .../swagger-codegen/src/main/resources/qt5cpp/api-body.mustache | 2 +- samples/client/petstore/qt5cpp/client/SWGPetApi.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/swagger-codegen/src/main/resources/qt5cpp/api-body.mustache b/modules/swagger-codegen/src/main/resources/qt5cpp/api-body.mustache index fc69cfa4404..544706e8a4e 100644 --- a/modules/swagger-codegen/src/main/resources/qt5cpp/api-body.mustache +++ b/modules/swagger-codegen/src/main/resources/qt5cpp/api-body.mustache @@ -87,7 +87,7 @@ void HttpRequestInput input(fullPath, "{{httpMethod}}"); {{#formParams}}if ({{paramName}} != NULL) { - {{^isFile}}input.add_var("{{paramName}}", *{{paramName}});{{/isFile}}{{#isFile}}input.add_file("{{paramName}}", *{{paramName}}.local_filename, *{{paramName}}.request_filename, *{{paramName}}.mime_type);{{/isFile}} + {{^isFile}}input.add_var("{{paramName}}", *{{paramName}});{{/isFile}}{{#isFile}}input.add_file("{{paramName}}", (*{{paramName}}).local_filename, (*{{paramName}}).request_filename, (*{{paramName}}).mime_type);{{/isFile}} } {{/formParams}} diff --git a/samples/client/petstore/qt5cpp/client/SWGPetApi.cpp b/samples/client/petstore/qt5cpp/client/SWGPetApi.cpp index b5e383575be..c5ac6513dce 100644 --- a/samples/client/petstore/qt5cpp/client/SWGPetApi.cpp +++ b/samples/client/petstore/qt5cpp/client/SWGPetApi.cpp @@ -438,7 +438,7 @@ SWGPetApi::uploadFile(qint64 petId, QString* additionalMetadata, SWGHttpRequestI input.add_var("additionalMetadata", *additionalMetadata); } if (file != NULL) { - input.add_file("file", *file.local_filename, *file.request_filename, *file.mime_type); + input.add_file("file", (*file).local_filename, (*file).request_filename, (*file).mime_type); }