diff --git a/docs/generators/openapi-yaml.html b/docs/generators/openapi-yaml.html index 779a15f4439..54143cee596 100644 --- a/docs/generators/openapi-yaml.html +++ b/docs/generators/openapi-yaml.html @@ -20,7 +20,7 @@ sidebar_label: openapi-yaml

ensureUniqueParamsWhether to ensure parameter names are unique in an operation (rename parameters that are not).true allowUnicodeIdentifiersboolean, toggles whether unicode identifiers are allowed in names or not, default is falsefalse prependFormOrBodyParametersAdd form or body parameters to the beginning of the parameter list.false -outputFileoutput filenamenull +outputFileOutput filenameopenapi/openapi.yaml -
Last updated on 2019-7-18
\ No newline at end of file +
Last updated on 2019-7-29
\ No newline at end of file diff --git a/docs/generators/openapi-yaml/index.html b/docs/generators/openapi-yaml/index.html index 779a15f4439..54143cee596 100644 --- a/docs/generators/openapi-yaml/index.html +++ b/docs/generators/openapi-yaml/index.html @@ -20,7 +20,7 @@ sidebar_label: openapi-yaml

ensureUniqueParamsWhether to ensure parameter names are unique in an operation (rename parameters that are not).true allowUnicodeIdentifiersboolean, toggles whether unicode identifiers are allowed in names or not, default is falsefalse prependFormOrBodyParametersAdd form or body parameters to the beginning of the parameter list.false -outputFileoutput filenamenull +outputFileOutput filenameopenapi/openapi.yaml -
Last updated on 2019-7-18
\ No newline at end of file +
Last updated on 2019-7-29
\ No newline at end of file diff --git a/docs/templating.html b/docs/templating.html index 1575ff7cd2c..8d1a32ad58a 100644 --- a/docs/templating.html +++ b/docs/templating.html @@ -117,7 +117,7 @@ index 3b40702..a6d12e0 100644 +++ b/libraries/resteasy/build.gradle.mustache @@ -134,6 +134,7 @@ ext { } - + dependencies { + compile "com.jcabi:jcabi-aspects:0.22.6" compile "io.swagger:swagger-annotations:$swagger_annotations_version" @@ -132,7 +132,7 @@ index a4d0f9f..49b17c7 100644 +++ b/libraries/resteasy/api.mustache @@ -1,5 +1,6 @@ package {{package}}; - + +import com.jcabi.aspects.Loggable; import {{invokerPackage}}.ApiException; import {{invokerPackage}}.ApiClient; @@ -164,7 +164,7 @@ index 04a9d55..7a93c50 100644 apply plugin: 'idea' apply plugin: 'eclipse' +apply plugin: 'aspectj' - + group = '{{groupId}}' version = '{{artifactVersion}}' @@ -12,6 +13,7 @@ buildscript { @@ -174,14 +174,14 @@ index 04a9d55..7a93c50 100644 + classpath "net.uberfoo.gradle:gradle-aspectj:2.2" } } - + @@ -140,9 +142,18 @@ ext { jersey_version = "1.19.4" jodatime_version = "2.9.9" junit_version = "4.12" + aspectjVersion = '1.9.0' } - + +sourceCompatibility = '1.8' +targetCompatibility = '1.8' + @@ -221,7 +221,7 @@ index b7a3647..3d9d088 100644

Make sure your custom template compiles:

cd ~/.openapi-generator/example
 gradle assemble
-# or, regenerate the wrapper 
+# or, regenerate the wrapper
 gradle wrapper --gradle-version 4.8 --distribution-type all
 ./gradlew assemble
 
@@ -295,7 +295,7 @@ Download https://jcenter.bintray.com/com/jcabi/jcabi-aspects/0.22.6/jcabi-aspect id 'org.jetbrains.kotlin.jvm' version '1.3.11' id "com.github.johnrengelman.shadow" version "5.0.0" } - + dependencies { compile "org.jetbrains.kotlin:kotlin-stdlib-jdk8" compile "org.openapitools:openapi-generator-core:4.0.0-SNAPSHOT" @@ -362,7 +362,7 @@ import ( {% endfor %} ) -type Generated{{classname}}Servicer +type Generated{{classname}}Servicer // etc @@ -404,49 +404,49 @@ type {{item.classname}}Aside from transforming an API document, the implementing class gets to decide how to apply the data structure to templates. We can decide which data structure to apply to which template files. You have the following structures at your disposal.

