mirror of
https://github.com/OpenAPITools/openapi-generator.git
synced 2025-05-12 20:50:55 +00:00
Fix 7459: [Ada] wrong JSON in POST operations (#7460)
* Fix Ada client generated code to avoid having a spurious body name for parameters passed in the body * Run bin/ada-petstore.sh to update the generated Ada client samples
This commit is contained in:
parent
c73118524c
commit
2b2b85eec7
@ -24,7 +24,7 @@ package body {{package}}.Clients is
|
||||
{{/hasMore}}{{/produces}}));{{/hasProduces}}{{#hasBodyParam}}
|
||||
Client.Initialize (Req, ({{#hasConsumes}}{{#consumes}}{{#vendorExtensions.x-has-uniq-consumes}}1 -> {{/vendorExtensions.x-has-uniq-consumes}}Swagger.Clients.{{adaMediaType}}{{#hasMore}},
|
||||
{{/hasMore}}{{/consumes}}{{/hasConsumes}}{{^hasConsumes}}1 => Swagger.Clients.APPLICATION_JSON{{/hasConsumes}}));{{#bodyParams}}{{#vendorExtensions.x-is-model-type}}
|
||||
{{package}}.Models.Serialize (Req.Stream, "{{baseName}}", {{paramName}});{{/vendorExtensions.x-is-model-type}}{{^vendorExtensions.x-is-model-type}}{{#isFile}}
|
||||
{{package}}.Models.Serialize (Req.Stream, "", {{paramName}});{{/vendorExtensions.x-is-model-type}}{{^vendorExtensions.x-is-model-type}}{{#isFile}}
|
||||
-- TODO: Serialize (Req.Stream, "{{basename}}", {{paramName}});{{/isFile}}{{^isFile}}{{^isLong}}
|
||||
Req.Stream.Write_Entity ("{{baseName}}", {{paramName}});{{/isLong}}{{#isLong}}
|
||||
Serialize (Req.Stream, "{{baseName}}", {{paramName}});{{/isLong}}{{/isFile}}{{/vendorExtensions.x-is-model-type}}{{/bodyParams}}{{/hasBodyParam}}{{#hasFormParams}}
|
||||
|
@ -1 +1 @@
|
||||
2.3.0-SNAPSHOT
|
||||
2.3.1
|
@ -4,7 +4,7 @@
|
||||
-- OpenAPI spec version: 1.0.0
|
||||
-- Contact: apiteam@swagger.io
|
||||
--
|
||||
-- NOTE: This package is auto generated by the swagger code generator 2.3.0-SNAPSHOT.
|
||||
-- NOTE: This package is auto generated by the swagger code generator 2.3.1.
|
||||
-- https://github.com/swagger-api/swagger-codegen.git
|
||||
-- Do not edit the class manually.
|
||||
with Swagger.Streams;
|
||||
@ -21,7 +21,7 @@ package body Samples.Petstore.Clients is
|
||||
Swagger.Clients.APPLICATION_JSON));
|
||||
Client.Initialize (Req, (Swagger.Clients.APPLICATION_JSON,
|
||||
Swagger.Clients.APPLICATION_XML));
|
||||
Samples.Petstore.Models.Serialize (Req.Stream, "body", P_Body);
|
||||
Samples.Petstore.Models.Serialize (Req.Stream, "", P_Body);
|
||||
|
||||
URI.Set_Path ("/pet");
|
||||
Client.Call (Swagger.Clients.POST, URI, Req);
|
||||
@ -107,7 +107,7 @@ package body Samples.Petstore.Clients is
|
||||
Swagger.Clients.APPLICATION_JSON));
|
||||
Client.Initialize (Req, (Swagger.Clients.APPLICATION_JSON,
|
||||
Swagger.Clients.APPLICATION_XML));
|
||||
Samples.Petstore.Models.Serialize (Req.Stream, "body", P_Body);
|
||||
Samples.Petstore.Models.Serialize (Req.Stream, "", P_Body);
|
||||
|
||||
URI.Set_Path ("/pet");
|
||||
Client.Call (Swagger.Clients.PUT, URI, Req);
|
||||
@ -215,7 +215,7 @@ package body Samples.Petstore.Clients is
|
||||
Client.Set_Accept ((Swagger.Clients.APPLICATION_XML,
|
||||
Swagger.Clients.APPLICATION_JSON));
|
||||
Client.Initialize (Req, (1 => Swagger.Clients.APPLICATION_JSON));
|
||||
Samples.Petstore.Models.Serialize (Req.Stream, "body", P_Body);
|
||||
Samples.Petstore.Models.Serialize (Req.Stream, "", P_Body);
|
||||
|
||||
URI.Set_Path ("/store/order");
|
||||
Client.Call (Swagger.Clients.POST, URI, Req, Reply);
|
||||
@ -233,7 +233,7 @@ package body Samples.Petstore.Clients is
|
||||
Client.Set_Accept ((Swagger.Clients.APPLICATION_XML,
|
||||
Swagger.Clients.APPLICATION_JSON));
|
||||
Client.Initialize (Req, (1 => Swagger.Clients.APPLICATION_JSON));
|
||||
Samples.Petstore.Models.Serialize (Req.Stream, "body", P_Body);
|
||||
Samples.Petstore.Models.Serialize (Req.Stream, "", P_Body);
|
||||
|
||||
URI.Set_Path ("/user");
|
||||
Client.Call (Swagger.Clients.POST, URI, Req);
|
||||
@ -249,7 +249,7 @@ package body Samples.Petstore.Clients is
|
||||
Client.Set_Accept ((Swagger.Clients.APPLICATION_XML,
|
||||
Swagger.Clients.APPLICATION_JSON));
|
||||
Client.Initialize (Req, (1 => Swagger.Clients.APPLICATION_JSON));
|
||||
Samples.Petstore.Models.Serialize (Req.Stream, "body", P_Body);
|
||||
Samples.Petstore.Models.Serialize (Req.Stream, "", P_Body);
|
||||
|
||||
URI.Set_Path ("/user/createWithArray");
|
||||
Client.Call (Swagger.Clients.POST, URI, Req);
|
||||
@ -265,7 +265,7 @@ package body Samples.Petstore.Clients is
|
||||
Client.Set_Accept ((Swagger.Clients.APPLICATION_XML,
|
||||
Swagger.Clients.APPLICATION_JSON));
|
||||
Client.Initialize (Req, (1 => Swagger.Clients.APPLICATION_JSON));
|
||||
Samples.Petstore.Models.Serialize (Req.Stream, "body", P_Body);
|
||||
Samples.Petstore.Models.Serialize (Req.Stream, "", P_Body);
|
||||
|
||||
URI.Set_Path ("/user/createWithList");
|
||||
Client.Call (Swagger.Clients.POST, URI, Req);
|
||||
@ -346,7 +346,7 @@ package body Samples.Petstore.Clients is
|
||||
Client.Set_Accept ((Swagger.Clients.APPLICATION_XML,
|
||||
Swagger.Clients.APPLICATION_JSON));
|
||||
Client.Initialize (Req, (1 => Swagger.Clients.APPLICATION_JSON));
|
||||
Samples.Petstore.Models.Serialize (Req.Stream, "body", P_Body);
|
||||
Samples.Petstore.Models.Serialize (Req.Stream, "", P_Body);
|
||||
|
||||
URI.Set_Path ("/user/{username}");
|
||||
URI.Set_Path_Param ("username", Username);
|
||||
|
@ -4,7 +4,7 @@
|
||||
-- OpenAPI spec version: 1.0.0
|
||||
-- Contact: apiteam@swagger.io
|
||||
--
|
||||
-- NOTE: This package is auto generated by the swagger code generator 2.3.0-SNAPSHOT.
|
||||
-- NOTE: This package is auto generated by the swagger code generator 2.3.1.
|
||||
-- https://github.com/swagger-api/swagger-codegen.git
|
||||
-- Do not edit the class manually.
|
||||
with Samples.Petstore.Models;
|
||||
|
@ -4,7 +4,7 @@
|
||||
-- OpenAPI spec version: 1.0.0
|
||||
-- Contact: apiteam@swagger.io
|
||||
--
|
||||
-- NOTE: This package is auto generated by the swagger code generator 2.3.0-SNAPSHOT.
|
||||
-- NOTE: This package is auto generated by the swagger code generator 2.3.1.
|
||||
-- https://github.com/swagger-api/swagger-codegen.git
|
||||
-- Do not edit the class manually.
|
||||
|
||||
|
@ -4,7 +4,7 @@
|
||||
-- OpenAPI spec version: 1.0.0
|
||||
-- Contact: apiteam@swagger.io
|
||||
--
|
||||
-- NOTE: This package is auto generated by the swagger code generator 2.3.0-SNAPSHOT.
|
||||
-- NOTE: This package is auto generated by the swagger code generator 2.3.1.
|
||||
-- https://github.com/swagger-api/swagger-codegen.git
|
||||
-- Do not edit the class manually.
|
||||
with Swagger.Streams;
|
||||
|
Loading…
x
Reference in New Issue
Block a user