forked from loafle/openapi-generator-original
- add missing 'use Swagger.Streams;' clause - add Style_Checks pragma to fix style compilation warnings in generated Ada code - fix spurious spaces in licence headers that cause Ada style compilation warning - update the default GNAT project config
This commit is contained in:
parent
c5ddf463c4
commit
a06af89be9
@ -1,6 +1,8 @@
|
||||
{{>licenseInfo}}
|
||||
pragma Warnings (Off, "*is not referenced");
|
||||
with Swagger.Streams;
|
||||
package body {{package}}.Clients is
|
||||
pragma Style_Checks ("-mr");
|
||||
{{#apiInfo}}
|
||||
{{#apis}}
|
||||
{{#operations}}
|
||||
|
@ -4,6 +4,7 @@
|
||||
with {{package}}.Models;
|
||||
with Swagger.Clients;
|
||||
package {{package}}.Clients is
|
||||
pragma Style_Checks ("-mr");
|
||||
|
||||
type Client_Type is new Swagger.Clients.Client_Type with null record;
|
||||
|
||||
|
@ -3,17 +3,16 @@ abstract project Config is
|
||||
|
||||
type Yes_No is ("yes", "no");
|
||||
|
||||
type Library_Type_Type is ("relocatable", "static");
|
||||
type Library_Type_Type is ("relocatable", "static", "static-pic");
|
||||
|
||||
type Mode_Type is ("distrib", "debug", "optimize", "profile");
|
||||
Mode : Mode_Type := external ("MODE", "debug");
|
||||
type Build_Type is ("distrib", "debug", "optimize", "profile", "coverage");
|
||||
Mode : Build_Type := external ("BUILD", "debug");
|
||||
|
||||
Coverage : Yes_No := External ("COVERAGE", "no");
|
||||
Processors := External ("PROCESSORS", "1");
|
||||
|
||||
package Builder is
|
||||
case Mode is
|
||||
when "debug" =>
|
||||
when "debug" =>
|
||||
for Default_Switches ("Ada") use ("-g", "-j" & Processors);
|
||||
when others =>
|
||||
for Default_Switches ("Ada") use ("-g", "-O2", "-j" & Processors);
|
||||
@ -29,7 +28,12 @@ abstract project Config is
|
||||
|
||||
when "debug" =>
|
||||
for Default_Switches ("Ada") use defaults & warnings
|
||||
& ("-gnata", "-gnatVaMI", "-gnaty3abcefhiklmnprstxM99");
|
||||
& ("-gnata", "-gnatVaMI", "-gnaty3abcefhiklmnprstxM127");
|
||||
|
||||
when "coverage" =>
|
||||
for Default_Switches ("Ada") use defaults & warnings
|
||||
& ("-gnata", "-gnatVaMI", "-gnaty3abcefhiklmnprstxM127",
|
||||
"-fprofile-arcs", "-ftest-coverage");
|
||||
|
||||
when "optimize" =>
|
||||
for Default_Switches ("Ada") use defaults & warnings
|
||||
@ -37,13 +41,7 @@ abstract project Config is
|
||||
|
||||
when "profile" =>
|
||||
for Default_Switches ("Ada") use defaults & warnings & ("-pg");
|
||||
end case;
|
||||
|
||||
case Coverage is
|
||||
when "yes" =>
|
||||
for Default_Switches ("ada") use Compiler'Default_Switches ("Ada") &
|
||||
("-fprofile-arcs", "-ftest-coverage");
|
||||
when others =>
|
||||
end case;
|
||||
end compiler;
|
||||
|
||||
@ -69,18 +67,15 @@ abstract project Config is
|
||||
when "optimize" =>
|
||||
for Default_Switches ("Ada") use ("-Wl,--gc-sections");
|
||||
|
||||
when "coverage" =>
|
||||
for Default_Switches ("ada") use ("-fprofile-arcs");
|
||||
|
||||
when others =>
|
||||
null;
|
||||
end case;
|
||||
|
||||
case Coverage is
|
||||
when "yes" =>
|
||||
for Default_Switches ("ada") use Linker'Default_Switches ("ada") &
|
||||
("-fprofile-arcs");
|
||||
when others =>
|
||||
end case;
|
||||
end linker;
|
||||
|
||||
end linker;
|
||||
|
||||
package Ide is
|
||||
for VCS_Kind use "git";
|
||||
end Ide;
|
||||
|
@ -2,7 +2,7 @@
|
||||
-- {{{appDescription}}}
|
||||
--
|
||||
-- {{#version}}The version of the OpenAPI document: {{{version}}}{{/version}}
|
||||
-- {{#infoEmail}}Contact: {{{infoEmail}}}{{/infoEmail}}
|
||||
--{{#infoEmail}} Contact: {{{infoEmail}}}{{/infoEmail}}
|
||||
--
|
||||
-- NOTE: This package is auto generated by OpenAPI-Generator {{{generatorVersion}}}.
|
||||
-- https://openapi-generator.tech
|
||||
|
@ -1,6 +1,9 @@
|
||||
{{>licenseInfo}}
|
||||
|
||||
package body {{package}}.Models is
|
||||
pragma Style_Checks ("-mr");
|
||||
|
||||
pragma Warnings (Off, "*use clause for package*");
|
||||
|
||||
use Swagger.Streams;
|
||||
|
||||
|
@ -4,6 +4,7 @@
|
||||
with Swagger.Streams;
|
||||
with Ada.Containers.Vectors;
|
||||
package {{package}}.Models is
|
||||
pragma Style_Checks ("-mr");
|
||||
|
||||
{{#orderedModels}}{{#model}}{{^isArray}}
|
||||
{{#title}} -- ------------------------------
|
||||
|
@ -1,7 +1,12 @@
|
||||
{{>licenseInfo}}
|
||||
pragma Warnings (Off, "*is not referenced");
|
||||
with Swagger.Streams;
|
||||
with Swagger.Servers.Operation;
|
||||
package body {{package}}.Skeletons is
|
||||
pragma Style_Checks ("-mr");
|
||||
pragma Warnings (Off, "*use clause for package*");
|
||||
|
||||
use Swagger.Streams;
|
||||
|
||||
package body Skeleton is
|
||||
|
||||
@ -58,7 +63,7 @@ package body {{package}}.Skeletons is
|
||||
{{#hasParams}}
|
||||
{{#hasBodyParam}}
|
||||
Swagger.Servers.Read (Req, Input);
|
||||
{{#bodyParams}}{{#vendorExtensions.x-is-model-type}}
|
||||
{{#bodyParams}}{{#vendorExtensions.x-is-model-type}}
|
||||
{{package}}.Models.Deserialize (Input, "{{baseName}}", {{paramName}});{{/vendorExtensions.x-is-model-type}}{{^vendorExtensions.x-is-model-type}}{{#isFile}}
|
||||
-- TODO: Serialize (Input.Stream, "{{basename}}", {{paramName}});{{/isFile}}{{^isFile}}{{^isLong}}
|
||||
Deserialize (Input, "{{baseName}}", {{paramName}});{{/isLong}}{{#isLong}}
|
||||
|
@ -1,10 +1,14 @@
|
||||
{{>licenseInfo}}
|
||||
{{#imports}}with {{import}};
|
||||
{{/imports}}
|
||||
pragma Warnings (Off, "*is not referenced");
|
||||
pragma Warnings (Off, "*no entities of*are referenced");
|
||||
with Swagger.Servers;
|
||||
with {{package}}.Models;
|
||||
with Security.Permissions;
|
||||
package {{package}}.Skeletons is
|
||||
pragma Style_Checks ("-mr");
|
||||
pragma Warnings (Off, "*use clause for package*");
|
||||
use {{package}}.Models;
|
||||
type Server_Type is limited interface;
|
||||
{{#authMethods}}{{#scopes}}
|
||||
|
@ -15,6 +15,7 @@ with Swagger.Servers;
|
||||
with {{package}}.Models;
|
||||
with {{package}}.Skeletons;
|
||||
package {{package}}.Servers is
|
||||
pragma Warnings (Off, "*use clause for package*");
|
||||
use {{package}}.Models;
|
||||
type Server_Type is limited new {{package}}.Skeletons.Server_Type with null record;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user