From 4bd8fc6e8a9206280e618b686f13306947bf841a Mon Sep 17 00:00:00 2001 From: Stephane Carrez Date: Sun, 28 Jan 2018 07:54:36 +0100 Subject: [PATCH] Fix 7511: [Ada] Client call is not correct with multiple parameters and application/x-www-urlencoded (#7512) * Fix calling the 'Call' procedure to submit the request for the Ada client when a request has form parameters * Rebuild the files by running bin/ada-petstore.sh --- .../src/main/resources/Ada/client-body.mustache | 2 +- .../petstore/ada/src/client/samples-petstore-clients.adb | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/swagger-codegen/src/main/resources/Ada/client-body.mustache b/modules/swagger-codegen/src/main/resources/Ada/client-body.mustache index d4a3613baeb..2b20aed1165 100644 --- a/modules/swagger-codegen/src/main/resources/Ada/client-body.mustache +++ b/modules/swagger-codegen/src/main/resources/Ada/client-body.mustache @@ -39,7 +39,7 @@ package body {{package}}.Clients is URI.Add_Param ("{{baseName}}", {{paramName}});{{/isDateTime}}{{/isQueryParam}}{{/queryParams}} URI.Set_Path ("{{path}}");{{#pathParams}} URI.Set_Path_Param ("{{baseName}}", {{^isString}}Swagger.To_String ({{/isString}}{{paramName}}{{^isString}}){{/isString}});{{/pathParams}} - Client.Call (Swagger.Clients.{{httpMethod}}, URI{{#hasBodyParam}}, Req{{/hasBodyParam}}{{#returnType}}, Reply{{/returnType}});{{#returnType}}{{#vendorExtensions.x-codegen-response.isString}} + Client.Call (Swagger.Clients.{{httpMethod}}, URI{{#hasBodyParam}}, Req{{/hasBodyParam}}{{#hasFormParams}}, Req{{/hasFormParams}}{{#returnType}}, Reply{{/returnType}});{{#returnType}}{{#vendorExtensions.x-codegen-response.isString}} Swagger.Streams.Deserialize (Reply, "", Result);{{/vendorExtensions.x-codegen-response.isString}}{{^vendorExtensions.x-codegen-response.isString}}{{#returnTypeIsPrimitive}} Swagger.Streams.Deserialize (Reply, "", Result);{{/returnTypeIsPrimitive}}{{^returnTypeIsPrimitive}} {{package}}.Models.Deserialize (Reply, "", Result);{{/returnTypeIsPrimitive}}{{/vendorExtensions.x-codegen-response.isString}}{{/returnType}} diff --git a/samples/client/petstore/ada/src/client/samples-petstore-clients.adb b/samples/client/petstore/ada/src/client/samples-petstore-clients.adb index 312afcab926..43fef8ce345 100644 --- a/samples/client/petstore/ada/src/client/samples-petstore-clients.adb +++ b/samples/client/petstore/ada/src/client/samples-petstore-clients.adb @@ -130,7 +130,7 @@ package body Samples.Petstore.Clients is URI.Set_Path ("/pet/{petId}"); URI.Set_Path_Param ("petId", Swagger.To_String (Pet_Id)); - Client.Call (Swagger.Clients.POST, URI); + Client.Call (Swagger.Clients.POST, URI, Req); end Update_Pet_With_Form; -- uploads an image @@ -151,7 +151,7 @@ package body Samples.Petstore.Clients is URI.Set_Path ("/pet/{petId}/uploadImage"); URI.Set_Path_Param ("petId", Swagger.To_String (Pet_Id)); - Client.Call (Swagger.Clients.POST, URI, Reply); + Client.Call (Swagger.Clients.POST, URI, Req, Reply); Samples.Petstore.Models.Deserialize (Reply, "", Result); end Upload_File;