Examples for the following structures will be presented using the following spec document:

  swagger: "2.0"
-  info: 
+  info:
     version: "1.0.0"
     title: "Swagger Petstore"
     description: "A sample API that uses a petstore as an example to demonstrate features in the swagger-2.0 specification"
     termsOfService: "http://swagger.io/terms/"
-    contact: 
+    contact:
       name: "Swagger API Team"
-    license: 
+    license:
       name: "MIT"
   host: "petstore.swagger.io"
   basePath: "/api"
-  schemes: 
+  schemes:
     - "http"
-  consumes: 
+  consumes:
     - "application/json"
-  produces: 
+  produces:
     - "application/json"
-  paths: 
-    /pets: 
-      get: 
+  paths:
+    /pets:
+      get:
         description: "Returns all pets from the system that the user has access to"
-        produces: 
+        produces:
           - "application/json"
-        responses: 
+        responses:
           "200":
             description: "A list of pets."
-            schema: 
+            schema:
               type: "array"
-              items: 
+              items:
                 $ref: "#/definitions/Pet"
-  definitions: 
-    Pet: 
+  definitions:
+    Pet:
       type: "object"
-      required: 
+      required:
         - "id"
         - "name"
-      properties: 
-        id: 
+      properties:
+        id:
           type: "integer"
           format: "int64"
-        name: 
+        name:
           type: "string"
-        tag: 
+        tag:
           type: "string"
 
 
