All Downloads are FREE. Search and download functionalities are using the official Maven repository.

Ada.model-spec.mustache Maven / Gradle / Ivy

There is a newer version: 3.0.0-rc1
Show newest version
{{>licenseInfo}}
{{#imports}}with {{import}};
{{/imports}}
with Swagger.Streams;
with Ada.Containers.Vectors;
package {{package}}.Models is

{{#orderedModels}}{{#model}}{{^isArrayModel}}
{{#title}}   --  ------------------------------
   --  {{title}}{{#description}}
   --  {{#lambdaAdaComment}}{{description}}{{/lambdaAdaComment}}{{/description}}
   --  ------------------------------{{/title}}
   type {{classname}} is
     record
       {{#vars}}
       {{name}} : {{datatype}};
       {{/vars}}
     end record;

   package {{classname}}_Vectors is
      new Ada.Containers.Vectors (Index_Type   => Positive,
                                  Element_Type => {{classname}});

   procedure Serialize (Into  : in out Swagger.Streams.Output_Stream'Class;
                        Name  : in String;
                        Value : in {{classname}});

   procedure Serialize (Into  : in out Swagger.Streams.Output_Stream'Class;
                        Name  : in String;
                        Value : in {{classname}}_Vectors.Vector);

   procedure Deserialize (From  : in Swagger.Value_Type;
                          Name  : in String;
                          Value : out {{classname}});

   procedure Deserialize (From  : in Swagger.Value_Type;
                          Name  : in String;
                          Value : out {{classname}}_Vectors.Vector);

{{/isArrayModel}}{{#isArrayModel}}
   subtype {{classname}} is {{arrayModelType}}_Type_Vectors.Vector;
{{/isArrayModel}}{{/model}}
{{/orderedModels}}

end {{package}}.Models;




© 2015 - 2024 Weber Informatics LLC | Privacy Policy