-
-
Notifications
You must be signed in to change notification settings - Fork 6.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* Ada generator generates "=>" (correct syntax) instead of "->". Fixes #7450 * Updated the Ada petstore samples * Committing "VERSION" file and the rest of the petstore samples
- Loading branch information
1 parent
fe2a443
commit 43f0e86
Showing
2 changed files
with
44 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
43 changes: 43 additions & 0 deletions
43
samples/client/petstore/ada/src/samples-petstore-client.adb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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; |