@@ -708,6 +708,19 @@ apiTemplateFiles.put("api-body.mustache", isContainer: true if the parameter or property is an array or a map.
  • isPrimitiveType: true if the parameter or property type is a primitive type (e.g. string, integer, etc) as defined in the spec.
  • +

    Mustache Lambdas

    +

    Many generators (those extending DefaultCodegen) come with a small set of lambda functions available under the key lambda:

    + +

    Lambda is invoked by lambda.[lambda name] expression. For example: {{#lambda.lowercase}}FRAGMENT TO LOWERCASE{{/lambda.lowercase}} to lower case text between lambda.lowercase.

    Extensions

    OpenAPI supports a concept called "Extensions". These are called "Specification Extensions" in 3.x and "Vendor Extensions" in 2.0. You'll see them referred to as "Vendor Extensions" in most places in this project.

    @@ -838,4 +851,4 @@ For more details on Mustache see {{#enums}}{{-index}} {{enum}}{{/enums}} -
    Last updated on 2019-7-18
    UsageCustomization
    \ No newline at end of file +
    Last updated on 2019-7-29
    UsageCustomization
    \ No newline at end of file diff --git a/docs/templating/index.html b/docs/templating/index.html index 1575ff7cd2c..8d1a32ad58a 100644 --- a/docs/templating/index.html +++ b/docs/templating/index.html @@ -117,7 +117,7 @@ index 3b40702..a6d12e0 100644 +++ b/libraries/resteasy/build.gradle.mustache @@ -134,6 +134,7 @@ ext { } - + dependencies { + compile "com.jcabi:jcabi-aspects:0.22.6" compile "io.swagger:swagger-annotations:$swagger_annotations_version" @@ -132,7 +132,7 @@ index a4d0f9f..49b17c7 100644 +++ b/libraries/resteasy/api.mustache @@ -1,5 +1,6 @@ package {{package}}; - + +import com.jcabi.aspects.Loggable; import {{invokerPackage}}.ApiException; import {{invokerPackage}}.ApiClient; @@ -164,7 +164,7 @@ index 04a9d55..7a93c50 100644 apply plugin: 'idea' apply plugin: 'eclipse' +apply plugin: 'aspectj' - + group = '{{groupId}}' version = '{{artifactVersion}}' @@ -12,6 +13,7 @@ buildscript { @@ -174,14 +174,14 @@ index 04a9d55..7a93c50 100644 + classpath "net.uberfoo.gradle:gradle-aspectj:2.2" } } - + @@ -140,9 +142,18 @@ ext { jersey_version = "1.19.4" jodatime_version = "2.9.9" junit_version = "4.12" + aspectjVersion = '1.9.0' } - + +sourceCompatibility = '1.8' +targetCompatibility = '1.8' + @@ -221,7 +221,7 @@ index b7a3647..3d9d088 100644

    Make sure your custom template compiles:

    cd ~/.openapi-generator/example
     gradle assemble
    -# or, regenerate the wrapper 
    +# or, regenerate the wrapper
     gradle wrapper --gradle-version 4.8 --distribution-type all
     ./gradlew assemble
     
    @@ -295,7 +295,7 @@ Download https://jcenter.bintray.com/com/jcabi/jcabi-aspects/0.22.6/jcabi-aspect id 'org.jetbrains.kotlin.jvm' version '1.3.11' id "com.github.johnrengelman.shadow" version "5.0.0" } - + dependencies { compile "org.jetbrains.kotlin:kotlin-stdlib-jdk8" compile "org.openapitools:openapi-generator-core:4.0.0-SNAPSHOT" @@ -362,7 +362,7 @@ import ( {% endfor %} ) -type Generated{{classname}}Servicer +type Generated{{classname}}Servicer // etc @@ -404,49 +404,49 @@ type {{item.classname}}Aside from transforming an API document, the implementing class gets to decide how to apply the data structure to templates. We can decide which data structure to apply to which template files. You have the following structures at your disposal.

    Examples for the following structures will be presented using the following spec document:

      swagger: "2.0"
    -  info: 
    +  info:
         version: "1.0.0"
         title: "Swagger Petstore"
         description: "A sample API that uses a petstore as an example to demonstrate features in the swagger-2.0 specification"
         termsOfService: "http://swagger.io/terms/"
    -    contact: 
    +    contact:
           name: "Swagger API Team"
    -    license: 
    +    license:
           name: "MIT"
       host: "petstore.swagger.io"
       basePath: "/api"
    -  schemes: 
    +  schemes:
         - "http"
    -  consumes: 
    +  consumes:
         - "application/json"
    -  produces: 
    +  produces:
         - "application/json"
    -  paths: 
    -    /pets: 
    -      get: 
    +  paths:
    +    /pets:
    +      get:
             description: "Returns all pets from the system that the user has access to"
    -        produces: 
    +        produces:
               - "application/json"
    -        responses: 
    +        responses:
               "200":
                 description: "A list of pets."
    -            schema: 
    +            schema:
                   type: "array"
    -              items: 
    +              items:
                     $ref: "#/definitions/Pet"
    -  definitions: 
    -    Pet: 
    +  definitions:
    +    Pet:
           type: "object"
    -      required: 
    +      required:
             - "id"
             - "name"
    -      properties: 
    -        id: 
    +      properties:
    +        id:
               type: "integer"
               format: "int64"
    -        name: 
    +        name:
               type: "string"
    -        tag: 
    +        tag:
               type: "string"
     
     
    @@ -708,6 +708,19 @@ apiTemplateFiles.put("api-body.mustache", isContainer: true if the parameter or property is an array or a map.
  • isPrimitiveType: true if the parameter or property type is a primitive type (e.g. string, integer, etc) as defined in the spec.
  • +

    Mustache Lambdas

    +

    Many generators (those extending DefaultCodegen) come with a small set of lambda functions available under the key lambda:

    + +

    Lambda is invoked by lambda.[lambda name] expression. For example: {{#lambda.lowercase}}FRAGMENT TO LOWERCASE{{/lambda.lowercase}} to lower case text between lambda.lowercase.

    Extensions

    OpenAPI supports a concept called "Extensions". These are called "Specification Extensions" in 3.x and "Vendor Extensions" in 2.0. You'll see them referred to as "Vendor Extensions" in most places in this project.

    @@ -838,4 +851,4 @@ For more details on Mustache see {{#enums}}{{-index}} {{enum}}{{/enums}} -
    Last updated on 2019-7-18
    UsageCustomization
    \ No newline at end of file +
    Last updated on 2019-7-29
    UsageCustomization
    \ No newline at end of file