Skip to content

Commit

Permalink
Regenerate all clients based on OAG 7.4.0 .
Browse files Browse the repository at this point in the history
  • Loading branch information
cliffano committed Mar 13, 2024
1 parent 44e3e36 commit 0aa46d0
Show file tree
Hide file tree
Showing 921 changed files with 14,102 additions and 13,438 deletions.
2 changes: 2 additions & 0 deletions clients/ada-server/generated/.openapi-generator/FILES
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ src/-server.adb
src/-servers.adb
src/-servers.ads
src/.ads
src/aws/_aws.adb
src/ews/_ews.adb
src/model/-models.adb
src/model/-models.ads
src/server/-skeletons.adb
Expand Down
2 changes: 1 addition & 1 deletion clients/ada-server/generated/.openapi-generator/VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
7.0.0
7.4.0
41 changes: 32 additions & 9 deletions clients/ada-server/generated/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,23 +6,39 @@ This Ada server was generated by the [OpenAPI Generator](https://openapi-generat
By using the [OpenAPI-Spec](https://github.com/OAI/OpenAPI-Specification) from a remote server,
you can easily generate a server stub.

## Building
## Alire setup

To build the server you will need the GNAT Ada compiler as well as
the [OpenAPI Ada library](https://github.com/stcarrez/swagger-ada).

When the GNAT Ada compiler and OpenAPI Ada libraries are installed,
run the following command:
Use [Alire](https://github.com/alire-project/alire) to setup and build the project.
First, import the [OpenAPI Ada](https://gitlab.com/stcarrez/openapi-ada) server library with:

```shell
gprbuild -p -PdefaultPackage
alr with openapi_server
```

Then choose a servlet web container that will handle the requests.
Two web server implementations are provided:

* [AWS](https://github.com/AdaCore/aws)
* [EWS](https://github.com/simonjwright/ews)

and you should run one of the following `alr` command depending on your choice:

```
alr with servletada_aws
alr with servletada_ews
```

Once these steps are made, build the project with

```
alr build
```

After the build is successful, you will get the server binary
in bin/-server and you can start it as follows:
in `bin/_aws` or `bin/_ews` and you can start it as follows:

```shell
./bin/-server
./bin/_aws
```

## Structure of the server
Expand All @@ -40,6 +56,8 @@ src/server/-skeletons.adb|.Skeletons|The server skeleton implementation
src/server/-models.ads|.Skeletons|The server model types declaration
src/server/-models.adb|.Skeletons|The server model types implementation
src/-server.adb|.Server|The server main procedure
src/aws/_aws.adb||The Ada Web Server server main procedure
src/ews/_ews.adb||The Embedded Web Server server main procedure

Files generated in **src/server** should not be modified. The server implementation
files (**src/-server.ads** and **src/-server.adb**) should
Expand Down Expand Up @@ -81,6 +99,11 @@ Method | HTTP request | Description

### Models

- [.Models.CycleCycle_Type](CycleCycle_Type.md)
- [.Models.CycleDiscontinued_Type](CycleDiscontinued_Type.md)
- [.Models.CycleEol_Type](CycleEol_Type.md)
- [.Models.CycleLts_Type](CycleLts_Type.md)
- [.Models.CycleSupport_Type](CycleSupport_Type.md)
- [.Models.Cycle_Type](Cycle_Type.md)


Expand Down
10 changes: 5 additions & 5 deletions clients/ada-server/generated/config.gpr
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ abstract project Config is
when "debug" =>
for Default_Switches ("Ada") use ("-E");

when others =>
when others =>
for Default_Switches ("Ada") use ("-E");

end case;
Expand All @@ -64,12 +64,12 @@ abstract project Config is

when "coverage" =>
for Default_Switches ("ada") use ("-fprofile-arcs");
when others =>
null;

when others =>
null;
end case;

end linker;
end linker;

package Ide is
for VCS_Kind use "git";
Expand Down
40 changes: 31 additions & 9 deletions clients/ada-server/generated/defaultpackage.gpr
Original file line number Diff line number Diff line change
Expand Up @@ -8,21 +8,43 @@
with "config";
with "utilada_sys";
with "utilada_xml";
with "utilada_http";
with "utilada_curl";
with "security";
with "swagger";
with "servletada";
with "servletada_aws";
-- with "servletada_ews";
with "swagger_server";
project defaultPackage is

Mains := ("-server.adb");
for Main use Mains;
for Source_Dirs use ("src", "src/model", "src/server");
for Object_Dir use "./" & Config'Exec_Dir & "/bin";
for Object_Dir use "obj/";
for Source_Dirs use ("src", "src/model", "src/server");
for Main use ();

package Binder renames Config.Binder;
package Builder renames Config.Builder;
package Compiler renames Config.Compiler;
package Linker renames Config.Linker;
Build_AWS : Config.Yes_No := external ("BUILD_AWS", "yes");
Build_EWS : Config.Yes_No := external ("BUILD_EWS", "no");

case Build_AWS is
when "yes" =>
for Main use Project'Main & ("_aws.adb");
for Source_Dirs use Project'Source_Dirs & ("src/aws");

when others =>
null;
end case;

case Build_EWS is
when "yes" =>
for Main use Project'Main & ("_ews.adb");
for Source_Dirs use Project'Source_Dirs & ("src/ews");

when others =>
null;
end case;

package Binder renames Config.Binder;
package Builder renames Config.Builder;
package Compiler renames Config.Compiler;
package Linker renames Config.Linker;

end defaultPackage;
25 changes: 8 additions & 17 deletions clients/ada-server/generated/src/-server.adb
Original file line number Diff line number Diff line change
@@ -1,46 +1,37 @@
with Ada.IO_Exceptions;
with AWS.Config.Set;
with Swagger.Servers.AWS;
with Servlet.Server;
with Swagger.Servers.Applications;
with Util.Strings;
with Util.Log.Loggers;
with Util.Properties;
with Util.Properties.Basic;
with .Servers;
procedure .Server is
procedure Configure (Config : in out AWS.Config.Object);

procedure .Server (Server : in out Servlet.Server.Container'Class) is
use Util.Properties.Basic;

CONFIG_PATH : constant String := ".properties";
Port : Natural := 8080;

procedure Configure (Config : in out AWS.Config.Object) is
begin
AWS.Config.Set.Server_Port (Config, Port);
AWS.Config.Set.Max_Connection (Config, 8);
AWS.Config.Set.Accept_Queue_Size (Config, 512);
end Configure;

Port : Natural := 8080;
App : aliased Swagger.Servers.Applications.Application_Type;
WS : Swagger.Servers.AWS.AWS_Container;
Log : constant Util.Log.Loggers.Logger := Util.Log.Loggers.Create (".Server");
Props : Util.Properties.Manager;
Config : Servlet.Server.Configuration;
begin
Props.Load_Properties (CONFIG_PATH);
Util.Log.Loggers.Initialize (Props);

Port := Integer_Property.Get (Props, "swagger.port", Port);
Config.Listening_Port := Port;
App.Configure (Props);
.Servers.Server_Impl.Register (App);

WS.Configure (Configure'Access);
WS.Register_Application ("", App'Unchecked_Access);
Server.Configure (Config);
Server.Register_Application ("", App'Unchecked_Access);
App.Dump_Routes (Util.Log.INFO_LEVEL);
Log.Info ("Connect your browser to: http://localhost:{0}/ui/index.html",
Util.Strings.Image (Port));

WS.Start;
Server.Start;

delay 6000.0;

Expand Down
10 changes: 5 additions & 5 deletions clients/ada-server/generated/src/-servers.adb
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ package body .Servers is
procedure Get_Api_All_Json
(Server : in out Server_Type
;
Result : out .Models.AnyType_Type;
Result : out ;
Context : in out Swagger.Servers.Context_Type) is
begin
null;
Expand All @@ -29,8 +29,8 @@ package body .Servers is
overriding
procedure Get_Api_Product_Cycle_Json
(Server : in out Server_Type;
Product : in .Models.AnyType_Type;
Cycle : in .Models.AnyType_Type;
Product : in Swagger.UString;
Cycle : in Swagger.UString;
Result : out .Models.Cycle_Type;
Context : in out Swagger.Servers.Context_Type) is
begin
Expand All @@ -42,8 +42,8 @@ package body .Servers is
overriding
procedure Get_Api_Product_Json
(Server : in out Server_Type;
Product : in .Models.AnyType_Type;
Result : out .Models.AnyType_Type;
Product : in Swagger.UString;
Result : out ;
Context : in out Swagger.Servers.Context_Type) is
begin
null;
Expand Down
10 changes: 5 additions & 5 deletions clients/ada-server/generated/src/-servers.ads
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,16 @@ package .Servers is
procedure Get_Api_All_Json
(Server : in out Server_Type
;
Result : out .Models.AnyType_Type;
Result : out ;
Context : in out Swagger.Servers.Context_Type);

-- Single cycle details
-- Gets details of a single cycle
overriding
procedure Get_Api_Product_Cycle_Json
(Server : in out Server_Type;
Product : in .Models.AnyType_Type;
Cycle : in .Models.AnyType_Type;
Product : in Swagger.UString;
Cycle : in Swagger.UString;
Result : out .Models.Cycle_Type;
Context : in out Swagger.Servers.Context_Type);

Expand All @@ -43,8 +43,8 @@ package .Servers is
overriding
procedure Get_Api_Product_Json
(Server : in out Server_Type;
Product : in .Models.AnyType_Type;
Result : out .Models.AnyType_Type;
Product : in Swagger.UString;
Result : out ;
Context : in out Swagger.Servers.Context_Type);

package Server_Impl is
Expand Down
Loading

0 comments on commit 0aa46d0

Please sign in to comment.