mirror of
https://github.com/valitydev/openapi-generator.git
synced 2024-11-06 18:45:23 +00:00
* Ada generator generates "=>" (correct syntax) instead of "->". Fixes #7450 * Updated the Ada petstore samples * Committing "VERSION" file and the rest of the petstore samples
This commit is contained in:
parent
fe2a443394
commit
43f0e86923
@ -22,7 +22,7 @@ package body {{package}}.Clients is
|
||||
{{#hasProduces}}
|
||||
Client.Set_Accept (({{#produces}}{{#vendorExtensions.x-has-uniq-produces}}1 => {{/vendorExtensions.x-has-uniq-produces}}Swagger.Clients.{{adaMediaType}}{{#hasMore}},
|
||||
{{/hasMore}}{{/produces}}));{{/hasProduces}}{{#hasBodyParam}}
|
||||
Client.Initialize (Req, ({{#hasConsumes}}{{#consumes}}{{#vendorExtensions.x-has-uniq-consumes}}1 -> {{/vendorExtensions.x-has-uniq-consumes}}Swagger.Clients.{{adaMediaType}}{{#hasMore}},
|
||||
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, "", {{paramName}});{{/vendorExtensions.x-is-model-type}}{{^vendorExtensions.x-is-model-type}}{{#isFile}}
|
||||
-- TODO: Serialize (Req.Stream, "{{basename}}", {{paramName}});{{/isFile}}{{^isFile}}{{^isLong}}
|
||||
|
43
samples/client/petstore/ada/src/samples-petstore-client.adb
Normal file
43
samples/client/petstore/ada/src/samples-petstore-client.adb
Normal file
@ -0,0 +1,43 @@
|
||||
with Samples.Petstore.Clients;
|
||||
with Samples.Petstore.Models;
|
||||
with Swagger;
|
||||
with Util.Http.Clients.Curl;
|
||||
with Ada.Text_IO;
|
||||
with Ada.Command_Line;
|
||||
with Ada.Calendar.Formatting;
|
||||
with Ada.Exceptions;
|
||||
procedure Samples.Petstore.Client is
|
||||
|
||||
use Ada.Text_IO;
|
||||
|
||||
procedure Usage;
|
||||
|
||||
Server : constant Swagger.UString := Swagger.To_UString ("http://localhost:8080/v2");
|
||||
Arg_Count : constant Natural := Ada.Command_Line.Argument_Count;
|
||||
Arg : Positive := 1;
|
||||
|
||||
procedure Usage is
|
||||
begin
|
||||
Put_Line ("Usage: Petstore {params}...");
|
||||
end Usage;
|
||||
|
||||
begin
|
||||
if Arg_Count <= 1 then
|
||||
Usage;
|
||||
return;
|
||||
end if;
|
||||
Util.Http.Clients.Curl.Register;
|
||||
declare
|
||||
Command : constant String := Ada.Command_Line.Argument (Arg);
|
||||
Item : constant String := Ada.Command_Line.Argument (Arg + 1);
|
||||
C : Samples.Petstore.Clients.Client_Type;
|
||||
begin
|
||||
C.Set_Server (Server);
|
||||
Arg := Arg + 2;
|
||||
|
||||
exception
|
||||
when E : Constraint_Error =>
|
||||
Put_Line ("Constraint error raised: " & Ada.Exceptions.Exception_Message (E));
|
||||
|
||||
end;
|
||||
end Samples.Petstore.Client;
|
Loading…
Reference in New Issue
Block a user