diff --git a/modules/openapi-generator/src/main/resources/Ada/README.mustache b/modules/openapi-generator/src/main/resources/Ada/README.mustache index d3ca2efef39..d0f6d54028f 100644 --- a/modules/openapi-generator/src/main/resources/Ada/README.mustache +++ b/modules/openapi-generator/src/main/resources/Ada/README.mustache @@ -74,7 +74,7 @@ All URIs are relative to *{{basePath}}* Method | HTTP request | Description ------------- | ------------- | ------------- -{{#apiInfo}}{{#apis}}{{#operations}}{{#operation}}[**{{nickname}}**]({{apiDocPath}}{{classname}}.md#{{nickname}}) | **{{httpMethod}}** {{path}} | {{#summary}}{{summary}}{{/summary}} +{{#apiInfo}}{{#apis}}{{#operations}}{{#operation}}[**{{nickname}}**]({{apiDocPath}}{{classname}}.md#{{nickname}}) | **{{httpMethod}}** {{path}} | {{summary}} {{/operation}}{{/operations}}{{/apis}}{{/apiInfo}} ### Models diff --git a/modules/openapi-generator/src/main/resources/Ada/client-body.mustache b/modules/openapi-generator/src/main/resources/Ada/client-body.mustache index 71b3e314a95..b13f1af1291 100644 --- a/modules/openapi-generator/src/main/resources/Ada/client-body.mustache +++ b/modules/openapi-generator/src/main/resources/Ada/client-body.mustache @@ -13,7 +13,7 @@ package body {{package}}.Clients is procedure {{operationId}} (Client : in out Client_Type{{#hasParams}};{{/hasParams}}{{#allParams}} {{paramName}} : in {{^isFile}}{{^isString}}{{^isPrimitiveType}}{{^isContainer}}{{package}}.Models.{{/isContainer}}{{/isPrimitiveType}}{{/isString}}{{/isFile}}{{dataType}}{{^-last}};{{/-last}}{{/allParams}}{{#returnType}}; - Result : out {{returnType}}{{/returnType}}) is + Result : out {{.}}{{/returnType}}) is URI : Swagger.Clients.URI_Type;{{#hasBodyParam}} Req : Swagger.Clients.Request_Type;{{/hasBodyParam}}{{#hasFormParams}} Req : Swagger.Clients.Request_Type;{{/hasFormParams}} diff --git a/modules/openapi-generator/src/main/resources/Ada/client-spec.mustache b/modules/openapi-generator/src/main/resources/Ada/client-spec.mustache index 46559f0dcad..134218b105e 100644 --- a/modules/openapi-generator/src/main/resources/Ada/client-spec.mustache +++ b/modules/openapi-generator/src/main/resources/Ada/client-spec.mustache @@ -17,7 +17,7 @@ package {{package}}.Clients is procedure {{operationId}} (Client : in out Client_Type{{#hasParams}};{{/hasParams}}{{#allParams}} {{paramName}} : in {{^isFile}}{{^isString}}{{^isPrimitiveType}}{{^isContainer}}{{package}}.Models.{{/isContainer}}{{/isPrimitiveType}}{{/isString}}{{/isFile}}{{dataType}}{{^-last}};{{/-last}}{{/allParams}}{{#returnType}}; - Result : out {{returnType}}{{/returnType}}); + Result : out {{.}}{{/returnType}}); {{/operation}} {{/operations}} diff --git a/modules/openapi-generator/src/main/resources/Ada/licenseInfo.mustache b/modules/openapi-generator/src/main/resources/Ada/licenseInfo.mustache index df913f4d712..d98c036f523 100644 --- a/modules/openapi-generator/src/main/resources/Ada/licenseInfo.mustache +++ b/modules/openapi-generator/src/main/resources/Ada/licenseInfo.mustache @@ -1,8 +1,8 @@ -- {{{appName}}} -- {{{appDescription}}} -- --- {{#version}}The version of the OpenAPI document: {{{version}}}{{/version}} ---{{#infoEmail}} Contact: {{{infoEmail}}}{{/infoEmail}} +-- {{#version}}The version of the OpenAPI document: {{{.}}}{{/version}} +--{{#infoEmail}} Contact: {{{.}}}{{/infoEmail}} -- -- NOTE: This package is auto generated by OpenAPI-Generator {{{generatorVersion}}}. -- https://openapi-generator.tech diff --git a/modules/openapi-generator/src/main/resources/Ada/server-body.mustache b/modules/openapi-generator/src/main/resources/Ada/server-body.mustache index 9768d87d6cd..65225bef140 100644 --- a/modules/openapi-generator/src/main/resources/Ada/server-body.mustache +++ b/modules/openapi-generator/src/main/resources/Ada/server-body.mustache @@ -23,7 +23,7 @@ package body {{package}}.Servers is (Server : in out Server_Type{{#hasParams}};{{/hasParams}} {{#allParams}}{{paramName}} : in {{dataType}}{{^-last}}; {{/-last}}{{/allParams}}{{#returnType}}; - Result : out {{returnType}}{{/returnType}}; + Result : out {{.}}{{/returnType}}; Context : in out Swagger.Servers.Context_Type) is begin null; diff --git a/modules/openapi-generator/src/main/resources/Ada/server-properties.mustache b/modules/openapi-generator/src/main/resources/Ada/server-properties.mustache index 028837de4fc..896f026ec69 100644 --- a/modules/openapi-generator/src/main/resources/Ada/server-properties.mustache +++ b/modules/openapi-generator/src/main/resources/Ada/server-properties.mustache @@ -33,5 +33,3 @@ log4j.logger.Util=DEBUG log4j.logger.Servlet=DEBUG log4j.logger.Util.Serialize.Mappers=WARN log4j.logger.Util.Serialize.IO=INFO - - diff --git a/modules/openapi-generator/src/main/resources/Ada/server-skeleton-body.mustache b/modules/openapi-generator/src/main/resources/Ada/server-skeleton-body.mustache index b24ba9815da..570508ab7fb 100644 --- a/modules/openapi-generator/src/main/resources/Ada/server-skeleton-body.mustache +++ b/modules/openapi-generator/src/main/resources/Ada/server-skeleton-body.mustache @@ -34,7 +34,7 @@ package body {{package}}.Skeletons is {{paramName}} : {{dataType}}; {{/allParams}} {{#returnType}} - Result : {{returnType}}; + Result : {{.}}; {{/returnType}} begin {{#vendorExtensions.x-auth-scopes}} @@ -130,7 +130,7 @@ package body {{package}}.Skeletons is {{paramName}} : {{dataType}}; {{/allParams}} {{#returnType}} - Result : {{returnType}}; + Result : {{.}}; {{/returnType}} begin {{#vendorExtensions.x-auth-scopes}} @@ -219,7 +219,7 @@ package body {{package}}.Skeletons is procedure {{operationId}} ({{#allParams}}{{paramName}} : in {{dataType}}{{^-last}}; {{/-last}}{{/allParams}}{{#returnType}}; - Result : out {{returnType}}{{/returnType}}; + Result : out {{.}}{{/returnType}}; Context : in out Swagger.Servers.Context_Type) is begin Impl.{{operationId}} diff --git a/modules/openapi-generator/src/main/resources/Ada/server-skeleton-spec.mustache b/modules/openapi-generator/src/main/resources/Ada/server-skeleton-spec.mustache index d266f3b3dd2..4365261e543 100644 --- a/modules/openapi-generator/src/main/resources/Ada/server-skeleton-spec.mustache +++ b/modules/openapi-generator/src/main/resources/Ada/server-skeleton-spec.mustache @@ -27,7 +27,7 @@ package {{package}}.Skeletons is (Server : in out Server_Type{{#hasParams}};{{/hasParams}} {{#allParams}}{{paramName}} : in {{dataType}}{{^-last}}; {{/-last}}{{/allParams}}{{#returnType}}; - Result : out {{returnType}}{{/returnType}}; + Result : out {{.}}{{/returnType}}; Context : in out Swagger.Servers.Context_Type) is abstract; {{/operation}} {{/operations}} @@ -95,7 +95,7 @@ package {{package}}.Skeletons is procedure {{operationId}} ({{#allParams}}{{paramName}} : in {{dataType}}{{^-last}}; {{/-last}}{{/allParams}}{{#returnType}}; - Result : out {{returnType}}{{/returnType}}; + Result : out {{.}}{{/returnType}}; Context : in out Swagger.Servers.Context_Type); {{/hasParams}} {{^hasParams}} diff --git a/modules/openapi-generator/src/main/resources/Ada/server-spec.mustache b/modules/openapi-generator/src/main/resources/Ada/server-spec.mustache index 7b08b6cd046..4abfb7d4e4f 100644 --- a/modules/openapi-generator/src/main/resources/Ada/server-spec.mustache +++ b/modules/openapi-generator/src/main/resources/Ada/server-spec.mustache @@ -31,7 +31,7 @@ package {{package}}.Servers is (Server : in out Server_Type{{#hasParams}};{{/hasParams}} {{#allParams}}{{paramName}} : in {{dataType}}{{^-last}}; {{/-last}}{{/allParams}}{{#returnType}}; - Result : out {{returnType}}{{/returnType}}; + Result : out {{.}}{{/returnType}}; Context : in out Swagger.Servers.Context_Type); {{/operation}} {{/operations}} diff --git a/modules/openapi-generator/src/main/resources/C-libcurl/CMakeLists.txt.mustache b/modules/openapi-generator/src/main/resources/C-libcurl/CMakeLists.txt.mustache index 41e5faf3e66..82c6b09ab4e 100644 --- a/modules/openapi-generator/src/main/resources/C-libcurl/CMakeLists.txt.mustache +++ b/modules/openapi-generator/src/main/resources/C-libcurl/CMakeLists.txt.mustache @@ -17,7 +17,7 @@ if (OPENSSL_FOUND) include_directories(${OPENSSL_INCLUDE_DIRS}) link_directories(${OPENSSL_LIBRARIES}) message(STATUS "Using OpenSSL ${OPENSSL_VERSION}") -else() +else() message (STATUS "OpenSSL Not found.") endif() diff --git a/modules/openapi-generator/src/main/resources/C-libcurl/README.md.mustache b/modules/openapi-generator/src/main/resources/C-libcurl/README.md.mustache index 5d5eb19c969..740f9b4c20d 100644 --- a/modules/openapi-generator/src/main/resources/C-libcurl/README.md.mustache +++ b/modules/openapi-generator/src/main/resources/C-libcurl/README.md.mustache @@ -70,7 +70,7 @@ All URIs are relative to *{{basePath}}* Category | Method | HTTP request | Description ------------ | ------------- | ------------- | ------------- -{{#apiInfo}}{{#apis}}{{#operations}}{{#operation}}*{{classname}}* | [**{{classname}}_{{operationId}}**]({{apiDocPath}}{{classname}}.md#{{classname}}_{{operationId}}) | **{{httpMethod}}** {{path}} | {{#summary}}{{{summary}}}{{/summary}} +{{#apiInfo}}{{#apis}}{{#operations}}{{#operation}}*{{classname}}* | [**{{classname}}_{{operationId}}**]({{apiDocPath}}{{classname}}.md#{{classname}}_{{operationId}}) | **{{httpMethod}}** {{path}} | {{{summary}}} {{/operation}}{{/operations}}{{/apis}}{{/apiInfo}} ## Documentation for Models diff --git a/modules/openapi-generator/src/main/resources/C-libcurl/api-body.mustache b/modules/openapi-generator/src/main/resources/C-libcurl/api-body.mustache index 0449acda767..49c73f86b91 100644 --- a/modules/openapi-generator/src/main/resources/C-libcurl/api-body.mustache +++ b/modules/openapi-generator/src/main/resources/C-libcurl/api-body.mustache @@ -91,11 +91,11 @@ end: {{#operations}} {{#operation}} {{#summary}} -// {{{summary}}} +// {{{.}}} // {{/summary}} {{#notes}} -// {{{notes}}} +// {{{.}}} // {{/notes}} {{#returnType}}{{#returnTypeIsPrimitive}}{{#returnSimpleType}}{{{.}}}*{{/returnSimpleType}}{{^returnSimpleType}}{{#isArray}}{{{.}}}_t*{{/isArray}}{{#isMap}}{{{.}}}{{/isMap}}{{/returnSimpleType}}{{/returnTypeIsPrimitive}}{{^returnTypeIsPrimitive}}{{{.}}}_t*{{/returnTypeIsPrimitive}}{{/returnType}}{{^returnType}}void{{/returnType}} diff --git a/modules/openapi-generator/src/main/resources/C-libcurl/api-header.mustache b/modules/openapi-generator/src/main/resources/C-libcurl/api-header.mustache index 961e33a9d95..ecc80212afc 100644 --- a/modules/openapi-generator/src/main/resources/C-libcurl/api-header.mustache +++ b/modules/openapi-generator/src/main/resources/C-libcurl/api-header.mustache @@ -25,11 +25,11 @@ typedef enum { {{projectName}}_{{operationId}}_{{enumName}}_NULL = 0{{#enumVars {{#operations}} {{#operation}} {{#summary}} -// {{{summary}}} +// {{{.}}} // {{/summary}} {{#notes}} -// {{{notes}}} +// {{{.}}} // {{/notes}} {{#returnType}}{{#returnTypeIsPrimitive}}{{#returnSimpleType}}{{{.}}}*{{/returnSimpleType}}{{^returnSimpleType}}{{#isArray}}{{{.}}}_t*{{/isArray}}{{#isMap}}{{{.}}}{{/isMap}}{{/returnSimpleType}}{{/returnTypeIsPrimitive}}{{^returnTypeIsPrimitive}}{{{.}}}_t*{{/returnTypeIsPrimitive}}{{/returnType}}{{^returnType}}void{{/returnType}} diff --git a/modules/openapi-generator/src/main/resources/C-libcurl/api_doc.mustache b/modules/openapi-generator/src/main/resources/C-libcurl/api_doc.mustache index f249302c23d..54dfa08df3c 100644 --- a/modules/openapi-generator/src/main/resources/C-libcurl/api_doc.mustache +++ b/modules/openapi-generator/src/main/resources/C-libcurl/api_doc.mustache @@ -1,11 +1,11 @@ # {{classname}}{{#description}} -{{description}}{{/description}} +{{.}}{{/description}} All URIs are relative to *{{basePath}}* Method | HTTP request | Description ------------- | ------------- | ------------- -{{#operations}}{{#operation}}[**{{classname}}_{{operationId}}**]({{classname}}.md#{{classname}}_{{operationId}}) | **{{httpMethod}}** {{path}} | {{#summary}}{{summary}}{{/summary}} +{{#operations}}{{#operation}}[**{{classname}}_{{operationId}}**]({{classname}}.md#{{classname}}_{{operationId}}) | **{{httpMethod}}** {{path}} | {{summary}} {{/operation}}{{/operations}} {{#operations}} @@ -13,11 +13,11 @@ Method | HTTP request | Description # **{{classname}}_{{{operationId}}}** ```c {{#summary}} -// {{{summary}}} +// {{{.}}} // {{/summary}} {{#notes}} -// {{{notes}}} +// {{{.}}} // {{/notes}} {{#returnType}}{{#returnTypeIsPrimitive}}{{#returnSimpleType}}{{{.}}}*{{/returnSimpleType}}{{^returnSimpleType}}{{#isArray}}{{{.}}}_t*{{/isArray}}{{#isMap}}{{{.}}}{{/isMap}}{{/returnSimpleType}}{{/returnTypeIsPrimitive}}{{^returnTypeIsPrimitive}}{{{.}}}_t*{{/returnTypeIsPrimitive}}{{/returnType}}{{^returnType}}void{{/returnType}} {{{classname}}}_{{{operationId}}}(apiClient_t *apiClient{{#allParams}}, {{#isPrimitiveType}}{{#isNumber}}{{{dataType}}}{{/isNumber}}{{#isLong}}{{{dataType}}}{{/isLong}}{{#isInteger}}{{{dataType}}}{{/isInteger}}{{#isDouble}}{{{dataType}}}{{/isDouble}}{{#isFloat}}{{{dataType}}}{{/isFloat}}{{#isBoolean}}{{dataType}}{{/isBoolean}}{{#isEnum}}{{#isString}}{{projectName}}_{{operationId}}_{{baseName}}_e{{/isString}}{{/isEnum}}{{^isEnum}}{{#isString}}{{{dataType}}} *{{/isString}}{{/isEnum}}{{#isByteArray}}{{{dataType}}} *{{/isByteArray}}{{#isDate}}{{{dataType}}}{{/isDate}}{{#isDateTime}}{{{dataType}}}{{/isDateTime}}{{#isFile}}{{{dataType}}}{{/isFile}}{{#isFreeFormObject}}{{dataType}}_t *{{/isFreeFormObject}}{{/isPrimitiveType}}{{^isArray}}{{^isPrimitiveType}}{{#isModel}}{{#isEnum}}{{datatypeWithEnum}}_e{{/isEnum}}{{^isEnum}}{{{dataType}}}_t *{{/isEnum}}{{/isModel}}{{^isModel}}{{#isEnum}}{{datatypeWithEnum}}_e{{/isEnum}}{{/isModel}}{{#isUuid}}{{dataType}} *{{/isUuid}}{{#isEmail}}{{dataType}}{{/isEmail}}{{/isPrimitiveType}}{{/isArray}}{{#isContainer}}{{#isArray}}{{dataType}}_t *{{/isArray}}{{#isMap}}{{dataType}}{{/isMap}}{{/isContainer}} {{{paramName}}}{{/allParams}}); @@ -26,9 +26,9 @@ Method | HTTP request | Description ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**apiClient** | **apiClient_t \*** | context containing the client configuration | +**apiClient** | **apiClient_t \*** | context containing the client configuration | {{#allParams}} -**{{paramName}}** | {{#isPrimitiveType}}{{#isNumber}}**{{{dataType}}}**{{/isNumber}}{{#isLong}}**{{{dataType}}}**{{/isLong}}{{#isInteger}}**{{{dataType}}}**{{/isInteger}}{{#isDouble}}**{{{dataType}}}**{{/isDouble}}{{#isFloat}}**{{{dataType}}}**{{/isFloat}}{{#isBoolean}}**{{dataType}}**{{/isBoolean}}{{#isEnum}}{{#isString}}**{{projectName}}_{{operationId}}_{{baseName}}_e**{{/isString}}{{/isEnum}}{{^isEnum}}{{#isString}}**{{{dataType}}} \***{{/isString}}{{/isEnum}}{{#isByteArray}}**{{{dataType}}} \***{{/isByteArray}}{{#isDate}}**{{{dataType}}}**{{/isDate}}{{#isDateTime}}**{{{dataType}}}**{{/isDateTime}}{{#isFile}}**{{{dataType}}}**{{/isFile}}{{#isFreeFormObject}}**[{{dataType}}_t]({{baseType}}.md) \***{{/isFreeFormObject}}{{/isPrimitiveType}}{{^isArray}}{{^isPrimitiveType}}{{#isModel}}{{#isEnum}}**{{datatypeWithEnum}}_e**{{/isEnum}}{{^isEnum}}**[{{{dataType}}}_t]({{{baseType}}}.md) \***{{/isEnum}}{{/isModel}}{{^isModel}}{{#isEnum}}**{{datatypeWithEnum}}_e**{{/isEnum}}{{/isModel}}{{#isUuid}}**{{dataType}} \***{{/isUuid}}{{#isEmail}}**{{dataType}}**{{/isEmail}}{{/isPrimitiveType}}{{/isArray}}{{#isContainer}}{{#isArray}}**[{{dataType}}_t]({{baseType}}.md) \***{{/isArray}}{{#isMap}}**{{dataType}}**{{/isMap}}{{/isContainer}} | {{description}} | {{^required}}[optional] {{/required}}{{#defaultValue}}[default to {{defaultValue}}]{{/defaultValue}} +**{{paramName}}** | {{#isPrimitiveType}}{{#isNumber}}**{{{dataType}}}**{{/isNumber}}{{#isLong}}**{{{dataType}}}**{{/isLong}}{{#isInteger}}**{{{dataType}}}**{{/isInteger}}{{#isDouble}}**{{{dataType}}}**{{/isDouble}}{{#isFloat}}**{{{dataType}}}**{{/isFloat}}{{#isBoolean}}**{{dataType}}**{{/isBoolean}}{{#isEnum}}{{#isString}}**{{projectName}}_{{operationId}}_{{baseName}}_e**{{/isString}}{{/isEnum}}{{^isEnum}}{{#isString}}**{{{dataType}}} \***{{/isString}}{{/isEnum}}{{#isByteArray}}**{{{dataType}}} \***{{/isByteArray}}{{#isDate}}**{{{dataType}}}**{{/isDate}}{{#isDateTime}}**{{{dataType}}}**{{/isDateTime}}{{#isFile}}**{{{dataType}}}**{{/isFile}}{{#isFreeFormObject}}**[{{dataType}}_t]({{baseType}}.md) \***{{/isFreeFormObject}}{{/isPrimitiveType}}{{^isArray}}{{^isPrimitiveType}}{{#isModel}}{{#isEnum}}**{{datatypeWithEnum}}_e**{{/isEnum}}{{^isEnum}}**[{{{dataType}}}_t]({{{baseType}}}.md) \***{{/isEnum}}{{/isModel}}{{^isModel}}{{#isEnum}}**{{datatypeWithEnum}}_e**{{/isEnum}}{{/isModel}}{{#isUuid}}**{{dataType}} \***{{/isUuid}}{{#isEmail}}**{{dataType}}**{{/isEmail}}{{/isPrimitiveType}}{{/isArray}}{{#isContainer}}{{#isArray}}**[{{dataType}}_t]({{baseType}}.md) \***{{/isArray}}{{#isMap}}**{{dataType}}**{{/isMap}}{{/isContainer}} | {{description}} | {{^required}}[optional] {{/required}}{{#defaultValue}}[default to {{.}}]{{/defaultValue}} {{/allParams}} ### Return type diff --git a/modules/openapi-generator/src/main/resources/C-libcurl/model_test.mustache b/modules/openapi-generator/src/main/resources/C-libcurl/model_test.mustache index e7c0a817cd9..7da1371819e 100644 --- a/modules/openapi-generator/src/main/resources/C-libcurl/model_test.mustache +++ b/modules/openapi-generator/src/main/resources/C-libcurl/model_test.mustache @@ -27,14 +27,14 @@ {{classname}}_t* {{classname}} = NULL; if (include_optional) { {{classname}} = {{classname}}_create( -{{#vars}} {{#isEnum}}{{^isContainer}}{{#example}}{{projectName}}_{{classVarName}}_{{enumName}}_{{{.}}}{{/example}}{{/isContainer}}{{#isContainer}}{{#example}}{{{.}}}{{/example}}{{/isContainer}}{{/isEnum}}{{^isEnum}}{{#example}}{{{.}}}{{/example}}{{/isEnum}}{{^example}}{{#isModel}}{{#isEnum}}// enum {{datatypeWithEnum}}_e Work in Progress +{{#vars}} {{#isEnum}}{{^isContainer}}{{#example}}{{projectName}}_{{classVarName}}_{{enumName}}_{{{.}}}{{/example}}{{/isContainer}}{{#isContainer}}{{{example}}}{{/isContainer}}{{/isEnum}}{{^isEnum}}{{{example}}}{{/isEnum}}{{^example}}{{#isModel}}{{#isEnum}}// enum {{datatypeWithEnum}}_e Work in Progress {{/isEnum}}{{^isEnum}} // false, not to have infinite recursion instantiate_{{{dataType}}}(0){{/isEnum}}{{/isModel}}{{^isModel}}0{{/isModel}}{{/example}}{{^-last}},{{/-last}} {{/vars}} ); } else { {{classname}} = {{classname}}_create( -{{#vars}} {{#isEnum}}{{^isContainer}}{{#example}}{{projectName}}_{{classVarName}}_{{enumName}}_{{{.}}}{{/example}}{{/isContainer}}{{#isContainer}}{{#example}}{{{.}}}{{/example}}{{/isContainer}}{{/isEnum}}{{^isEnum}}{{#example}}{{{.}}}{{/example}}{{/isEnum}}{{^example}}{{#isModel}}{{#isEnum}}// enum {{datatypeWithEnum}}_e Work in Progress +{{#vars}} {{#isEnum}}{{^isContainer}}{{#example}}{{projectName}}_{{classVarName}}_{{enumName}}_{{{.}}}{{/example}}{{/isContainer}}{{#isContainer}}{{{example}}}{{/isContainer}}{{/isEnum}}{{^isEnum}}{{{example}}}{{/isEnum}}{{^example}}{{#isModel}}{{#isEnum}}// enum {{datatypeWithEnum}}_e Work in Progress {{/isEnum}}{{^isEnum}}NULL{{/isEnum}}{{/isModel}}{{^isModel}}0{{/isModel}}{{/example}}{{^-last}},{{/-last}} {{/vars}} ); diff --git a/modules/openapi-generator/src/main/resources/Eiffel/README.mustache b/modules/openapi-generator/src/main/resources/Eiffel/README.mustache index 0d292c5d720..54459f5fd81 100644 --- a/modules/openapi-generator/src/main/resources/Eiffel/README.mustache +++ b/modules/openapi-generator/src/main/resources/Eiffel/README.mustache @@ -1,7 +1,7 @@ # Eiffel API client for {{packageName}} {{#appDescriptionWithNewLines}} -{{{appDescriptionWithNewLines}}} +{{{.}}} {{/appDescriptionWithNewLines}} ## Overview @@ -29,7 +29,7 @@ All URIs are relative to *{{basePath}}* Class | Method | HTTP request | Description ------------ | ------------- | ------------- | ------------- -{{#apiInfo}}{{#apis}}{{#operations}}{{#operation}}*{{classname}}* | [**{{operationId}}**]({{apiDocPath}}/{{classname}}.md#{{operationIdLowerCase}}) | **{{httpMethod}}** {{path}} | {{#summary}}{{summary}}{{/summary}} +{{#apiInfo}}{{#apis}}{{#operations}}{{#operation}}*{{classname}}* | [**{{operationId}}**]({{apiDocPath}}/{{classname}}.md#{{operationIdLowerCase}}) | **{{httpMethod}}** {{path}} | {{summary}} {{/operation}}{{/operations}}{{/apis}}{{/apiInfo}} ## Documentation For Models @@ -43,7 +43,7 @@ Class | Method | HTTP request | Description {{/authMethods}}{{#authMethods}}{{#last}} Authentication schemes defined for the API:{{/last}}{{/authMethods}} {{#authMethods}}## {{{name}}} -{{#isApiKey}}- **Type**: API key +{{#isApiKey}}- **Type**: API key - **API key parameter name**: {{{keyParamName}}} - **Location**: {{#isKeyInQuery}}URL query string{{/isKeyInQuery}}{{#isKeyInHeader}}HTTP header{{/isKeyInHeader}} {{/isApiKey}} diff --git a/modules/openapi-generator/src/main/resources/Eiffel/api.mustache b/modules/openapi-generator/src/main/resources/Eiffel/api.mustache index be029f379d3..7479b9dcd9f 100644 --- a/modules/openapi-generator/src/main/resources/Eiffel/api.mustache +++ b/modules/openapi-generator/src/main/resources/Eiffel/api.mustache @@ -13,25 +13,25 @@ feature -- API Access {{#operation}} - {{operationId}} {{#hasParams}}({{#allParams}}{{paramName}}: {{#required}}{{{dataType}}}{{/required}}{{^required}}{{#isPrimitiveType}}{{{dataType}}}{{/isPrimitiveType}}{{^isPrimitiveType}}detachable {{{dataType}}}{{/isPrimitiveType}}{{/required}}{{^-last}}; {{/-last}}{{/allParams}}){{/hasParams}}{{#returnType}}: detachable {{{returnType}}}{{/returnType}}{{^returnType}}{{/returnType}} + {{operationId}} {{#hasParams}}({{#allParams}}{{paramName}}: {{#required}}{{{dataType}}}{{/required}}{{^required}}{{#isPrimitiveType}}{{{dataType}}}{{/isPrimitiveType}}{{^isPrimitiveType}}detachable {{{dataType}}}{{/isPrimitiveType}}{{/required}}{{^-last}}; {{/-last}}{{/allParams}}){{/hasParams}}{{#returnType}}: detachable {{{.}}}{{/returnType}} -- {{summary}} -- {{notes}} -- {{#allParams}} -- argument: {{paramName}} {{description}}{{#required}} (required){{/required}}{{^required}} (optional{{#defaultValue}}, default to {{{.}}}{{/defaultValue}}){{/required}} -- {{/allParams}} -- {{#returnType}} - -- Result {{returnType}}{{/returnType}} + -- Result {{.}}{{/returnType}} require - {{#allParams}} + {{#allParams}} {{#hasValidation}} {{#maximum}} - {{{paramName}}}_is_less_or_equal_than: {{{paramName}}} <= {{{maximum}}} + {{{paramName}}}_is_less_or_equal_than: {{{paramName}}} <= {{{maximum}}} {{/maximum}} {{#minimum}} - {{{paramName}}}_is_greater_or_equal_than: {{{paramName}}} >= {{{minimum}}} + {{{paramName}}}_is_greater_or_equal_than: {{{paramName}}} >= {{{minimum}}} {{/minimum}} {{/hasValidation}} - {{/allParams}} + {{/allParams}} local l_path: STRING l_request: API_CLIENT_REQUEST @@ -45,7 +45,7 @@ feature -- API Access l_path.replace_substring_all ("{"+"{{baseName}}"+"}", api_client.url_encode ({{{paramName}}}.out)) {{/pathParams}} {{#queryParams}} - l_request.fill_query_params(api_client.parameter_to_tuple("{{#collectionFormat}}{{{collectionFormat}}}{{/collectionFormat}}", "{{baseName}}", {{paramName}})); + l_request.fill_query_params(api_client.parameter_to_tuple("{{{collectionFormat}}}", "{{baseName}}", {{paramName}})); {{/queryParams}} {{#headerParams}} @@ -65,7 +65,7 @@ feature -- API Access l_request.add_header(api_client.select_header_content_type ({ARRAY [STRING]}<<{{#consumes}}"{{{mediaType}}}"{{^-last}}, {{/-last}}{{/consumes}}>>),"Content-Type") l_request.set_auth_names ({ARRAY [STRING]}<<{{#authMethods}}"{{name}}"{{^-last}}, {{/-last}}{{/authMethods}}>>) l_response := api_client.call_api (l_path, "{{httpMethod}}", l_request, {{#returnType}}Void{{/returnType}}{{^returnType}}agent serializer{{/returnType}}, {{#returnType}}agent deserializer{{/returnType}}{{^returnType}}Void{{/returnType}}) - {{#returnType}} + {{#returnType}} if l_response.has_error then last_error := l_response.error elseif attached { {{{returnType}}} } l_response.data ({ {{{returnType}}} }) as l_data then @@ -79,7 +79,7 @@ feature -- API Access last_error := l_response.error end {{/returnType}} - end + end {{/operation}} diff --git a/modules/openapi-generator/src/main/resources/Eiffel/api_client.mustache b/modules/openapi-generator/src/main/resources/Eiffel/api_client.mustache index 1ca86a49e38..42899ca28c6 100644 --- a/modules/openapi-generator/src/main/resources/Eiffel/api_client.mustache +++ b/modules/openapi-generator/src/main/resources/Eiffel/api_client.mustache @@ -1,4 +1,4 @@ -{{>noteinfo}} +{{>noteinfo}} class API_CLIENT @@ -14,13 +14,13 @@ feature {NONE} -- Initialization set_base_path (default_base_path) --set default user_agent - set_user_agent("{{#httpUserAgent}}{{{.}}}{{/httpUserAgent}}{{^httpUserAgent}}OpenAPI-Generator/{{{artifactVersion}}}/Eiffel{{/httpUserAgent}}"); + set_user_agent("{{{httpUserAgent}}}{{^httpUserAgent}}OpenAPI-Generator/{{{artifactVersion}}}/Eiffel{{/httpUserAgent}}"); create authentications.make (3) {{#authMethods}}{{#isBasic}} - authentications.force (create {HTTP_BASIC_AUTH}, "{{name}}") + authentications.force (create {HTTP_BASIC_AUTH}, "{{name}}") is_basic_auth_configured := True {{/isBasic}}{{#isApiKey}} - authentications.force (create {API_KEY_AUTH}.make ({{#isKeyInHeader}}"header"{{/isKeyInHeader}}{{^isKeyInHeader}}"query"{{/isKeyInHeader}}, "{{keyParamName}}"), "{{name}}") - is_api_key_configured := True {{/isApiKey}}{{#isOAuth}} + authentications.force (create {API_KEY_AUTH}.make ({{#isKeyInHeader}}"header"{{/isKeyInHeader}}{{^isKeyInHeader}}"query"{{/isKeyInHeader}}, "{{keyParamName}}"), "{{name}}") + is_api_key_configured := True {{/isApiKey}}{{#isOAuth}} authentications.force (create {OAUTH},"{{name}}") is_oauth_configured := True {{/isOAuth}}{{/authMethods}} end @@ -42,7 +42,7 @@ feature -- Status Report -- is basic auth configured. is_api_key_configured: BOOLEAN - -- is api key auth configured. + -- is api key auth configured. is_oauth_configured: BOOLEAN -- is oauth configured. @@ -138,7 +138,7 @@ feature -- Query Parameter Helpers if attached {LIST [ANY]} a_value as a_list then -- Collection if a_list.is_empty then - -- Return an empty list + -- Return an empty list create {ARRAYED_LIST [TUPLE [name: STRING; value: STRING]]} Result.make (0) else -- collection format: multi, csv, ssv, tsv, pipes. @@ -312,7 +312,7 @@ feature --Helper: Http Client -- Url encode `a_val' do Result := (create {URL_ENCODER}).encoded_string (a_val) - end + end feature -- HTTP client: call api @@ -373,9 +373,9 @@ feature -- HTTP client: call api then -- Serialize an object `a_body' to content-type `l_type' -- if not support by default you will need to extend - -- the target API with the corresponding implementation. + -- the target API with the corresponding implementation. l_context_executor.set_upload_data((create {API_SERIALIZER}).serializer (l_custom_serializer, l_content_type, l_body)) - end + end end if @@ -514,7 +514,7 @@ feature {NONE} -- Implementation sess.set_is_debug (True) end debug ("proxy8888") - sess.set_proxy ("127.0.0.1", 8888) --| inspect traffic with http://www.fiddler2.com/ + sess.set_proxy ("127.0.0.1", 8888) --| inspect traffic with http://www.fiddler2.com/ end end end diff --git a/modules/openapi-generator/src/main/resources/Eiffel/api_doc.mustache b/modules/openapi-generator/src/main/resources/Eiffel/api_doc.mustache index 461ee1047aa..01382a9c77a 100644 --- a/modules/openapi-generator/src/main/resources/Eiffel/api_doc.mustache +++ b/modules/openapi-generator/src/main/resources/Eiffel/api_doc.mustache @@ -1,29 +1,29 @@ # {{classname}}{{#description}} -{{description}}{{/description}} +{{.}}{{/description}} All URIs are relative to *{{basePath}}* Feature | HTTP request | Description ------------- | ------------- | ------------- -{{#operations}}{{#operation}}[**{{operationId}}**]({{classname}}.md#{{operationId}}) | **{{httpMethod}}** {{path}} | {{#summary}}{{summary}}{{/summary}} +{{#operations}}{{#operation}}[**{{operationId}}**]({{classname}}.md#{{operationId}}) | **{{httpMethod}}** {{path}} | {{summary}} {{/operation}}{{/operations}} {{#operations}} {{#operation}} # **{{{operationId}}}** -> {{operationId}} {{#hasParams}}({{#allParams}}{{paramName}}: {{#required}}{{{dataType}}}{{/required}}{{^required}} detachable {{{dataType}}}{{/required}} {{^-last}}; {{/-last}}{{/allParams}}){{/hasParams}}{{#returnType}}: detachable {{{returnType}}}{{/returnType}}{{^returnType}}{{/returnType}} - +> {{operationId}} {{#hasParams}}({{#allParams}}{{paramName}}: {{#required}}{{{dataType}}}{{/required}}{{^required}} detachable {{{dataType}}}{{/required}} {{^-last}}; {{/-last}}{{/allParams}}){{/hasParams}}{{#returnType}}: detachable {{{.}}}{{/returnType}} + {{{summary}}}{{#notes}} -{{{notes}}}{{/notes}} +{{{.}}}{{/notes}} ### Parameters {{^allParams}}This endpoint does not need any parameter.{{/allParams}}{{#allParams}}{{#-last}} Name | Type | Description | Notes ------------- | ------------- | ------------- | -------------{{/-last}}{{/allParams}} -{{#allParams}} **{{paramName}}** | {{#isPrimitiveType}}**{{dataType}}**{{/isPrimitiveType}}{{^isPrimitiveType}}[**{{dataType}}**]({{baseType}}.md){{/isPrimitiveType}}| {{description}} | {{^required}}[optional] {{/required}}{{#defaultValue}}[default to {{defaultValue}}]{{/defaultValue}} +{{#allParams}} **{{paramName}}** | {{#isPrimitiveType}}**{{dataType}}**{{/isPrimitiveType}}{{^isPrimitiveType}}[**{{dataType}}**]({{baseType}}.md){{/isPrimitiveType}}| {{description}} | {{^required}}[optional] {{/required}}{{#defaultValue}}[default to {{.}}]{{/defaultValue}} {{/allParams}} ### Return type diff --git a/modules/openapi-generator/src/main/resources/Eiffel/ecf.mustache b/modules/openapi-generator/src/main/resources/Eiffel/ecf.mustache index 13720007773..3f0b5f7f5e1 100644 --- a/modules/openapi-generator/src/main/resources/Eiffel/ecf.mustache +++ b/modules/openapi-generator/src/main/resources/Eiffel/ecf.mustache @@ -1,5 +1,5 @@ - + @@ -10,7 +10,7 @@ + diff --git a/modules/openapi-generator/src/main/resources/Eiffel/framework/api_client_request.mustache b/modules/openapi-generator/src/main/resources/Eiffel/framework/api_client_request.mustache index 53aa9a63eed..9ca03c295f7 100644 --- a/modules/openapi-generator/src/main/resources/Eiffel/framework/api_client_request.mustache +++ b/modules/openapi-generator/src/main/resources/Eiffel/framework/api_client_request.mustache @@ -52,22 +52,22 @@ feature -- Change Element -- with `key'. do header_params.force (new, key) - end + end add_form (new: ANY; key: READABLE_STRING_GENERAL) -- Update `form_params' so that `new' will be the item associated -- with `key'. do form_params.force (new, key) - end + end set_body (a_body: like body) -- Set 'body' with 'a_body'. do body := a_body ensure - body_set: body = a_body - end + body_set: body = a_body + end set_auth_names (a_auth_names: like auth_names) -- Set 'auth_names' with 'a_auth_names'. @@ -75,5 +75,5 @@ feature -- Change Element auth_names := a_auth_names ensure auth_names_set: auth_names = a_auth_names - end + end end diff --git a/modules/openapi-generator/src/main/resources/Eiffel/framework/api_i.mustache b/modules/openapi-generator/src/main/resources/Eiffel/framework/api_i.mustache index 6b09f4c639e..e358ab661fe 100644 --- a/modules/openapi-generator/src/main/resources/Eiffel/framework/api_i.mustache +++ b/modules/openapi-generator/src/main/resources/Eiffel/framework/api_i.mustache @@ -84,7 +84,7 @@ feature -- Deserializer create err err.set_description ("Deserialization is not supported by default you will need to add it by hand.") err.raise - end + end end diff --git a/modules/openapi-generator/src/main/resources/Eiffel/framework/auth/authentication.mustache b/modules/openapi-generator/src/main/resources/Eiffel/framework/auth/authentication.mustache index 9367ba5eee9..6389ccf9f95 100644 --- a/modules/openapi-generator/src/main/resources/Eiffel/framework/auth/authentication.mustache +++ b/modules/openapi-generator/src/main/resources/Eiffel/framework/auth/authentication.mustache @@ -1,4 +1,4 @@ -{{>noteinfo}} +{{>noteinfo}} deferred class AUTHENTICATION diff --git a/modules/openapi-generator/src/main/resources/Eiffel/framework/auth/http_basic_auth.mustache b/modules/openapi-generator/src/main/resources/Eiffel/framework/auth/http_basic_auth.mustache index 4df2e875fe4..f3f6c126e63 100644 --- a/modules/openapi-generator/src/main/resources/Eiffel/framework/auth/http_basic_auth.mustache +++ b/modules/openapi-generator/src/main/resources/Eiffel/framework/auth/http_basic_auth.mustache @@ -15,7 +15,7 @@ feature -- Access password: detachable STRING_32 -- Password. -feature -- Element Change +feature -- Element Change set_user_name (a_name: STRING_32) -- Set `user_name' with `a_name'. diff --git a/modules/openapi-generator/src/main/resources/Eiffel/framework/serialization/api_json_custom_deserializer.mustache b/modules/openapi-generator/src/main/resources/Eiffel/framework/serialization/api_json_custom_deserializer.mustache index 393d291f05d..b8db90a81a5 100644 --- a/modules/openapi-generator/src/main/resources/Eiffel/framework/serialization/api_json_custom_deserializer.mustache +++ b/modules/openapi-generator/src/main/resources/Eiffel/framework/serialization/api_json_custom_deserializer.mustache @@ -2,37 +2,37 @@ note description: "[ Object Helper to deserialize a string in JSON format to an object in the domain model How to write a converter. Suppose we have the following class - + PERSON - id: INTEGER_64 + id: INTEGER_64 name: STRING address: ADDRESS hobbies: LIST [STRING] photos: LIST [PHOTOS] - + conversion: First go to the feature from_json_to_`model' and then start to set the object attibures as follow. - + STRING, INTEGER, etc use the following pattern - + Result.set_id (integer_64_value_from_json (a_json, "id")) Result.set_name (string_value_from_json (a_json, "name")) - + OBJECTS When you have an attribute that's an object itself (part of the domain) you will need to first get JSON_OBJECT to the corresponding attribute and then use the related feature `from_json_to_model' in this case from_json_to_address (l_address) - + if attached {JSON_OBJECT} json_value (a_json, "address") as l_address then Result.set_address(from_json_to_address (l_address)) - end - + end + LIST [STRING] or other simple types. - + In the case of a list of string we need to do something similar but we need to traverse the array We will need a local variable to build the lists. - + if attached {JSON_ARRAY} json_value (a_json, "hobbies") as l_array then create {ARRAYED_LIST [STRING]} l_hobbies.make (l_array.count) across l_array as ic loop @@ -41,13 +41,13 @@ note end end Result.set_hobbies (l_hobbies) - end - + end + LIST [PHOTOS] This case is similar to the previous, but in this case the element is - an object, so we will need to use the feature `from_json_to_model', here + an object, so we will need to use the feature `from_json_to_model', here we again need a local variable to build a temporary list of photos. - + if attached {JSON_ARRAY} json_value (a_json, "photos") as l_array then create {ARRAYED_LIST [PHOTOS]} l_photos.make (l_array.count) across diff --git a/modules/openapi-generator/src/main/resources/Eiffel/framework/serialization/json_basic_reflector_deserializer.mustache b/modules/openapi-generator/src/main/resources/Eiffel/framework/serialization/json_basic_reflector_deserializer.mustache index 3a6f2b04c8b..ebd05951b38 100644 --- a/modules/openapi-generator/src/main/resources/Eiffel/framework/serialization/json_basic_reflector_deserializer.mustache +++ b/modules/openapi-generator/src/main/resources/Eiffel/framework/serialization/json_basic_reflector_deserializer.mustache @@ -50,7 +50,7 @@ feature -- Cleaning fields_infos_by_type_id := Void end -feature {NONE} -- Helpers : Array +feature {NONE} -- Helpers : Array reference_from_json_array (a_json: JSON_ARRAY; ctx: JSON_DESERIALIZER_CONTEXT; a_type: detachable TYPE [detachable ANY]): detachable ANY do @@ -263,7 +263,7 @@ feature {NONE} -- Helpers : Array end end -feature {NONE} -- Helpers: Object +feature {NONE} -- Helpers: Object type_name_from_json_object (a_json_object: JSON_OBJECT): detachable READABLE_STRING_32 do @@ -364,7 +364,7 @@ feature {NONE} -- Helpers: Object end end -feature {NONE} -- Helpers: Basic values +feature {NONE} -- Helpers: Basic values boolean_from_json (v: JSON_VALUE): BOOLEAN do diff --git a/modules/openapi-generator/src/main/resources/Eiffel/framework/serialization/json_type_utilities_ext.mustache b/modules/openapi-generator/src/main/resources/Eiffel/framework/serialization/json_type_utilities_ext.mustache index bcc1c27d28f..3424f270afb 100644 --- a/modules/openapi-generator/src/main/resources/Eiffel/framework/serialization/json_type_utilities_ext.mustache +++ b/modules/openapi-generator/src/main/resources/Eiffel/framework/serialization/json_type_utilities_ext.mustache @@ -11,7 +11,7 @@ inherit JSON_TYPE_UTILITIES -feature -- Factory +feature -- Factory new_special_for_name (a_type_name: READABLE_STRING_GENERAL; count: INTEGER): detachable SPECIAL [detachable ANY] do diff --git a/modules/openapi-generator/src/main/resources/Eiffel/model.mustache b/modules/openapi-generator/src/main/resources/Eiffel/model.mustache index 3d00ca47b4f..b1f66ca0cf3 100644 --- a/modules/openapi-generator/src/main/resources/Eiffel/model.mustache +++ b/modules/openapi-generator/src/main/resources/Eiffel/model.mustache @@ -1,4 +1,4 @@ -class {{classname}} +class {{classname}} {{#parent}} inherit @@ -7,15 +7,15 @@ inherit {{#parent}} {{{parent}}} - {{^isPrimitiveType}} + {{^isPrimitiveType}} {{^isMap}} {{^isArray}} rename - output as out_{{{parentSchema}}} + output as out_{{{parentSchema}}} end {{/isArray}} {{/isMap}} - {{/isPrimitiveType}} + {{/isPrimitiveType}} {{/parent}} feature --Access @@ -24,31 +24,31 @@ feature --Access {{^isInherited}} {{#isPrimitiveType}} {{^isContainer}} - {{name}}: {{{dataType}}} - {{#description}}-- {{{description}}}{{/description}} - {{/isContainer}} + {{name}}: {{{dataType}}} + {{#description}}-- {{{.}}}{{/description}} + {{/isContainer}} {{/isPrimitiveType}} {{#isPrimitiveType}} {{#isContainer}} - {{name}}: detachable {{{datatypeWithEnum}}} - {{#description}}-- {{{description}}}{{/description}} - {{/isContainer}} + {{name}}: detachable {{{datatypeWithEnum}}} + {{#description}}-- {{{.}}}{{/description}} + {{/isContainer}} {{/isPrimitiveType}} {{^isPrimitiveType}} {{#isContainer}} - {{name}}: detachable {{{datatypeWithEnum}}} - {{#description}}-- {{{description}}}{{/description}} + {{name}}: detachable {{{datatypeWithEnum}}} + {{#description}}-- {{{.}}}{{/description}} {{/isContainer}} {{^isContainer}} - {{name}}: detachable {{{dataType}}} - {{#description}}-- {{{description}}}{{/description}} + {{name}}: detachable {{{dataType}}} + {{#description}}-- {{{.}}}{{/description}} {{/isContainer}} {{/isPrimitiveType}} {{/isInherited}} {{/vars}} -feature -- Change Element - +feature -- Change Element + {{#vars}} {{^isInherited}} set_{{name}} (a_name: like {{name}}) @@ -56,7 +56,7 @@ feature -- Change Element do {{name}} := a_name ensure - {{name}}_set: {{name}} = a_name + {{name}}_set: {{name}} = a_name end {{/isInherited}} @@ -72,7 +72,7 @@ feature -- Change Element Result.append(out_{{{parentSchema}}}) {{/parent}} Result.append("%Nclass {{classname}}%N") - {{#vars}} + {{#vars}} {{^isInherited}} {{#isArray}} if attached {{name}} as l_{{name}} then @@ -81,7 +81,7 @@ feature -- Change Element Result.append (ic.item.out) Result.append ("%N") end - end + end {{/isArray}} {{#isMap}} if attached {{name}} as l_{{name}} then @@ -95,14 +95,14 @@ feature -- Change Element Result.append (ic.item.out) Result.append ("%N") end - end + end {{/isMap}} {{^isContainer}} if attached {{name}} as l_{{name}} then Result.append ("%N{{name}}:") Result.append (l_{{name}}.out) - Result.append ("%N") - end + Result.append ("%N") + end {{/isContainer}} {{/isInherited}} {{/vars}} diff --git a/modules/openapi-generator/src/main/resources/Eiffel/model_enum.mustache b/modules/openapi-generator/src/main/resources/Eiffel/model_enum.mustache index 7ec1a444db7..7ae3596874e 100644 --- a/modules/openapi-generator/src/main/resources/Eiffel/model_enum.mustache +++ b/modules/openapi-generator/src/main/resources/Eiffel/model_enum.mustache @@ -1,4 +1,4 @@ -class {{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}} +class {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}} feature -- Access diff --git a/modules/openapi-generator/src/main/resources/Eiffel/model_generic.mustache b/modules/openapi-generator/src/main/resources/Eiffel/model_generic.mustache index 1a83370f8d2..ef236e97f38 100644 --- a/modules/openapi-generator/src/main/resources/Eiffel/model_generic.mustache +++ b/modules/openapi-generator/src/main/resources/Eiffel/model_generic.mustache @@ -4,4 +4,3 @@ {{#isEnum}}{{>model_enum}}{{/isEnum}}{{^isEnum}}{{>model}}{{/isEnum}} {{/model}} {{/models}} - diff --git a/modules/openapi-generator/src/main/resources/Eiffel/noteinfo.mustache b/modules/openapi-generator/src/main/resources/Eiffel/noteinfo.mustache index 505596b9e97..c3d9f2eeab4 100644 --- a/modules/openapi-generator/src/main/resources/Eiffel/noteinfo.mustache +++ b/modules/openapi-generator/src/main/resources/Eiffel/noteinfo.mustache @@ -2,8 +2,8 @@ note description:"[ {{{appName}}} {{{appDescription}}} - {{#version}}The version of the OpenAPI document: {{{version}}}{{/version}} - {{#infoEmail}}Contact: {{{infoEmail}}}{{/infoEmail}} + {{#version}}The version of the OpenAPI document: {{{.}}}{{/version}} + {{#infoEmail}}Contact: {{{.}}}{{/infoEmail}} NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/modules/openapi-generator/src/main/resources/Eiffel/test/api_test.mustache b/modules/openapi-generator/src/main/resources/Eiffel/test/api_test.mustache index c84e3ade1c6..efe2ddd5cda 100644 --- a/modules/openapi-generator/src/main/resources/Eiffel/test/api_test.mustache +++ b/modules/openapi-generator/src/main/resources/Eiffel/test/api_test.mustache @@ -14,14 +14,14 @@ feature -- Test routines {{#operations}} {{#operation}} - + test_{{operationId}} -- {{summary}} - -- - -- {{notes}} + -- + -- {{notes}} local {{#returnType}} - l_response: {{{returnType}}} + l_response: {{{.}}} {{/returnType}} {{#allParams}} l_{{paramName}}: {{{dataType}}} @@ -37,10 +37,10 @@ feature -- Test routines {{/isContainer}} {{^isContainer}} -- l_{{paramName}} - {{/isContainer}} + {{/isContainer}} {{/required}} {{/allParams}} - + {{#returnType}} -- l_response := api.{{operationId}}{{#hasParams}}({{#allParams}}l_{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}){{/hasParams}} {{/returnType}} @@ -56,7 +56,7 @@ feature {NONE} -- Implementation api: {{classname}} -- Create an object instance of `{{classname}}'. - once + once create { {{classname}} } Result end diff --git a/modules/openapi-generator/src/main/resources/Eiffel/test/ecf_test.mustache b/modules/openapi-generator/src/main/resources/Eiffel/test/ecf_test.mustache index 5e3d279e0b4..83d854d0836 100644 --- a/modules/openapi-generator/src/main/resources/Eiffel/test/ecf_test.mustache +++ b/modules/openapi-generator/src/main/resources/Eiffel/test/ecf_test.mustache @@ -10,7 +10,7 @@ + diff --git a/modules/openapi-generator/src/main/resources/Eiffel/travis.mustache b/modules/openapi-generator/src/main/resources/Eiffel/travis.mustache index 563530f458a..8d59017085d 100644 --- a/modules/openapi-generator/src/main/resources/Eiffel/travis.mustache +++ b/modules/openapi-generator/src/main/resources/Eiffel/travis.mustache @@ -6,11 +6,10 @@ before_script: - source ./eiffel.rc - echo `ec -version` - cd $current_dir - + # safelist branches: only: - master script: compile_all -ecb -melt -list_failures -clean -options dotnet=false - diff --git a/modules/openapi-generator/src/main/resources/Groovy/README.mustache b/modules/openapi-generator/src/main/resources/Groovy/README.mustache index 04ecc57787f..069ad55624b 100644 --- a/modules/openapi-generator/src/main/resources/Groovy/README.mustache +++ b/modules/openapi-generator/src/main/resources/Groovy/README.mustache @@ -1,14 +1,14 @@ # {{packageName}} {{#appDescriptionWithNewLines}} -{{{appDescriptionWithNewLines}}} +{{{.}}} {{/appDescriptionWithNewLines}} This Groovy package, using the [http-builder-ng library](https://http-builder-ng.github.io/http-builder-ng/), is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: - API version: {{appVersion}} {{#artifactVersion}} -- Package version: {{artifactVersion}} +- Package version: {{.}} {{/artifactVersion}} {{^hideGenerationTimestamp}} - Build date: {{generatedDate}} @@ -48,7 +48,7 @@ def apiInstance = new {{classname}}() apiInstance.{{{operationId}}}({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}) { // on success - {{#returnType}}def result = ({{returnType}})it + {{#returnType}}def result = ({{.}})it println result {{/returnType}} {{^returnType}}println it{{/returnType}} diff --git a/modules/openapi-generator/src/main/resources/Groovy/api.mustache b/modules/openapi-generator/src/main/resources/Groovy/api.mustache index 9829023e5f1..a7ee609852e 100644 --- a/modules/openapi-generator/src/main/resources/Groovy/api.mustache +++ b/modules/openapi-generator/src/main/resources/Groovy/api.mustache @@ -73,7 +73,7 @@ class {{classname}} { apiUtils.invokeApi(onSuccess, onFailure, basePath, versionPath, resourcePath, queryParams, headerParams, bodyParams, contentType, "{{httpMethod}}", "{{returnContainer}}", - {{#returnBaseType}}{{{returnBaseType}}}.class {{/returnBaseType}}{{^returnBaseType}}null {{/returnBaseType}}) + {{#returnBaseType}}{{{.}}}.class {{/returnBaseType}}{{^returnBaseType}}null {{/returnBaseType}}) } diff --git a/modules/openapi-generator/src/main/resources/Groovy/model.mustache b/modules/openapi-generator/src/main/resources/Groovy/model.mustache index e1821824d79..00cedcfd15a 100644 --- a/modules/openapi-generator/src/main/resources/Groovy/model.mustache +++ b/modules/openapi-generator/src/main/resources/Groovy/model.mustache @@ -10,8 +10,8 @@ import {{import}}; @Canonical class {{classname}} { {{#vars}} - {{#description}}/* {{{description}}} */{{/description}} - {{{dataType}}} {{name}}{{#defaultValue}} = {{{defaultValue}}}{{/defaultValue}} + {{#description}}/* {{{.}}} */{{/description}} + {{{dataType}}} {{name}}{{#defaultValue}} = {{{.}}}{{/defaultValue}} {{/vars}} } {{/model}} diff --git a/modules/openapi-generator/src/main/resources/Java/ApiClient.mustache b/modules/openapi-generator/src/main/resources/Java/ApiClient.mustache index d75e455961c..d00284aff9a 100644 --- a/modules/openapi-generator/src/main/resources/Java/ApiClient.mustache +++ b/modules/openapi-generator/src/main/resources/Java/ApiClient.mustache @@ -140,7 +140,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { dateFormat = ApiClient.buildDefaultDateFormat(); // Set default User-Agent. - setUserAgent("{{#httpUserAgent}}{{{.}}}{{/httpUserAgent}}{{^httpUserAgent}}OpenAPI-Generator/{{{artifactVersion}}}/java{{/httpUserAgent}}"); + setUserAgent("{{{httpUserAgent}}}{{^httpUserAgent}}OpenAPI-Generator/{{{artifactVersion}}}/java{{/httpUserAgent}}"); // Setup authentications (key: authentication name, value: authentication). authentications = new HashMap();{{#authMethods}}{{#isBasic}}{{#isBasicBasic}} diff --git a/modules/openapi-generator/src/main/resources/Java/BeanValidationException.mustache b/modules/openapi-generator/src/main/resources/Java/BeanValidationException.mustache index ab8ef30b69b..3fc5b845121 100644 --- a/modules/openapi-generator/src/main/resources/Java/BeanValidationException.mustache +++ b/modules/openapi-generator/src/main/resources/Java/BeanValidationException.mustache @@ -7,7 +7,7 @@ import javax.validation.ValidationException; public class BeanValidationException extends ValidationException { /** - * + * */ private static final long serialVersionUID = -5294733947409491364L; Set> violations; diff --git a/modules/openapi-generator/src/main/resources/Java/README.mustache b/modules/openapi-generator/src/main/resources/Java/README.mustache index fd9abd28241..cd2c7af3ee8 100644 --- a/modules/openapi-generator/src/main/resources/Java/README.mustache +++ b/modules/openapi-generator/src/main/resources/Java/README.mustache @@ -8,7 +8,7 @@ - Build date: {{generatedDate}} {{/hideGenerationTimestamp}} -{{#appDescriptionWithNewLines}}{{{appDescriptionWithNewLines}}}{{/appDescriptionWithNewLines}} +{{{appDescriptionWithNewLines}}} {{#infoUrl}} For more information, please visit [{{{infoUrl}}}]({{{infoUrl}}}) @@ -157,7 +157,7 @@ public class {{{classname}}}Example { {{{dataType}}} {{{paramName}}} = {{{example}}}; // {{{dataType}}} | {{{description}}} {{/allParams}} try { - {{#returnType}}{{{returnType}}} result = {{/returnType}}apiInstance.{{{operationId}}}({{#allParams}}{{{paramName}}}{{^-last}}, {{/-last}}{{/allParams}});{{#returnType}} + {{#returnType}}{{{.}}} result = {{/returnType}}apiInstance.{{{operationId}}}({{#allParams}}{{{paramName}}}{{^-last}}, {{/-last}}{{/allParams}});{{#returnType}} System.out.println(result);{{/returnType}} } catch (ApiException e) { System.err.println("Exception when calling {{{classname}}}#{{{operationId}}}"); @@ -177,7 +177,7 @@ All URIs are relative to *{{basePath}}* Class | Method | HTTP request | Description ------------ | ------------- | ------------- | ------------- -{{#apiInfo}}{{#apis}}{{#operations}}{{#operation}}*{{classname}}* | [**{{operationId}}**]({{apiDocPath}}{{classname}}.md#{{operationId}}) | **{{httpMethod}}** {{commonPath}}{{path}} | {{#summary}}{{summary}}{{/summary}} +{{#apiInfo}}{{#apis}}{{#operations}}{{#operation}}*{{classname}}* | [**{{operationId}}**]({{apiDocPath}}{{classname}}.md#{{operationId}}) | **{{httpMethod}}** {{commonPath}}{{path}} | {{summary}} {{/operation}}{{/operations}}{{/apis}}{{/apiInfo}} ## Documentation for Models diff --git a/modules/openapi-generator/src/main/resources/Java/api.mustache b/modules/openapi-generator/src/main/resources/Java/api.mustache index 894cb011239..28b18e2d16f 100644 --- a/modules/openapi-generator/src/main/resources/Java/api.mustache +++ b/modules/openapi-generator/src/main/resources/Java/api.mustache @@ -49,7 +49,7 @@ public class {{classname}} { * @param {{paramName}} {{description}}{{#required}} (required){{/required}}{{^required}} (optional{{^isContainer}}{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/isContainer}}{{/required}} {{/allParams}} {{#returnType}} - * @return {{returnType}} + * @return {{.}} {{/returnType}} * @throws ApiException if fails to make API call {{#isDeprecated}} @@ -63,7 +63,7 @@ public class {{classname}} { {{#isDeprecated}} @Deprecated {{/isDeprecated}} - public {{#returnType}}{{{returnType}}} {{/returnType}}{{^returnType}}void {{/returnType}}{{operationId}}({{#allParams}}{{{dataType}}} {{paramName}}{{^-last}}, {{/-last}}{{/allParams}}) throws ApiException { + public {{#returnType}}{{{.}}} {{/returnType}}{{^returnType}}void {{/returnType}}{{operationId}}({{#allParams}}{{{dataType}}} {{paramName}}{{^-last}}, {{/-last}}{{/allParams}}) throws ApiException { Object localVarPostBody = {{#bodyParam}}{{paramName}}{{/bodyParam}}{{^bodyParam}}null{{/bodyParam}}; {{#allParams}}{{#required}} // verify the required parameter '{{paramName}}' is set @@ -83,7 +83,7 @@ public class {{classname}} { {{javaUtilPrefix}}Map localVarFormParams = new {{javaUtilPrefix}}HashMap(); {{#queryParams}} - {{#collectionFormat}}localVarCollectionQueryParams.addAll(apiClient.parameterToPairs("{{{collectionFormat}}}", {{/collectionFormat}}{{^collectionFormat}}localVarQueryParams.addAll(apiClient.parameterToPair({{/collectionFormat}}"{{baseName}}", {{paramName}})); + {{#collectionFormat}}localVarCollectionQueryParams.addAll(apiClient.parameterToPairs("{{{.}}}", {{/collectionFormat}}{{^collectionFormat}}localVarQueryParams.addAll(apiClient.parameterToPair({{/collectionFormat}}"{{baseName}}", {{paramName}})); {{/queryParams}} {{#headerParams}}if ({{paramName}} != null) diff --git a/modules/openapi-generator/src/main/resources/Java/api_doc.mustache b/modules/openapi-generator/src/main/resources/Java/api_doc.mustache index 55d0244e3a5..78783f1943e 100644 --- a/modules/openapi-generator/src/main/resources/Java/api_doc.mustache +++ b/modules/openapi-generator/src/main/resources/Java/api_doc.mustache @@ -1,12 +1,12 @@ # {{classname}}{{#description}} -{{description}}{{/description}} +{{.}}{{/description}} All URIs are relative to *{{basePath}}* Method | HTTP request | Description ------------- | ------------- | ------------- -{{#operations}}{{#operation}}[**{{operationId}}**]({{classname}}.md#{{operationId}}) | **{{httpMethod}}** {{commonPath}}{{path}} | {{#summary}}{{summary}}{{/summary}} +{{#operations}}{{#operation}}[**{{operationId}}**]({{classname}}.md#{{operationId}}) | **{{httpMethod}}** {{commonPath}}{{path}} | {{summary}} {{/operation}}{{/operations}} {{#operations}} @@ -14,11 +14,11 @@ Method | HTTP request | Description ## {{operationId}} -> {{#returnType}}{{returnType}} {{/returnType}}{{operationId}}({{#allParams}}{{{paramName}}}{{^-last}}, {{/-last}}{{/allParams}}) +> {{#returnType}}{{.}} {{/returnType}}{{operationId}}({{#allParams}}{{{paramName}}}{{^-last}}, {{/-last}}{{/allParams}}) {{summary}}{{#notes}} -{{notes}}{{/notes}} +{{.}}{{/notes}} ### Example @@ -60,7 +60,7 @@ public class Example { {{{dataType}}} {{{paramName}}} = {{{example}}}; // {{{dataType}}} | {{{description}}} {{/allParams}} try { - {{#returnType}}{{{returnType}}} result = {{/returnType}}apiInstance.{{{operationId}}}({{#allParams}}{{{paramName}}}{{^-last}}, {{/-last}}{{/allParams}});{{#returnType}} + {{#returnType}}{{{.}}} result = {{/returnType}}apiInstance.{{{operationId}}}({{#allParams}}{{{paramName}}}{{^-last}}, {{/-last}}{{/allParams}});{{#returnType}} System.out.println(result);{{/returnType}} } catch (ApiException e) { System.err.println("Exception when calling {{{classname}}}#{{{operationId}}}"); @@ -78,7 +78,7 @@ public class Example { {{^allParams}}This endpoint does not need any parameter.{{/allParams}}{{#allParams}}{{#-last}} Name | Type | Description | Notes ------------- | ------------- | ------------- | -------------{{/-last}}{{/allParams}} -{{#allParams}} **{{paramName}}** | {{#isPrimitiveType}}**{{dataType}}**{{/isPrimitiveType}}{{^isPrimitiveType}}{{#isFile}}**{{dataType}}**{{/isFile}}{{^isFile}}[**{{dataType}}**]({{baseType}}.md){{/isFile}}{{/isPrimitiveType}}| {{description}} |{{^required}} [optional]{{/required}}{{^isContainer}}{{#defaultValue}} [default to {{defaultValue}}]{{/defaultValue}}{{/isContainer}}{{#allowableValues}} [enum: {{#values}}{{{.}}}{{^-last}}, {{/-last}}{{/values}}]{{/allowableValues}} +{{#allParams}} **{{paramName}}** | {{#isPrimitiveType}}**{{dataType}}**{{/isPrimitiveType}}{{^isPrimitiveType}}{{#isFile}}**{{dataType}}**{{/isFile}}{{^isFile}}[**{{dataType}}**]({{baseType}}.md){{/isFile}}{{/isPrimitiveType}}| {{description}} |{{^required}} [optional]{{/required}}{{^isContainer}}{{#defaultValue}} [default to {{.}}]{{/defaultValue}}{{/isContainer}}{{#allowableValues}} [enum: {{#values}}{{{.}}}{{^-last}}, {{/-last}}{{/values}}]{{/allowableValues}} {{/allParams}} ### Return type diff --git a/modules/openapi-generator/src/main/resources/Java/api_test.mustache b/modules/openapi-generator/src/main/resources/Java/api_test.mustache index 38c58efb711..b3a544d4c65 100644 --- a/modules/openapi-generator/src/main/resources/Java/api_test.mustache +++ b/modules/openapi-generator/src/main/resources/Java/api_test.mustache @@ -27,11 +27,11 @@ public class {{classname}}Test { {{#operation}} /** {{#summary}} - * {{summary}} + * {{.}} * {{/summary}} {{#notes}} - * {{notes}} + * {{.}} * {{/notes}} * @throws ApiException @@ -42,7 +42,7 @@ public class {{classname}}Test { //{{#allParams}} //{{{dataType}}} {{paramName}} = null; //{{/allParams}} - //{{#returnType}}{{{returnType}}} response = {{/returnType}}api.{{operationId}}({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}); + //{{#returnType}}{{{.}}} response = {{/returnType}}api.{{operationId}}({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}); // TODO: test validations } diff --git a/modules/openapi-generator/src/main/resources/Java/auth/OAuthFlow.mustache b/modules/openapi-generator/src/main/resources/Java/auth/OAuthFlow.mustache index 07b7f3aa673..05bbf28dd3b 100644 --- a/modules/openapi-generator/src/main/resources/Java/auth/OAuthFlow.mustache +++ b/modules/openapi-generator/src/main/resources/Java/auth/OAuthFlow.mustache @@ -5,7 +5,7 @@ package {{invokerPackage}}.auth; {{>generatedAnnotation}} public enum OAuthFlow { accessCode, //called authorizationCode in OpenAPI 3.0 - implicit, + implicit, password, application //called clientCredentials in OpenAPI 3.0 } diff --git a/modules/openapi-generator/src/main/resources/Java/beanValidationCore.mustache b/modules/openapi-generator/src/main/resources/Java/beanValidationCore.mustache index 1f9f43e7b86..ff4ffe26c49 100644 --- a/modules/openapi-generator/src/main/resources/Java/beanValidationCore.mustache +++ b/modules/openapi-generator/src/main/resources/Java/beanValidationCore.mustache @@ -4,17 +4,17 @@ minLength && maxLength set minLength set, maxLength not }}{{#minLength}}{{^maxLength}} @Size(min={{minLength}}){{/maxLength}}{{/minLength}}{{! minLength not set, maxLength set -}}{{^minLength}}{{#maxLength}} @Size(max={{maxLength}}){{/maxLength}}{{/minLength}}{{! +}}{{^minLength}}{{#maxLength}} @Size(max={{.}}){{/maxLength}}{{/minLength}}{{! @Size: minItems && maxItems set }}{{#minItems}}{{#maxItems}} @Size(min={{minItems}},max={{maxItems}}){{/maxItems}}{{/minItems}}{{! @Size: minItems set, maxItems not }}{{#minItems}}{{^maxItems}} @Size(min={{minItems}}){{/maxItems}}{{/minItems}}{{! @Size: minItems not set && maxItems set -}}{{^minItems}}{{#maxItems}} @Size(max={{maxItems}}){{/maxItems}}{{/minItems}}{{! +}}{{^minItems}}{{#maxItems}} @Size(max={{.}}){{/maxItems}}{{/minItems}}{{! check for integer or long / all others=decimal type with @Decimal* isInteger set -}}{{#isInteger}}{{#minimum}} @Min({{minimum}}){{/minimum}}{{#maximum}} @Max({{maximum}}){{/maximum}}{{/isInteger}}{{! +}}{{#isInteger}}{{#minimum}} @Min({{.}}){{/minimum}}{{#maximum}} @Max({{.}}){{/maximum}}{{/isInteger}}{{! isLong set -}}{{#isLong}}{{#minimum}} @Min({{minimum}}L){{/minimum}}{{#maximum}} @Max({{maximum}}L){{/maximum}}{{/isLong}}{{! +}}{{#isLong}}{{#minimum}} @Min({{.}}L){{/minimum}}{{#maximum}} @Max({{.}}L){{/maximum}}{{/isLong}}{{! Not Integer, not Long => we have a decimal value! }}{{^isInteger}}{{^isLong}}{{#minimum}} @DecimalMin({{#exclusiveMinimum}}value={{/exclusiveMinimum}}"{{minimum}}"{{#exclusiveMinimum}},inclusive=false{{/exclusiveMinimum}}){{/minimum}}{{#maximum}} @DecimalMax({{#exclusiveMaximum}}value={{/exclusiveMaximum}}"{{maximum}}"{{#exclusiveMaximum}},inclusive=false{{/exclusiveMaximum}}){{/maximum}}{{/isLong}}{{/isInteger}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/Java/beanValidationQueryParams.mustache b/modules/openapi-generator/src/main/resources/Java/beanValidationQueryParams.mustache index f8eef8f94c7..c4ff01d7e55 100644 --- a/modules/openapi-generator/src/main/resources/Java/beanValidationQueryParams.mustache +++ b/modules/openapi-generator/src/main/resources/Java/beanValidationQueryParams.mustache @@ -1 +1 @@ -{{#required}} @NotNull{{/required}}{{>beanValidationCore}} \ No newline at end of file +{{#required}} @NotNull{{/required}}{{>beanValidationCore}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/Java/build.gradle.mustache b/modules/openapi-generator/src/main/resources/Java/build.gradle.mustache index 95fc41cbf42..70dea8f3f25 100644 --- a/modules/openapi-generator/src/main/resources/Java/build.gradle.mustache +++ b/modules/openapi-generator/src/main/resources/Java/build.gradle.mustache @@ -105,7 +105,7 @@ if(hasProperty('target') && target == 'android') { main = System.getProperty('mainClass') classpath = sourceSets.main.runtimeClasspath } - + task sourcesJar(type: Jar, dependsOn: classes) { classifier = 'sources' from sourceSets.main.allSource @@ -164,4 +164,3 @@ dependencies { implementation 'javax.annotation:javax.annotation-api:1.3.2' testImplementation "junit:junit:$junit_version" } - diff --git a/modules/openapi-generator/src/main/resources/Java/git_push.sh.mustache b/modules/openapi-generator/src/main/resources/Java/git_push.sh.mustache index 8b3f689c912..f0bed5bd841 100755 --- a/modules/openapi-generator/src/main/resources/Java/git_push.sh.mustache +++ b/modules/openapi-generator/src/main/resources/Java/git_push.sh.mustache @@ -55,4 +55,3 @@ git pull origin master # Pushes (Forces) the changes in the local repository up to the remote repository echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" git push origin master 2>&1 | grep -v 'To https' - diff --git a/modules/openapi-generator/src/main/resources/Java/jackson_annotations.mustache b/modules/openapi-generator/src/main/resources/Java/jackson_annotations.mustache index 3819d3d2dd2..ccde126f54e 100644 --- a/modules/openapi-generator/src/main/resources/Java/jackson_annotations.mustache +++ b/modules/openapi-generator/src/main/resources/Java/jackson_annotations.mustache @@ -8,12 +8,12 @@ @JsonInclude({{#isMap}}{{#items.isNullable}}content = JsonInclude.Include.ALWAYS, {{/items.isNullable}}{{/isMap}}value = JsonInclude.Include.{{#required}}ALWAYS{{/required}}{{^required}}USE_DEFAULTS{{/required}}) {{#withXml}} {{^isContainer}} - @JacksonXmlProperty({{#isXmlAttribute}}isAttribute = true, {{/isXmlAttribute}}{{#xmlNamespace}}namespace="{{xmlNamespace}}", {{/xmlNamespace}}localName = "{{#xmlName}}{{xmlName}}{{/xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}") + @JacksonXmlProperty({{#isXmlAttribute}}isAttribute = true, {{/isXmlAttribute}}{{#xmlNamespace}}namespace="{{.}}", {{/xmlNamespace}}localName = "{{xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}") {{/isContainer}} {{#isContainer}} {{#isXmlWrapped}} // items.xmlName={{items.xmlName}} - @JacksonXmlElementWrapper(useWrapping = {{isXmlWrapped}}, {{#xmlNamespace}}namespace="{{xmlNamespace}}", {{/xmlNamespace}}localName = "{{#items.xmlName}}{{items.xmlName}}{{/items.xmlName}}{{^items.xmlName}}{{items.baseName}}{{/items.xmlName}}") + @JacksonXmlElementWrapper(useWrapping = {{isXmlWrapped}}, {{#xmlNamespace}}namespace="{{.}}", {{/xmlNamespace}}localName = "{{#items.xmlName}}{{items.xmlName}}{{/items.xmlName}}{{^items.xmlName}}{{items.baseName}}{{/items.xmlName}}") {{/isXmlWrapped}} {{/isContainer}} {{/withXml}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/feign/ApiClient.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/feign/ApiClient.mustache index e0d3e01c386..20c8733c9d0 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/feign/ApiClient.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/feign/ApiClient.mustache @@ -259,7 +259,7 @@ public class ApiClient { {{#hasOAuthMethods}} /** - * Helper method to configure the client credentials for Oauth + * Helper method to configure the client credentials for Oauth * @param username Username * @param password Password */ diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/feign/README.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/feign/README.mustache index acab659406d..fed3cbebd53 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/feign/README.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/feign/README.mustache @@ -54,7 +54,7 @@ And to use the api you can follow the examples bellow: ApiClient apiClient = new ApiClient("oauth_password"); apiClient.setBasePath("https://localhost:8243/petstore/1/"); apiClient.setOauthPassword("username", "password", "client_id", "client_secret"); - + //Oauth client credentials flow ApiClient apiClient = new ApiClient("oauth_client_credentials"); apiClient.setBasePath("https://localhost:8243/petstore/1/"); @@ -62,7 +62,7 @@ And to use the api you can follow the examples bellow: PetApi petApi = apiClient.buildClient(PetApi.class); Pet petById = petApi.getPetById(12345L); - + System.out.println(petById); } ``` diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/feign/api.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/feign/api.mustache index 5a5012d63ab..de0ae82baaa 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/feign/api.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/feign/api.mustache @@ -28,7 +28,7 @@ public interface {{classname}} extends ApiClient.Api { * @param {{paramName}} {{description}}{{#required}} (required){{/required}}{{^required}} (optional{{^isContainer}}{{#defaultValue}}, default to {{.}}{{/defaultValue}}{{/isContainer}}){{/required}} {{/allParams}} {{#returnType}} - * @return {{returnType}} + * @return {{.}} {{/returnType}} {{#externalDocs}} * {{description}} @@ -48,7 +48,7 @@ public interface {{classname}} extends ApiClient.Api { "{{baseName}}: {{=<% %>=}}{<%paramName%>}<%={{ }}=%>"{{^-last}}, {{/-last}}{{/headerParams}} }) - {{#returnType}}{{{returnType}}} {{/returnType}}{{^returnType}}void {{/returnType}}{{nickname}}({{#allParams}}{{^isBodyParam}}{{^legacyDates}}@Param("{{paramName}}") {{/legacyDates}}{{#legacyDates}}@Param(value="{{paramName}}", expander=ParamExpander.class) {{/legacyDates}}{{/isBodyParam}}{{{dataType}}} {{paramName}}{{^-last}}, {{/-last}}{{/allParams}}); + {{#returnType}}{{{.}}} {{/returnType}}{{^returnType}}void {{/returnType}}{{nickname}}({{#allParams}}{{^isBodyParam}}{{^legacyDates}}@Param("{{paramName}}") {{/legacyDates}}{{#legacyDates}}@Param(value="{{paramName}}", expander=ParamExpander.class) {{/legacyDates}}{{/isBodyParam}}{{{dataType}}} {{paramName}}{{^-last}}, {{/-last}}{{/allParams}}); {{#hasQueryParams}} /** @@ -72,7 +72,7 @@ public interface {{classname}} extends ApiClient.Api { {{/queryParams}} * {{#returnType}} - * @return {{returnType}} + * @return {{.}} {{/returnType}} {{#externalDocs}} * {{description}} @@ -92,7 +92,7 @@ public interface {{classname}} extends ApiClient.Api { "{{baseName}}: {{=<% %>=}}{<%paramName%>}<%={{ }}=%>"{{^-last}}, {{/-last}}{{/headerParams}} }) - {{#returnType}}{{{returnType}}} {{/returnType}}{{^returnType}}void {{/returnType}}{{nickname}}({{#allParams}}{{^isQueryParam}}{{^isBodyParam}}{{^legacyDates}}@Param("{{paramName}}") {{/legacyDates}}{{#legacyDates}}@Param(value="{{paramName}}", expander=ParamExpander.class) {{/legacyDates}}{{/isBodyParam}}{{{dataType}}} {{paramName}}, {{/isQueryParam}}{{/allParams}}@QueryMap(encoded=true) Map queryParams); + {{#returnType}}{{{.}}} {{/returnType}}{{^returnType}}void {{/returnType}}{{nickname}}({{#allParams}}{{^isQueryParam}}{{^isBodyParam}}{{^legacyDates}}@Param("{{paramName}}") {{/legacyDates}}{{#legacyDates}}@Param(value="{{paramName}}", expander=ParamExpander.class) {{/legacyDates}}{{/isBodyParam}}{{{dataType}}} {{paramName}}, {{/isQueryParam}}{{/allParams}}@QueryMap(encoded=true) Map queryParams); /** * A convenience class for generating query parameters for the diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/feign/api_test.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/feign/api_test.mustache index e9f9d055e02..a7f5bb0b328 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/feign/api_test.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/feign/api_test.mustache @@ -36,7 +36,7 @@ class {{classname}}Test { {{#allParams}} {{{dataType}}} {{paramName}} = null; {{/allParams}} - // {{#returnType}}{{{returnType}}} response = {{/returnType}}api.{{operationId}}({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}); + // {{#returnType}}{{{.}}} response = {{/returnType}}api.{{operationId}}({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}); // TODO: test validations } @@ -61,7 +61,7 @@ class {{classname}}Test { {{#queryParams}} .{{paramName}}(null){{#-last}};{{/-last}} {{/queryParams}} - // {{#returnType}}{{{returnType}}} response = {{/returnType}}api.{{operationId}}({{#allParams}}{{^isQueryParam}}{{paramName}}, {{/isQueryParam}}{{/allParams}}queryParams); + // {{#returnType}}{{{.}}} response = {{/returnType}}api.{{operationId}}({{#allParams}}{{^isQueryParam}}{{paramName}}, {{/isQueryParam}}{{/allParams}}queryParams); // TODO: test validations } diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/feign/auth/HttpBasicAuth.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/feign/auth/HttpBasicAuth.mustache index 2b1acb8ff74..c308131e8f9 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/feign/auth/HttpBasicAuth.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/feign/auth/HttpBasicAuth.mustache @@ -11,7 +11,7 @@ public class HttpBasicAuth implements RequestInterceptor { private String username; private String password; - + public String getUsername() { return username; } diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/feign/pom.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/feign/pom.mustache index 65b3cc3c214..28b5437ccc0 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/feign/pom.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/feign/pom.mustache @@ -225,7 +225,7 @@ jsr305 3.0.2 - + io.github.openfeign diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/google-api-client/api.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/google-api-client/api.mustache index 8396e3148bc..f9af1a4a9bb 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/google-api-client/api.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/google-api-client/api.mustache @@ -45,11 +45,11 @@ public class {{classname}} { {{#operation}} /**{{#summary}} - * {{summary}}{{/summary}}{{#notes}} - * {{notes}}{{/notes}}{{#responses}} - *

{{code}}{{#message}} - {{message}}{{/message}}{{/responses}}{{#allParams}} + * {{.}}{{/summary}}{{#notes}} + * {{.}}{{/notes}}{{#responses}} + *

{{code}}{{#message}} - {{.}}{{/message}}{{/responses}}{{#allParams}} * @param {{paramName}} {{description}}{{^description}}The {{paramName}} parameter{{/description}}{{/allParams}}{{#returnType}} - * @return {{returnType}}{{/returnType}} + * @return {{.}}{{/returnType}} * @throws IOException if an error occurs while attempting to invoke the API{{#externalDocs}} * {{description}} * @see {{summary}} Documentation @@ -61,19 +61,19 @@ public class {{classname}} { {{#isDeprecated}} @Deprecated {{/isDeprecated}} - public {{#returnType}}{{{returnType}}} {{/returnType}}{{^returnType}}void {{/returnType}}{{operationId}}({{#allParams}}{{{dataType}}} {{paramName}}{{^-last}}, {{/-last}}{{/allParams}}) throws IOException { + public {{#returnType}}{{{.}}} {{/returnType}}{{^returnType}}void {{/returnType}}{{operationId}}({{#allParams}}{{{dataType}}} {{paramName}}{{^-last}}, {{/-last}}{{/allParams}}) throws IOException { {{#returnType}}HttpResponse response = {{/returnType}}{{operationId}}ForHttpResponse({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}});{{#returnType}} TypeReference<{{{returnType}}}> typeRef = new TypeReference<{{{returnType}}}>() {}; return apiClient.getObjectMapper().readValue(response.getContent(), typeRef);{{/returnType}} } /**{{#summary}} - * {{summary}}{{/summary}}{{#notes}} - * {{notes}}{{/notes}}{{#responses}} - *

{{code}}{{#message}} - {{message}}{{/message}}{{/responses}}{{#requiredParams}} + * {{.}}{{/summary}}{{#notes}} + * {{.}}{{/notes}}{{#responses}} + *

{{code}}{{#message}} - {{.}}{{/message}}{{/responses}}{{#requiredParams}} * @param {{paramName}} {{description}}{{^description}}The {{paramName}} parameter{{/description}}{{/requiredParams}} * @param params Map of query params. A collection will be interpreted as passing in multiple instances of the same query param.{{#returnType}} - * @return {{returnType}}{{/returnType}} + * @return {{.}}{{/returnType}} * @throws IOException if an error occurs while attempting to invoke the API{{#externalDocs}} * {{description}} * @see {{summary}} Documentation @@ -85,7 +85,7 @@ public class {{classname}} { {{#isDeprecated}} @Deprecated {{/isDeprecated}} - public {{#returnType}}{{{returnType}}} {{/returnType}}{{^returnType}}void {{/returnType}}{{operationId}}({{#bodyParam}}{{^required}}{{{dataType}}} {{paramName}}, {{/required}}{{/bodyParam}}{{#requiredParams}}{{{dataType}}} {{paramName}}{{^-last}}, {{/-last}}{{/requiredParams}}{{#hasRequiredParams}}, {{/hasRequiredParams}}Map params) throws IOException { + public {{#returnType}}{{{.}}} {{/returnType}}{{^returnType}}void {{/returnType}}{{operationId}}({{#bodyParam}}{{^required}}{{{dataType}}} {{paramName}}, {{/required}}{{/bodyParam}}{{#requiredParams}}{{{dataType}}} {{paramName}}{{^-last}}, {{/-last}}{{/requiredParams}}{{#hasRequiredParams}}, {{/hasRequiredParams}}Map params) throws IOException { {{#returnType}}HttpResponse response = {{/returnType}}{{operationId}}ForHttpResponse({{#bodyParam}}{{^required}}{{paramName}}, {{/required}}{{/bodyParam}}{{#requiredParams}}{{paramName}}{{^-last}}, {{/-last}}{{/requiredParams}}{{#hasRequiredParams}}, {{/hasRequiredParams}}params);{{#returnType}} TypeReference<{{{returnType}}}> typeRef = new TypeReference<{{{returnType}}}>() {}; return apiClient.getObjectMapper().readValue(response.getContent(), typeRef);{{/returnType}} diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/google-api-client/api_test.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/google-api-client/api_test.mustache index 56b7c1897d1..1dc2f174fbf 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/google-api-client/api_test.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/google-api-client/api_test.mustache @@ -37,7 +37,7 @@ public class {{classname}}Test { {{#allParams}} {{{dataType}}} {{paramName}} = null; {{/allParams}} - {{#returnType}}{{{returnType}}} response = {{/returnType}}api.{{operationId}}({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}); + {{#returnType}}{{{.}}} response = {{/returnType}}api.{{operationId}}({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}); // TODO: test validations } diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/google-api-client/build.gradle.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/google-api-client/build.gradle.mustache index 6be8600c7da..6abca3fddb7 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/google-api-client/build.gradle.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/google-api-client/build.gradle.mustache @@ -24,7 +24,7 @@ if(hasProperty('target') && target == 'android') { apply plugin: 'com.android.library' apply plugin: 'com.github.dcendents.android-maven' - + android { compileSdkVersion 23 buildToolsVersion '23.0.2' @@ -42,7 +42,7 @@ if(hasProperty('target') && target == 'android') { targetCompatibility JavaVersion.VERSION_1_7 {{/java8}} } - + // Rename the aar correctly libraryVariants.all { variant -> variant.outputs.each { output -> @@ -58,7 +58,7 @@ if(hasProperty('target') && target == 'android') { provided 'javax.annotation:jsr250-api:1.0' } } - + afterEvaluate { android.libraryVariants.all { variant -> def task = project.tasks.create "jar${variant.name.capitalize()}", Jar @@ -70,12 +70,12 @@ if(hasProperty('target') && target == 'android') { artifacts.add('archives', task); } } - + task sourcesJar(type: Jar) { from android.sourceSets.main.java.srcDirs classifier = 'sources' } - + artifacts { archives sourcesJar } @@ -99,7 +99,7 @@ if(hasProperty('target') && target == 'android') { pom.artifactId = '{{artifactId}}' } } - + task execute(type:JavaExec) { main = System.getProperty('mainClass') classpath = sourceSets.main.runtimeClasspath diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/ApiClient.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/ApiClient.mustache index 65494e8ea04..abe9b208c60 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/ApiClient.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/ApiClient.mustache @@ -188,7 +188,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { this.dateFormat = new RFC3339DateFormat(); // Set default User-Agent. - setUserAgent("{{#httpUserAgent}}{{{.}}}{{/httpUserAgent}}{{^httpUserAgent}}OpenAPI-Generator/{{{artifactVersion}}}/java{{/httpUserAgent}}"); + setUserAgent("{{{httpUserAgent}}}{{^httpUserAgent}}OpenAPI-Generator/{{{artifactVersion}}}/java{{/httpUserAgent}}"); // Setup authentications (key: authentication name, value: authentication). authentications = new HashMap(); diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/api.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/api.mustache index 666430c834e..ec4d939d2fc 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/api.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/api.mustache @@ -58,7 +58,7 @@ public class {{classname}} { * @param {{paramName}} {{description}}{{#required}} (required){{/required}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}} {{/allParams}} {{#returnType}} - * @return {{returnType}} + * @return {{.}} {{/returnType}} * @throws ApiException if fails to make API call {{#responses.0}} @@ -81,7 +81,7 @@ public class {{classname}} { {{#isDeprecated}} @Deprecated {{/isDeprecated}} - public {{#returnType}}{{{returnType}}} {{/returnType}}{{^returnType}}void {{/returnType}}{{operationId}}({{#allParams}}{{{dataType}}} {{paramName}}{{^-last}}, {{/-last}}{{/allParams}}) throws ApiException { + public {{#returnType}}{{{.}}} {{/returnType}}{{^returnType}}void {{/returnType}}{{operationId}}({{#allParams}}{{{dataType}}} {{paramName}}{{^-last}}, {{/-last}}{{/allParams}}) throws ApiException { {{#returnType}}return {{/returnType}}{{operationId}}WithHttpInfo({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}){{#returnType}}.getData(){{/returnType}}; } {{/vendorExtensions.x-group-parameters}} @@ -93,7 +93,7 @@ public class {{classname}} { {{#allParams}} * @param {{paramName}} {{description}}{{#required}} (required){{/required}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}} {{/allParams}} - * @return ApiResponse<{{#returnType}}{{returnType}}{{/returnType}}{{^returnType}}Void{{/returnType}}> + * @return ApiResponse<{{returnType}}{{^returnType}}Void{{/returnType}}> * @throws ApiException if fails to make API call {{#responses.0}} * @http.response.details @@ -115,7 +115,7 @@ public class {{classname}} { {{#isDeprecated}} @Deprecated {{/isDeprecated}} - public{{/vendorExtensions.x-group-parameters}}{{#vendorExtensions.x-group-parameters}}private{{/vendorExtensions.x-group-parameters}} ApiResponse<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}Void{{/returnType}}> {{operationId}}WithHttpInfo({{#allParams}}{{{dataType}}} {{paramName}}{{^-last}}, {{/-last}}{{/allParams}}) throws ApiException { + public{{/vendorExtensions.x-group-parameters}}{{#vendorExtensions.x-group-parameters}}private{{/vendorExtensions.x-group-parameters}} ApiResponse<{{{returnType}}}{{^returnType}}Void{{/returnType}}> {{operationId}}WithHttpInfo({{#allParams}}{{{dataType}}} {{paramName}}{{^-last}}, {{/-last}}{{/allParams}}) throws ApiException { Object localVarPostBody = {{#bodyParam}}{{paramName}}{{/bodyParam}}{{^bodyParam}}null{{/bodyParam}}; {{#allParams}}{{#required}} // verify the required parameter '{{paramName}}' is set @@ -134,7 +134,7 @@ public class {{classname}} { {{javaUtilPrefix}}Map localVarFormParams = new {{javaUtilPrefix}}HashMap(); {{#queryParams}} - localVarQueryParams.addAll(apiClient.parameterToPairs("{{#collectionFormat}}{{{collectionFormat}}}{{/collectionFormat}}", "{{baseName}}", {{paramName}})); + localVarQueryParams.addAll(apiClient.parameterToPairs("{{{collectionFormat}}}", "{{baseName}}", {{paramName}})); {{/queryParams}} {{#headerParams}}if ({{paramName}} != null) @@ -212,13 +212,13 @@ public class {{classname}} { {{#isDeprecated}}* @deprecated{{/isDeprecated}} */ {{#isDeprecated}}@Deprecated{{/isDeprecated}} - public {{#returnType}}{{{.}}}{{/returnType}}{{^returnType}}void{{/returnType}} execute() throws ApiException { + public {{{returnType}}}{{^returnType}}void{{/returnType}} execute() throws ApiException { {{#returnType}}return {{/returnType}}this.executeWithHttpInfo().getData(); } /** * Execute {{operationId}} request with HTTP info returned - * @return ApiResponse<{{#returnType}}{{.}}{{/returnType}}{{^returnType}}Void{{/returnType}}> + * @return ApiResponse<{{returnType}}{{^returnType}}Void{{/returnType}}> * @throws ApiException if fails to make API call {{#responses.0}} * @http.response.details @@ -235,7 +235,7 @@ public class {{classname}} { {{#isDeprecated}} @Deprecated {{/isDeprecated}} - public ApiResponse<{{#returnType}}{{{.}}}{{/returnType}}{{^returnType}}Void{{/returnType}}> executeWithHttpInfo() throws ApiException { + public ApiResponse<{{{returnType}}}{{^returnType}}Void{{/returnType}}> executeWithHttpInfo() throws ApiException { return {{operationId}}WithHttpInfo({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}); } } diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/api_doc.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/api_doc.mustache index e9270ceb18f..3877e9ab3af 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/api_doc.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/api_doc.mustache @@ -1,12 +1,12 @@ # {{classname}}{{#description}} -{{description}}{{/description}} +{{.}}{{/description}} All URIs are relative to *{{basePath}}* Method | HTTP request | Description ------------- | ------------- | ------------- -{{#operations}}{{#operation}}[**{{operationId}}**]({{classname}}.md#{{operationId}}) | **{{httpMethod}}** {{path}} | {{#summary}}{{summary}}{{/summary}} +{{#operations}}{{#operation}}[**{{operationId}}**]({{classname}}.md#{{operationId}}) | **{{httpMethod}}** {{path}} | {{summary}} {{/operation}}{{/operations}} {{#operations}} @@ -15,10 +15,10 @@ Method | HTTP request | Description ## {{operationId}} {{^vendorExtensions.x-group-parameters}} -> {{#returnType}}{{returnType}} {{/returnType}}{{operationId}}({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}) +> {{#returnType}}{{.}} {{/returnType}}{{operationId}}({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}) {{/vendorExtensions.x-group-parameters}} {{#vendorExtensions.x-group-parameters}} -> {{#returnType}}{{returnType}} {{/returnType}}{{operationId}}({{#pathParams}}{{paramName}}{{^-last}}, {{/-last}}{{/pathParams}}){{#allParams}}{{^isPathParam}}.{{paramName}}({{paramName}}){{/isPathParam}}{{/allParams}}.execute(); +> {{#returnType}}{{.}} {{/returnType}}{{operationId}}({{#pathParams}}{{paramName}}{{^-last}}, {{/-last}}{{/pathParams}}){{#allParams}}{{^isPathParam}}.{{paramName}}({{paramName}}){{/isPathParam}}{{/allParams}}.execute(); {{/vendorExtensions.x-group-parameters}} {{summary}}{{#notes}} @@ -69,10 +69,10 @@ public class Example { {{/allParams}} try { {{^vendorExtensions.x-group-parameters}} - {{#returnType}}{{{returnType}}} result = {{/returnType}}apiInstance.{{{operationId}}}({{#allParams}}{{{paramName}}}{{^-last}}, {{/-last}}{{/allParams}}); + {{#returnType}}{{{.}}} result = {{/returnType}}apiInstance.{{{operationId}}}({{#allParams}}{{{paramName}}}{{^-last}}, {{/-last}}{{/allParams}}); {{/vendorExtensions.x-group-parameters}} {{#vendorExtensions.x-group-parameters}} - {{#returnType}}{{{returnType}}} result = {{/returnType}}api.{{operationId}}({{#pathParams}}{{paramName}}{{^-last}}, {{/-last}}{{/pathParams}}){{#allParams}}{{^isPathParam}} + {{#returnType}}{{{.}}} result = {{/returnType}}api.{{operationId}}({{#pathParams}}{{paramName}}{{^-last}}, {{/-last}}{{/pathParams}}){{#allParams}}{{^isPathParam}} .{{paramName}}({{paramName}}){{/isPathParam}}{{/allParams}} .execute(); {{/vendorExtensions.x-group-parameters}} @@ -95,7 +95,7 @@ public class Example { {{^allParams}}This endpoint does not need any parameter.{{/allParams}}{{#allParams}}{{#-last}} Name | Type | Description | Notes ------------- | ------------- | ------------- | -------------{{/-last}}{{/allParams}} -{{#allParams}} **{{paramName}}** | {{#isContainer}}{{#isArray}}{{#items}}{{#isModel}}{{^isFile}}[{{/isFile}}{{/isModel}}**List<{{dataType}}>**{{#isModel}}{{^isFile}}]({{^baseType}}{{dataType}}{{/baseType}}{{#baseType}}{{baseType}}{{/baseType}}.md){{/isFile}}{{/isModel}}{{/items}}{{/isArray}}{{#isMap}}{{#items}}{{#isModel}}{{^isFile}}[{{/isFile}}{{/isModel}}**Map<String,{{dataType}}>**{{#isModel}}{{^isFile}}]({{^baseType}}{{dataType}}{{/baseType}}{{#baseType}}{{baseType}}{{/baseType}}.md){{/isFile}}{{/isModel}}{{/items}}{{/isMap}}{{/isContainer}}{{^isContainer}}{{#isModel}}{{^isFile}}[{{/isFile}}{{/isModel}}**{{dataType}}**{{#isModel}}{{^isFile}}]({{^baseType}}{{dataType}}{{/baseType}}{{#baseType}}{{baseType}}{{/baseType}}.md){{/isFile}}{{/isModel}}{{/isContainer}}| {{description}} |{{^required}} [optional]{{/required}}{{^isContainer}}{{#defaultValue}} [default to {{defaultValue}}]{{/defaultValue}}{{/isContainer}}{{#allowableValues}} [enum: {{#values}}{{{.}}}{{^-last}}, {{/-last}}{{/values}}]{{/allowableValues}} +{{#allParams}} **{{paramName}}** | {{#isContainer}}{{#isArray}}{{#items}}{{#isModel}}{{^isFile}}[{{/isFile}}{{/isModel}}**List<{{dataType}}>**{{#isModel}}{{^isFile}}]({{^baseType}}{{dataType}}{{/baseType}}{{baseType}}.md){{/isFile}}{{/isModel}}{{/items}}{{/isArray}}{{#isMap}}{{#items}}{{#isModel}}{{^isFile}}[{{/isFile}}{{/isModel}}**Map<String,{{dataType}}>**{{#isModel}}{{^isFile}}]({{^baseType}}{{dataType}}{{/baseType}}{{baseType}}.md){{/isFile}}{{/isModel}}{{/items}}{{/isMap}}{{/isContainer}}{{^isContainer}}{{#isModel}}{{^isFile}}[{{/isFile}}{{/isModel}}**{{dataType}}**{{#isModel}}{{^isFile}}]({{^baseType}}{{dataType}}{{/baseType}}{{baseType}}.md){{/isFile}}{{/isModel}}{{/isContainer}}| {{description}} |{{^required}} [optional]{{/required}}{{^isContainer}}{{#defaultValue}} [default to {{.}}]{{/defaultValue}}{{/isContainer}}{{#allowableValues}} [enum: {{#values}}{{{.}}}{{^-last}}, {{/-last}}{{/values}}]{{/allowableValues}} {{/allParams}} ### Return type diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/api_test.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/api_test.mustache index b6ea89f6154..c325e3d1ed2 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/api_test.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/api_test.mustache @@ -41,10 +41,10 @@ public class {{classname}}Test { //{{{dataType}}} {{paramName}} = null; {{/allParams}} {{^vendorExtensions.x-group-parameters}} - //{{#returnType}}{{{returnType}}} response = {{/returnType}}api.{{operationId}}({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}); + //{{#returnType}}{{{.}}} response = {{/returnType}}api.{{operationId}}({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}); {{/vendorExtensions.x-group-parameters}} {{#vendorExtensions.x-group-parameters}} - //{{#returnType}}{{{returnType}}} response = {{/returnType}}api.{{operationId}}({{#pathParams}}{{paramName}}{{^-last}}, {{/-last}}{{/pathParams}}){{#allParams}}{{^isPathParam}} + //{{#returnType}}{{{.}}} response = {{/returnType}}api.{{operationId}}({{#pathParams}}{{paramName}}{{^-last}}, {{/-last}}{{/pathParams}}){{#allParams}}{{^isPathParam}} // .{{paramName}}({{paramName}}){{/isPathParam}}{{/allParams}} // .execute(); {{/vendorExtensions.x-group-parameters}} diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/pojo.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/pojo.mustache index 55dc3717100..b01a88a6646 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/pojo.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/pojo.mustache @@ -1,9 +1,9 @@ /** - * {{#description}}{{.}}{{/description}}{{^description}}{{classname}}{{/description}}{{#isDeprecated}} + * {{description}}{{^description}}{{classname}}{{/description}}{{#isDeprecated}} * @deprecated{{/isDeprecated}} */{{#isDeprecated}} @Deprecated{{/isDeprecated}}{{#description}} -@ApiModel(description = "{{{description}}}"){{/description}} +@ApiModel(description = "{{{.}}}"){{/description}} {{#jackson}} @JsonPropertyOrder({ {{#vars}} @@ -12,7 +12,7 @@ }) {{/jackson}} {{>additionalModelTypeAnnotations}}{{>generatedAnnotation}}{{#discriminator}}{{>typeInfoAnnotation}}{{/discriminator}}{{>xmlAnnotation}} -public class {{classname}} {{#parent}}extends {{{parent}}} {{/parent}}{{#vendorExtensions.x-implements}}{{#-first}}implements {{{.}}}{{/-first}}{{^-first}}, {{{.}}}{{/-first}}{{#-last}} {{/-last}}{{/vendorExtensions.x-implements}}{ +public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtensions.x-implements}}{{#-first}}implements {{{.}}}{{/-first}}{{^-first}}, {{{.}}}{{/-first}}{{#-last}} {{/-last}}{{/vendorExtensions.x-implements}}{ {{#serializableModel}} private static final long serialVersionUID = 1L; @@ -38,21 +38,21 @@ public class {{classname}} {{#parent}}extends {{{parent}}} {{/parent}}{{#vendorE {{/jackson}} {{#withXml}} {{#isXmlAttribute}} - @XmlAttribute(name = "{{#xmlName}}{{xmlName}}{{/xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}") + @XmlAttribute(name = "{{xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}") {{/isXmlAttribute}} {{^isXmlAttribute}} {{^isContainer}} - @XmlElement({{#xmlNamespace}}namespace="{{xmlNamespace}}", {{/xmlNamespace}}name = "{{#xmlName}}{{xmlName}}{{/xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}") + @XmlElement({{#xmlNamespace}}namespace="{{.}}", {{/xmlNamespace}}name = "{{xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}") {{/isContainer}} {{#isContainer}} // Is a container wrapped={{isXmlWrapped}} {{#items}} // items.name={{name}} items.baseName={{baseName}} items.xmlName={{xmlName}} items.xmlNamespace={{xmlNamespace}} // items.example={{example}} items.type={{dataType}} - @XmlElement({{#xmlNamespace}}namespace="{{xmlNamespace}}", {{/xmlNamespace}}name = "{{#xmlName}}{{xmlName}}{{/xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}") + @XmlElement({{#xmlNamespace}}namespace="{{.}}", {{/xmlNamespace}}name = "{{xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}") {{/items}} {{#isXmlWrapped}} - @XmlElementWrapper({{#xmlNamespace}}namespace="{{xmlNamespace}}", {{/xmlNamespace}}name = "{{#xmlName}}{{xmlName}}{{/xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}") + @XmlElementWrapper({{#xmlNamespace}}namespace="{{.}}", {{/xmlNamespace}}name = "{{xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}") {{/isXmlWrapped}} {{/isContainer}} {{/isXmlAttribute}} @@ -177,16 +177,16 @@ public class {{classname}} {{#parent}}extends {{{parent}}} {{/parent}}{{#vendorE {{/isReadOnly}} /** {{#description}} - * {{description}} + * {{.}} {{/description}} {{^description}} * Get {{name}} {{/description}} {{#minimum}} - * minimum: {{minimum}} + * minimum: {{.}} {{/minimum}} {{#maximum}} - * maximum: {{maximum}} + * maximum: {{.}} {{/maximum}} * @return {{name}} {{#deprecated}} @@ -207,7 +207,7 @@ public class {{classname}} {{#parent}}extends {{{parent}}} {{/parent}}{{#vendorE {{^required}} @javax.annotation.Nullable {{/required}} -{{#useBeanValidation}}{{>beanValidation}}{{/useBeanValidation}} @ApiModelProperty({{#example}}example = "{{{example}}}", {{/example}}{{#required}}required = {{required}}, {{/required}}value = "{{{description}}}") +{{#useBeanValidation}}{{>beanValidation}}{{/useBeanValidation}} @ApiModelProperty({{#example}}example = "{{{.}}}", {{/example}}{{#required}}required = {{required}}, {{/required}}value = "{{{description}}}") {{#vendorExtensions.x-extra-annotation}} {{{vendorExtensions.x-extra-annotation}}} {{/vendorExtensions.x-extra-annotation}} diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/microprofile/README.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/microprofile/README.mustache index 8d126ada313..58d2d5f5c18 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/microprofile/README.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/microprofile/README.mustache @@ -1,7 +1,7 @@ # {{appName}} - MicroProfile Rest Client {{#appDescriptionWithNewLines}} -{{{appDescriptionWithNewLines}}} +{{{.}}} {{/appDescriptionWithNewLines}} ## Overview diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/microprofile/api.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/microprofile/api.mustache index a13427c6965..175467a4a98 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/microprofile/api.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/microprofile/api.mustache @@ -23,7 +23,7 @@ import org.eclipse.microprofile.rest.client.inject.RegisterRestClient; * {{{appName}}} * {{#appDescription}} - *

{{{appDescription}}} + *

{{{.}}} * {{/appDescription}} */ @@ -41,7 +41,7 @@ public interface {{classname}} { * {{summary}} * {{#notes}} - * {{notes}} + * {{.}} * {{/notes}} {{#isDeprecated}} @@ -60,8 +60,7 @@ public interface {{classname}} { {{#hasProduces}} @Produces({ {{#produces}}"{{{mediaType}}}"{{^-last}}, {{/-last}}{{/produces}} }) {{/hasProduces}} - public {{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}void{{/returnType}} {{nickname}}({{#allParams}}{{>queryParams}}{{>pathParams}}{{>headerParams}}{{>bodyParams}}{{>formParams}}{{^-last}}, {{/-last}}{{/allParams}}) throws ApiException, ProcessingException; + public {{{returnType}}}{{^returnType}}void{{/returnType}} {{nickname}}({{#allParams}}{{>queryParams}}{{>pathParams}}{{>headerParams}}{{>bodyParams}}{{>formParams}}{{^-last}}, {{/-last}}{{/allParams}}) throws ApiException, ProcessingException; {{/operation}} } {{/operations}} - diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/microprofile/api_test.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/microprofile/api_test.mustache index e0ed40ef88b..43b5285b967 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/microprofile/api_test.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/microprofile/api_test.mustache @@ -23,10 +23,10 @@ import java.util.Map; /** {{#appName}} - * {{{appName}}} Test + * {{{.}}} Test * {{/appName}} - * API tests for {{classname}} + * API tests for {{classname}} */ {{#generateSpringBootApplication}} @RunWith(SpringJUnit4ClassRunner.class) @@ -38,7 +38,7 @@ public class {{classname}}Test { private {{classname}} client; private String baseUrl = "http://localhost:9080"; - + @Before public void setup() throws MalformedURLException { client = RestClientBuilder.newBuilder() @@ -53,7 +53,7 @@ public class {{classname}}Test { * {{summary}} * {{#notes}} - * {{notes}} + * {{.}} * {{/notes}} {{/summary}} @@ -66,10 +66,10 @@ public class {{classname}}Test { {{#allParams}} {{^isFile}}{{{dataType}}} {{paramName}} = null;{{/isFile}}{{#isFile}}org.apache.cxf.jaxrs.ext.multipart.Attachment {{paramName}} = null;{{/isFile}} {{/allParams}} - //{{#returnType}}{{{returnType}}} response = {{/returnType}}api.{{operationId}}({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}); + //{{#returnType}}{{{.}}} response = {{/returnType}}api.{{operationId}}({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}); //{{#returnType}}assertNotNull(response);{{/returnType}} - - + + } {{/operation}}{{/operations}} } diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/microprofile/beanValidationCore.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/microprofile/beanValidationCore.mustache index 8bcdce3df16..b58f0a26631 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/microprofile/beanValidationCore.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/microprofile/beanValidationCore.mustache @@ -1,20 +1,20 @@ -{{#pattern}} @Pattern(regexp="{{{pattern}}}"){{/pattern}}{{! +{{#pattern}} @Pattern(regexp="{{{.}}}"){{/pattern}}{{! minLength && maxLength set }}{{#minLength}}{{#maxLength}} @Size(min={{minLength}},max={{maxLength}}){{/maxLength}}{{/minLength}}{{! minLength set, maxLength not }}{{#minLength}}{{^maxLength}} @Size(min={{minLength}}){{/maxLength}}{{/minLength}}{{! minLength not set, maxLength set -}}{{^minLength}}{{#maxLength}} @Size(max={{maxLength}}){{/maxLength}}{{/minLength}}{{! +}}{{^minLength}}{{#maxLength}} @Size(max={{.}}){{/maxLength}}{{/minLength}}{{! @Size: minItems && maxItems set }}{{#minItems}}{{#maxItems}} @Size(min={{minItems}},max={{maxItems}}){{/maxItems}}{{/minItems}}{{! @Size: minItems set, maxItems not }}{{#minItems}}{{^maxItems}} @Size(min={{minItems}}){{/maxItems}}{{/minItems}}{{! @Size: minItems not set && maxItems set -}}{{^minItems}}{{#maxItems}} @Size(max={{maxItems}}){{/maxItems}}{{/minItems}}{{! +}}{{^minItems}}{{#maxItems}} @Size(max={{.}}){{/maxItems}}{{/minItems}}{{! check for integer or long / all others=decimal type with @Decimal* isInteger set -}}{{#isInteger}}{{#minimum}} @Min({{minimum}}){{/minimum}}{{#maximum}} @Max({{maximum}}){{/maximum}}{{/isInteger}}{{! +}}{{#isInteger}}{{#minimum}} @Min({{.}}){{/minimum}}{{#maximum}} @Max({{.}}){{/maximum}}{{/isInteger}}{{! isLong set -}}{{#isLong}}{{#minimum}} @Min({{minimum}}L){{/minimum}}{{#maximum}} @Max({{maximum}}L){{/maximum}}{{/isLong}}{{! +}}{{#isLong}}{{#minimum}} @Min({{.}}L){{/minimum}}{{#maximum}} @Max({{.}}L){{/maximum}}{{/isLong}}{{! Not Integer, not Long => we have a decimal value! -}}{{^isInteger}}{{^isLong}}{{#minimum}} @DecimalMin("{{minimum}}"){{/minimum}}{{#maximum}} @DecimalMax("{{maximum}}"){{/maximum}}{{/isLong}}{{/isInteger}} \ No newline at end of file +}}{{^isInteger}}{{^isLong}}{{#minimum}} @DecimalMin("{{.}}"){{/minimum}}{{#maximum}} @DecimalMax("{{.}}"){{/maximum}}{{/isLong}}{{/isInteger}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/microprofile/beanValidationHeaderParams.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/microprofile/beanValidationHeaderParams.mustache index f8eef8f94c7..c4ff01d7e55 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/microprofile/beanValidationHeaderParams.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/microprofile/beanValidationHeaderParams.mustache @@ -1 +1 @@ -{{#required}} @NotNull{{/required}}{{>beanValidationCore}} \ No newline at end of file +{{#required}} @NotNull{{/required}}{{>beanValidationCore}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/microprofile/beanValidationQueryParams.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/microprofile/beanValidationQueryParams.mustache index f8eef8f94c7..c4ff01d7e55 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/microprofile/beanValidationQueryParams.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/microprofile/beanValidationQueryParams.mustache @@ -1 +1 @@ -{{#required}} @NotNull{{/required}}{{>beanValidationCore}} \ No newline at end of file +{{#required}} @NotNull{{/required}}{{>beanValidationCore}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/microprofile/enumClass.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/microprofile/enumClass.mustache index 87d5ee699a5..38127a63741 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/microprofile/enumClass.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/microprofile/enumClass.mustache @@ -13,7 +13,7 @@ {{#enumVars}}@XmlEnumValue({{#isInteger}}"{{/isInteger}}{{#isDouble}}"{{/isDouble}}{{#isLong}}"{{/isLong}}{{#isFloat}}"{{/isFloat}}{{{value}}}{{#isInteger}}"{{/isInteger}}{{#isDouble}}"{{/isDouble}}{{#isLong}}"{{/isLong}}{{#isFloat}}"{{/isFloat}}) {{name}}({{dataType}}.valueOf({{{value}}})){{^-last}}, {{/-last}}{{#-last}};{{/-last}}{{/enumVars}} {{/withXml}} {{^withXml}} - {{#enumVars}}{{name}}({{dataType}}.valueOf({{{value}}})){{^-last}}, {{/-last}}{{#-last}};{{/-last}}{{/enumVars}} + {{#enumVars}}{{name}}({{dataType}}.valueOf({{{value}}})){{^-last}}, {{/-last}}{{#-last}};{{/-last}}{{/enumVars}} {{/withXml}} {{/allowableValues}} @@ -35,7 +35,7 @@ {{#withXml}} public static {{datatypeWithEnum}} fromValue(String v) { - for ({{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} b : {{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}}.values()) { + for ({{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} b : {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}}.values()) { if (String.valueOf(b.value).equals(v)) { return b; } @@ -47,7 +47,7 @@ public static final class Deserializer implements JsonbDeserializer<{{datatypeWithEnum}}> { @Override public {{datatypeWithEnum}} deserialize(JsonParser parser, DeserializationContext ctx, Type rtType) { - for ({{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} b : {{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}}.values()) { + for ({{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} b : {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}}.values()) { if (String.valueOf(b.value).equals(parser.getString())) { return b; } diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/microprofile/enumOuterClass.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/microprofile/enumOuterClass.mustache index c56eca64b1e..894ce951f38 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/microprofile/enumOuterClass.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/microprofile/enumOuterClass.mustache @@ -4,9 +4,9 @@ import com.fasterxml.jackson.annotation.JsonValue; {{/jackson}} /** - * {{^description}}Gets or Sets {{{name}}}{{/description}}{{#description}}{{description}}{{/description}} + * {{description}}{{^description}}Gets or Sets {{{name}}}{{/description}} */ -{{>additionalEnumTypeAnnotations}}public enum {{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} { +{{>additionalEnumTypeAnnotations}}public enum {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} { {{#gson}} {{#allowableValues}}{{#enumVars}} @SerializedName({{#isInteger}}"{{/isInteger}}{{#isDouble}}"{{/isDouble}}{{#isLong}}"{{/isLong}}{{#isFloat}}"{{/isFloat}}{{{value}}}{{#isInteger}}"{{/isInteger}}{{#isDouble}}"{{/isDouble}}{{#isLong}}"{{/isLong}}{{#isFloat}}"{{/isFloat}}) @@ -21,14 +21,14 @@ import com.fasterxml.jackson.annotation.JsonValue; private {{{dataType}}} value; - {{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}}({{{dataType}}} value) { + {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}}({{{dataType}}} value) { this.value = value; } @Override {{#jackson}} @JsonValue -{{/jackson}} +{{/jackson}} public String toString() { return String.valueOf(value); } @@ -36,13 +36,13 @@ import com.fasterxml.jackson.annotation.JsonValue; {{#jackson}} @JsonCreator {{/jackson}} - public static {{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} fromValue(String text) { - for ({{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} b : {{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}}.values()) { + public static {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} fromValue(String text) { + for ({{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} b : {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}}.values()) { if (String.valueOf(b.value).equals(text)) { return b; } } {{#useNullForUnknownEnumValue}}return null;{{/useNullForUnknownEnumValue}}{{^useNullForUnknownEnumValue}}throw new IllegalArgumentException("Unexpected value '" + text + "'");{{/useNullForUnknownEnumValue}} } - + } diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/microprofile/licenseInfo.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/microprofile/licenseInfo.mustache index 9866f297a4d..be193d0c4fe 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/microprofile/licenseInfo.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/microprofile/licenseInfo.mustache @@ -2,8 +2,8 @@ * {{{appName}}} * {{{appDescription}}} * - * {{#version}}The version of the OpenAPI document: {{{version}}}{{/version}} - * {{#infoEmail}}Contact: {{{infoEmail}}}{{/infoEmail}} + * {{#version}}The version of the OpenAPI document: {{{.}}}{{/version}} + * {{#infoEmail}}Contact: {{{.}}}{{/infoEmail}} * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/microprofile/pojo.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/microprofile/pojo.mustache index 183b60cc1ac..13413bd16a0 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/microprofile/pojo.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/microprofile/pojo.mustache @@ -30,11 +30,11 @@ import javax.json.bind.annotation.JsonbProperty; {{/withXml}} {{#description}} /** - * {{{description}}} + * {{{.}}} **/ {{/description}} {{>additionalModelTypeAnnotations}} -public class {{classname}} {{#parent}}extends {{{parent}}}{{/parent}}{{#serializableModel}} implements Serializable{{/serializableModel}} { +public class {{classname}} {{#parent}}extends {{{.}}}{{/parent}}{{#serializableModel}} implements Serializable{{/serializableModel}} { {{#vars}}{{#isEnum}}{{^isContainer}} {{>enumClass}}{{/isContainer}}{{#isContainer}}{{#mostInnerItems}} {{>enumClass}}{{/mostInnerItems}}{{/isContainer}}{{/isEnum}} @@ -43,7 +43,7 @@ public class {{classname}} {{#parent}}extends {{{parent}}}{{/parent}}{{#serializ {{/withXml}} {{#description}} /** - * {{{description}}} + * {{{.}}} **/ {{/description}} {{^withXml}} @@ -56,20 +56,20 @@ public class {{classname}} {{#parent}}extends {{{parent}}}{{/parent}}{{#serializ private {{{datatypeWithEnum}}} {{name}}{{#defaultValue}} = {{{.}}}{{/defaultValue}}; {{/isContainer}} {{/vars}} - + {{#vars}} /** {{#description}} - * {{description}} + * {{.}} {{/description}} {{^description}} * Get {{name}} {{/description}} {{#minimum}} - * minimum: {{minimum}} + * minimum: {{.}} {{/minimum}} {{#maximum}} - * maximum: {{maximum}} + * maximum: {{.}} {{/maximum}} * @return {{name}} {{#deprecated}} diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/microprofile/pom.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/microprofile/pom.mustache index b43a110aed7..d1a4e5352dc 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/microprofile/pom.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/microprofile/pom.mustache @@ -5,7 +5,7 @@ jar {{artifactId}} {{#appDescription}} - {{appDescription}} + {{.}} {{/appDescription}} {{artifactVersion}} @@ -125,7 +125,7 @@ activation 1.1.1 - + {{#java8}} com.fasterxml.jackson.datatype @@ -140,7 +140,7 @@ ${jackson-jaxrs-version} {{/java8}} -{{#useBeanValidationFeature}} +{{#useBeanValidationFeature}} org.hibernate hibernate-validator diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/microprofile/queryParams.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/microprofile/queryParams.mustache index f89529fdb5d..38bfb9ed06e 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/microprofile/queryParams.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/microprofile/queryParams.mustache @@ -1 +1 @@ -{{#isQueryParam}}@QueryParam("{{baseName}}"){{#useBeanValidation}}{{>beanValidationQueryParams}}{{/useBeanValidation}} {{^isContainer}}{{#defaultValue}}@DefaultValue("{{{defaultValue}}}") {{/defaultValue}}{{/isContainer}}{{{dataType}}} {{paramName}}{{/isQueryParam}} \ No newline at end of file +{{#isQueryParam}}@QueryParam("{{baseName}}"){{#useBeanValidation}}{{>beanValidationQueryParams}}{{/useBeanValidation}} {{^isContainer}}{{#defaultValue}}@DefaultValue("{{{.}}}") {{/defaultValue}}{{/isContainer}}{{{dataType}}} {{paramName}}{{/isQueryParam}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/microprofile/returnTypes.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/microprofile/returnTypes.mustache index 6af86ffe4e4..32f96a90472 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/microprofile/returnTypes.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/microprofile/returnTypes.mustache @@ -1,4 +1,4 @@ -{{#useGenericResponse}}Response{{/useGenericResponse}}{{! non-generic response: +{{#useGenericResponse}}Response{{/useGenericResponse}}{{! non-generic response: }}{{^useGenericResponse}}{{! }}{{{returnType}}}{{! }}{{/useGenericResponse}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/native/ApiClient.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/native/ApiClient.mustache index ea46db7331d..07ca3588724 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/native/ApiClient.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/native/ApiClient.mustache @@ -375,7 +375,7 @@ public class ApiClient { this.readTimeout = readTimeout; return this; } - + /** * Get the read timeout that was set. * diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/native/ApiResponse.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/native/ApiResponse.mustache index 1f3f3a31981..1e277319a93 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/native/ApiResponse.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/native/ApiResponse.mustache @@ -5,7 +5,7 @@ package {{invokerPackage}}; import java.util.List; import java.util.Map; {{#caseInsensitiveResponseHeaders}} -import java.util.Map.Entry; +import java.util.Map.Entry; import java.util.TreeMap; {{/caseInsensitiveResponseHeaders}} diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/native/README.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/native/README.mustache index 0f6d46a460b..ef15f379a13 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/native/README.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/native/README.mustache @@ -8,7 +8,7 @@ - Build date: {{generatedDate}} {{/hideGenerationTimestamp}} -{{#appDescriptionWithNewLines}}{{{appDescriptionWithNewLines}}}{{/appDescriptionWithNewLines}} +{{{appDescriptionWithNewLines}}} {{#infoUrl}} For more information, please visit [{{{infoUrl}}}]({{{infoUrl}}}) @@ -130,8 +130,8 @@ All URIs are relative to *{{basePath}}* Class | Method | HTTP request | Description ------------ | ------------- | ------------- | ------------- -{{#apiInfo}}{{#apis}}{{#operations}}{{#operation}}*{{classname}}* | [**{{operationId}}**]({{apiDocPath}}{{classname}}.md#{{operationId}}) | **{{httpMethod}}** {{path}} | {{#summary}}{{summary}}{{/summary}} -*{{classname}}* | [**{{operationId}}WithHttpInfo**]({{apiDocPath}}{{classname}}.md#{{operationId}}WithHttpInfo) | **{{httpMethod}}** {{path}} | {{#summary}}{{summary}}{{/summary}} +{{#apiInfo}}{{#apis}}{{#operations}}{{#operation}}*{{classname}}* | [**{{operationId}}**]({{apiDocPath}}{{classname}}.md#{{operationId}}) | **{{httpMethod}}** {{path}} | {{summary}} +*{{classname}}* | [**{{operationId}}WithHttpInfo**]({{apiDocPath}}{{classname}}.md#{{operationId}}WithHttpInfo) | **{{httpMethod}}** {{path}} | {{summary}} {{/operation}}{{/operations}}{{/apis}}{{/apiInfo}} ## Documentation for Models diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/native/api.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/native/api.mustache index 35922945360..b57129dcdb2 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/native/api.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/native/api.mustache @@ -111,7 +111,7 @@ public class {{classname}} { * {{summary}} * {{notes}} * @param apiRequest {@link API{{operationId}}Request} - * @return {{#asyncNative}}CompletableFuture<{{/asyncNative}}ApiResponse<{{#returnType}}{{returnType}}{{/returnType}}{{^returnType}}Void{{/returnType}}>{{#asyncNative}}>{{/asyncNative}} + * @return {{#asyncNative}}CompletableFuture<{{/asyncNative}}ApiResponse<{{returnType}}{{^returnType}}Void{{/returnType}}>{{#asyncNative}}>{{/asyncNative}} * @throws ApiException if fails to make API call {{#isDeprecated}} * @deprecated @@ -124,7 +124,7 @@ public class {{classname}} { {{#isDeprecated}} @Deprecated {{/isDeprecated}} - public {{#asyncNative}}CompletableFuture<{{/asyncNative}}ApiResponse<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}Void{{/returnType}}>{{#asyncNative}}>{{/asyncNative}} {{operationId}}WithHttpInfo(API{{operationId}}Request apiRequest) throws ApiException { + public {{#asyncNative}}CompletableFuture<{{/asyncNative}}ApiResponse<{{{returnType}}}{{^returnType}}Void{{/returnType}}>{{#asyncNative}}>{{/asyncNative}} {{operationId}}WithHttpInfo(API{{operationId}}Request apiRequest) throws ApiException { {{#allParams}} {{{dataType}}} {{paramName}} = apiRequest.{{paramName}}(); {{/allParams}} @@ -156,7 +156,7 @@ public class {{classname}} { {{/isDeprecated}} public {{#returnType}}{{#asyncNative}}CompletableFuture<{{{returnType}}}>{{/asyncNative}}{{^asyncNative}}{{{returnType}}}{{/asyncNative}}{{/returnType}}{{^returnType}}{{#asyncNative}}CompletableFuture{{/asyncNative}}{{^asyncNative}}void{{/asyncNative}}{{/returnType}} {{operationId}}({{#allParams}}{{{dataType}}} {{paramName}}{{^-last}}, {{/-last}}{{/allParams}}) throws ApiException { {{^asyncNative}} - {{#returnType}}ApiResponse<{{{returnType}}}> localVarResponse = {{/returnType}}{{operationId}}WithHttpInfo({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}); + {{#returnType}}ApiResponse<{{{.}}}> localVarResponse = {{/returnType}}{{operationId}}WithHttpInfo({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}); {{#returnType}} return localVarResponse.getData(); {{/returnType}} @@ -196,7 +196,7 @@ public class {{classname}} { {{#allParams}} * @param {{paramName}} {{description}}{{#required}} (required){{/required}}{{^required}} (optional{{^isContainer}}{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/isContainer}}{{/required}} {{/allParams}} - * @return {{#asyncNative}}CompletableFuture<{{/asyncNative}}ApiResponse<{{#returnType}}{{returnType}}{{/returnType}}{{^returnType}}Void{{/returnType}}>{{#asyncNative}}>{{/asyncNative}} + * @return {{#asyncNative}}CompletableFuture<{{/asyncNative}}ApiResponse<{{returnType}}{{^returnType}}Void{{/returnType}}>{{#asyncNative}}>{{/asyncNative}} * @throws ApiException if fails to make API call {{#isDeprecated}} * @deprecated @@ -209,7 +209,7 @@ public class {{classname}} { {{#isDeprecated}} @Deprecated {{/isDeprecated}} - public {{#asyncNative}}CompletableFuture<{{/asyncNative}}ApiResponse<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}Void{{/returnType}}>{{#asyncNative}}>{{/asyncNative}} {{operationId}}WithHttpInfo({{#allParams}}{{{dataType}}} {{paramName}}{{^-last}}, {{/-last}}{{/allParams}}) throws ApiException { + public {{#asyncNative}}CompletableFuture<{{/asyncNative}}ApiResponse<{{{returnType}}}{{^returnType}}Void{{/returnType}}>{{#asyncNative}}>{{/asyncNative}} {{operationId}}WithHttpInfo({{#allParams}}{{{dataType}}} {{paramName}}{{^-last}}, {{/-last}}{{/allParams}}) throws ApiException { {{^asyncNative}} HttpRequest.Builder localVarRequestBuilder = {{operationId}}RequestBuilder({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}); try { @@ -222,7 +222,7 @@ public class {{classname}} { if (localVarResponse.statusCode()/ 100 != 2) { throw getApiException("{{operationId}}", localVarResponse); } - return new ApiResponse<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}Void{{/returnType}}>( + return new ApiResponse<{{{returnType}}}{{^returnType}}Void{{/returnType}}>( localVarResponse.statusCode(), localVarResponse.headers().map(), {{#returnType}}memberVarObjectMapper.readValue(localVarResponse.body(), new TypeReference<{{{returnType}}}>() {}){{/returnType}}{{^returnType}}null{{/returnType}} diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/native/api_doc.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/native/api_doc.mustache index 23473757c36..3af38b33137 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/native/api_doc.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/native/api_doc.mustache @@ -1,13 +1,13 @@ # {{classname}}{{#description}} -{{description}}{{/description}} +{{.}}{{/description}} All URIs are relative to *{{basePath}}* Method | HTTP request | Description ------------- | ------------- | ------------- -{{#operations}}{{#operation}}[**{{operationId}}**]({{classname}}.md#{{operationId}}) | **{{httpMethod}}** {{path}} | {{#summary}}{{summary}}{{/summary}} -[**{{operationId}}WithHttpInfo**]({{classname}}.md#{{operationId}}WithHttpInfo) | **{{httpMethod}}** {{path}} | {{#summary}}{{summary}}{{/summary}} +{{#operations}}{{#operation}}[**{{operationId}}**]({{classname}}.md#{{operationId}}) | **{{httpMethod}}** {{path}} | {{summary}} +[**{{operationId}}WithHttpInfo**]({{classname}}.md#{{operationId}}WithHttpInfo) | **{{httpMethod}}** {{path}} | {{summary}} {{/operation}}{{/operations}} {{#operations}} @@ -24,7 +24,7 @@ Method | HTTP request | Description {{summary}}{{#notes}} -{{notes}}{{/notes}} +{{.}}{{/notes}} ### Example @@ -100,7 +100,7 @@ public class Example { {{^allParams}}This endpoint does not need any parameter.{{/allParams}}{{^vendorExtensions.x-group-parameters}}{{#allParams}}{{#-last}} Name | Type | Description | Notes ------------- | ------------- | ------------- | -------------{{/-last}}{{/allParams}} -{{#allParams}} **{{paramName}}** | {{#isPrimitiveType}}**{{dataType}}**{{/isPrimitiveType}}{{^isPrimitiveType}}{{#isFile}}**{{dataType}}**{{/isFile}}{{^isFile}}[**{{dataType}}**]({{baseType}}.md){{/isFile}}{{/isPrimitiveType}}| {{description}} |{{^required}} [optional]{{/required}}{{^isContainer}}{{#defaultValue}} [default to {{defaultValue}}]{{/defaultValue}}{{/isContainer}}{{#allowableValues}} [enum: {{#values}}{{{.}}}{{^-last}}, {{/-last}}{{/values}}]{{/allowableValues}} +{{#allParams}} **{{paramName}}** | {{#isPrimitiveType}}**{{dataType}}**{{/isPrimitiveType}}{{^isPrimitiveType}}{{#isFile}}**{{dataType}}**{{/isFile}}{{^isFile}}[**{{dataType}}**]({{baseType}}.md){{/isFile}}{{/isPrimitiveType}}| {{description}} |{{^required}} [optional]{{/required}}{{^isContainer}}{{#defaultValue}} [default to {{.}}]{{/defaultValue}}{{/isContainer}}{{#allowableValues}} [enum: {{#values}}{{{.}}}{{^-last}}, {{/-last}}{{/values}}]{{/allowableValues}} {{/allParams}} {{/vendorExtensions.x-group-parameters}} {{#vendorExtensions.x-group-parameters}} @@ -136,15 +136,15 @@ Name | Type | Description | Notes ## {{operationId}}WithHttpInfo {{^vendorExtensions.x-group-parameters}} -> {{#asyncNative}}CompletableFuture<{{/asyncNative}}ApiResponse<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}Void{{/returnType}}>{{#asyncNative}}>{{/asyncNative}} {{operationId}} {{operationId}}WithHttpInfo({{#allParams}}{{{paramName}}}{{^-last}}, {{/-last}}{{/allParams}}) +> {{#asyncNative}}CompletableFuture<{{/asyncNative}}ApiResponse<{{{returnType}}}{{^returnType}}Void{{/returnType}}>{{#asyncNative}}>{{/asyncNative}} {{operationId}} {{operationId}}WithHttpInfo({{#allParams}}{{{paramName}}}{{^-last}}, {{/-last}}{{/allParams}}) {{/vendorExtensions.x-group-parameters}} {{#vendorExtensions.x-group-parameters}} -> {{#asyncNative}}CompletableFuture<{{/asyncNative}}ApiResponse<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}Void{{/returnType}}>{{#asyncNative}}>{{/asyncNative}} {{operationId}} {{operationId}}WithHttpInfo({{#hasParams}}{{operationId}}Request{{/hasParams}}) +> {{#asyncNative}}CompletableFuture<{{/asyncNative}}ApiResponse<{{{returnType}}}{{^returnType}}Void{{/returnType}}>{{#asyncNative}}>{{/asyncNative}} {{operationId}} {{operationId}}WithHttpInfo({{#hasParams}}{{operationId}}Request{{/hasParams}}) {{/vendorExtensions.x-group-parameters}} {{summary}}{{#notes}} -{{notes}}{{/notes}} +{{.}}{{/notes}} ### Example @@ -192,7 +192,7 @@ public class Example { {{/allParams}} try { {{^vendorExtensions.x-group-parameters}} - {{#asyncNative}}CompletableFuture<{{/asyncNative}}ApiResponse<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}Void{{/returnType}}>{{#asyncNative}}>{{/asyncNative}} response = apiInstance.{{{operationId}}}WithHttpInfo({{#allParams}}{{{paramName}}}{{^-last}}, {{/-last}}{{/allParams}}); + {{#asyncNative}}CompletableFuture<{{/asyncNative}}ApiResponse<{{{returnType}}}{{^returnType}}Void{{/returnType}}>{{#asyncNative}}>{{/asyncNative}} response = apiInstance.{{{operationId}}}WithHttpInfo({{#allParams}}{{{paramName}}}{{^-last}}, {{/-last}}{{/allParams}}); {{/vendorExtensions.x-group-parameters}} {{#vendorExtensions.x-group-parameters}} {{#hasParams}} @@ -200,7 +200,7 @@ public class Example { .{{paramName}}({{paramName}}){{/allParams}} .build(); {{/hasParams}} - {{#asyncNative}}CompletableFuture<{{/asyncNative}}ApiResponse<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}Void{{/returnType}}>{{#asyncNative}}>{{/asyncNative}} response = apiInstance.{{{operationId}}}WithHttpInfo({{#hasParams}}request{{/hasParams}}); + {{#asyncNative}}CompletableFuture<{{/asyncNative}}ApiResponse<{{{returnType}}}{{^returnType}}Void{{/returnType}}>{{#asyncNative}}>{{/asyncNative}} response = apiInstance.{{{operationId}}}WithHttpInfo({{#hasParams}}request{{/hasParams}}); {{/vendorExtensions.x-group-parameters}} System.out.println("Status code: " + response{{#asyncNative}}.get(){{/asyncNative}}.getStatusCode()); System.out.println("Response headers: " + response{{#asyncNative}}.get(){{/asyncNative}}.getHeaders()); @@ -232,7 +232,7 @@ public class Example { {{^allParams}}This endpoint does not need any parameter.{{/allParams}}{{^vendorExtensions.x-group-parameters}}{{#allParams}}{{#-last}} Name | Type | Description | Notes ------------- | ------------- | ------------- | -------------{{/-last}}{{/allParams}} -{{#allParams}} **{{paramName}}** | {{#isPrimitiveType}}**{{dataType}}**{{/isPrimitiveType}}{{^isPrimitiveType}}{{#isFile}}**{{dataType}}**{{/isFile}}{{^isFile}}[**{{dataType}}**]({{baseType}}.md){{/isFile}}{{/isPrimitiveType}}| {{description}} |{{^required}} [optional]{{/required}}{{^isContainer}}{{#defaultValue}} [default to {{defaultValue}}]{{/defaultValue}}{{/isContainer}}{{#allowableValues}} [enum: {{#values}}{{{.}}}{{^-last}}, {{/-last}}{{/values}}]{{/allowableValues}} +{{#allParams}} **{{paramName}}** | {{#isPrimitiveType}}**{{dataType}}**{{/isPrimitiveType}}{{^isPrimitiveType}}{{#isFile}}**{{dataType}}**{{/isFile}}{{^isFile}}[**{{dataType}}**]({{baseType}}.md){{/isFile}}{{/isPrimitiveType}}| {{description}} |{{^required}} [optional]{{/required}}{{^isContainer}}{{#defaultValue}} [default to {{.}}]{{/defaultValue}}{{/isContainer}}{{#allowableValues}} [enum: {{#values}}{{{.}}}{{^-last}}, {{/-last}}{{/values}}]{{/allowableValues}} {{/allParams}} {{/vendorExtensions.x-group-parameters}} {{#vendorExtensions.x-group-parameters}} @@ -272,7 +272,7 @@ Name | Type | Description | Notes {{#allParams}}{{#-last}} | Name | Type | Description | Notes | | ------------- | ------------- | ------------- | -------------|{{/-last}}{{/allParams}} -{{#allParams}} **{{paramName}}** | {{#isPrimitiveType}}**{{dataType}}**{{/isPrimitiveType}}{{^isPrimitiveType}}{{#isFile}}**{{dataType}}**{{/isFile}}{{^isFile}}[**{{dataType}}**]({{baseType}}.md){{/isFile}}{{/isPrimitiveType}} | {{description}} |{{^required}} [optional]{{/required}}{{^isContainer}}{{#defaultValue}} [default to {{defaultValue}}]{{/defaultValue}}{{/isContainer}}{{#allowableValues}} [enum: {{#values}}{{{.}}}{{^-last}}, {{/-last}}{{/values}}]{{/allowableValues}} +{{#allParams}} **{{paramName}}** | {{#isPrimitiveType}}**{{dataType}}**{{/isPrimitiveType}}{{^isPrimitiveType}}{{#isFile}}**{{dataType}}**{{/isFile}}{{^isFile}}[**{{dataType}}**]({{baseType}}.md){{/isFile}}{{/isPrimitiveType}} | {{description}} |{{^required}} [optional]{{/required}}{{^isContainer}}{{#defaultValue}} [default to {{.}}]{{/defaultValue}}{{/isContainer}}{{#allowableValues}} [enum: {{#values}}{{{.}}}{{^-last}}, {{/-last}}{{/values}}]{{/allowableValues}} {{/allParams}} {{/hasParams}}{{/vendorExtensions.x-group-parameters}} diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/native/pojo.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/native/pojo.mustache index 2db2da784e9..20957c36c1f 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/native/pojo.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/native/pojo.mustache @@ -2,11 +2,11 @@ import {{invokerPackage}}.JSON; {{/discriminator}} /** - * {{#description}}{{.}}{{/description}}{{^description}}{{classname}}{{/description}}{{#isDeprecated}} + * {{description}}{{^description}}{{classname}}{{/description}}{{#isDeprecated}} * @deprecated{{/isDeprecated}} */{{#isDeprecated}} @Deprecated{{/isDeprecated}}{{#description}} -@ApiModel(description = "{{{description}}}"){{/description}} +@ApiModel(description = "{{{.}}}"){{/description}} {{#jackson}} @JsonPropertyOrder({ {{#vars}} @@ -15,7 +15,7 @@ import {{invokerPackage}}.JSON; }) {{/jackson}} {{>additionalModelTypeAnnotations}}{{>generatedAnnotation}}{{#discriminator}}{{>typeInfoAnnotation}}{{/discriminator}}{{>xmlAnnotation}} -public class {{classname}} {{#parent}}extends {{{parent}}} {{/parent}}{{#vendorExtensions.x-implements}}{{#-first}}implements {{{.}}}{{/-first}}{{^-first}}, {{{.}}}{{/-first}}{{#-last}} {{/-last}}{{/vendorExtensions.x-implements}}{ +public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtensions.x-implements}}{{#-first}}implements {{{.}}}{{/-first}}{{^-first}}, {{{.}}}{{/-first}}{{#-last}} {{/-last}}{{/vendorExtensions.x-implements}}{ {{#serializableModel}} private static final long serialVersionUID = 1L; @@ -41,21 +41,21 @@ public class {{classname}} {{#parent}}extends {{{parent}}} {{/parent}}{{#vendorE {{/jackson}} {{#withXml}} {{#isXmlAttribute}} - @XmlAttribute(name = "{{#xmlName}}{{xmlName}}{{/xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}") + @XmlAttribute(name = "{{xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}") {{/isXmlAttribute}} {{^isXmlAttribute}} {{^isContainer}} - @XmlElement({{#xmlNamespace}}namespace="{{xmlNamespace}}", {{/xmlNamespace}}name = "{{#xmlName}}{{xmlName}}{{/xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}") + @XmlElement({{#xmlNamespace}}namespace="{{.}}", {{/xmlNamespace}}name = "{{xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}") {{/isContainer}} {{#isContainer}} // Is a container wrapped={{isXmlWrapped}} {{#items}} // items.name={{name}} items.baseName={{baseName}} items.xmlName={{xmlName}} items.xmlNamespace={{xmlNamespace}} // items.example={{example}} items.type={{dataType}} - @XmlElement({{#xmlNamespace}}namespace="{{xmlNamespace}}", {{/xmlNamespace}}name = "{{#xmlName}}{{xmlName}}{{/xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}") + @XmlElement({{#xmlNamespace}}namespace="{{.}}", {{/xmlNamespace}}name = "{{xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}") {{/items}} {{#isXmlWrapped}} - @XmlElementWrapper({{#xmlNamespace}}namespace="{{xmlNamespace}}", {{/xmlNamespace}}name = "{{#xmlName}}{{xmlName}}{{/xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}") + @XmlElementWrapper({{#xmlNamespace}}namespace="{{.}}", {{/xmlNamespace}}name = "{{xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}") {{/isXmlWrapped}} {{/isContainer}} {{/isXmlAttribute}} @@ -180,16 +180,16 @@ public class {{classname}} {{#parent}}extends {{{parent}}} {{/parent}}{{#vendorE {{/isReadOnly}} /** {{#description}} - * {{description}} + * {{.}} {{/description}} {{^description}} * Get {{name}} {{/description}} {{#minimum}} - * minimum: {{minimum}} + * minimum: {{.}} {{/minimum}} {{#maximum}} - * maximum: {{maximum}} + * maximum: {{.}} {{/maximum}} * @return {{name}} {{#deprecated}} @@ -210,7 +210,7 @@ public class {{classname}} {{#parent}}extends {{{parent}}} {{/parent}}{{#vendorE {{^required}} @javax.annotation.Nullable {{/required}} -{{#useBeanValidation}}{{>beanValidation}}{{/useBeanValidation}} @ApiModelProperty({{#example}}example = "{{{example}}}", {{/example}}{{#required}}required = {{required}}, {{/required}}value = "{{{description}}}") +{{#useBeanValidation}}{{>beanValidation}}{{/useBeanValidation}} @ApiModelProperty({{#example}}example = "{{{.}}}", {{/example}}{{#required}}required = {{required}}, {{/required}}value = "{{{description}}}") {{#vendorExtensions.x-extra-annotation}} {{{vendorExtensions.x-extra-annotation}}} {{/vendorExtensions.x-extra-annotation}} diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/native/travis.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/native/travis.mustache index d489da682e9..c9464747923 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/native/travis.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/native/travis.mustache @@ -12,5 +12,5 @@ script: - mvn test # uncomment below to test using gradle # - gradle test - # uncomment below to test using sbt + # uncomment below to test using sbt # - sbt test diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/ApiClient.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/ApiClient.mustache index 37ebae04830..8b47536b9e8 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/ApiClient.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/ApiClient.mustache @@ -220,7 +220,7 @@ public class ApiClient { json = new JSON(); // Set default User-Agent. - setUserAgent("{{#httpUserAgent}}{{{.}}}{{/httpUserAgent}}{{^httpUserAgent}}OpenAPI-Generator/{{{artifactVersion}}}/java{{/httpUserAgent}}"); + setUserAgent("{{{httpUserAgent}}}{{^httpUserAgent}}OpenAPI-Generator/{{{artifactVersion}}}/java{{/httpUserAgent}}"); authentications = new HashMap(); {{#dynamicOperations}} diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/ProgressResponseBody.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/ProgressResponseBody.mustache index 50f2eba395a..45115940b66 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/ProgressResponseBody.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/ProgressResponseBody.mustache @@ -57,5 +57,3 @@ public class ProgressResponseBody extends ResponseBody { }; } } - - diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/README.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/README.mustache index 5b4ff7e38f5..dd21bcad45f 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/README.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/README.mustache @@ -6,7 +6,7 @@ - Build date: {{generatedDate}} {{/hideGenerationTimestamp}} -{{#appDescriptionWithNewLines}}{{{appDescriptionWithNewLines}}}{{/appDescriptionWithNewLines}} +{{{appDescriptionWithNewLines}}} {{#infoUrl}} For more information, please visit [{{{infoUrl}}}]({{{infoUrl}}}) @@ -114,7 +114,7 @@ public class Example { {{{dataType}}} {{{paramName}}} = {{{example}}}; // {{{dataType}}} | {{{description}}} {{/allParams}} try { - {{#returnType}}{{{returnType}}} result = {{/returnType}}apiInstance.{{{operationId}}}{{^vendorExtensions.x-group-parameters}}({{#allParams}}{{{paramName}}}{{^-last}}, {{/-last}}{{/allParams}});{{/vendorExtensions.x-group-parameters}}{{#vendorExtensions.x-group-parameters}}({{#requiredParams}}{{{paramName}}}{{^-last}}, {{/-last}}{{/requiredParams}}){{#optionalParams}} + {{#returnType}}{{{.}}} result = {{/returnType}}apiInstance.{{{operationId}}}{{^vendorExtensions.x-group-parameters}}({{#allParams}}{{{paramName}}}{{^-last}}, {{/-last}}{{/allParams}});{{/vendorExtensions.x-group-parameters}}{{#vendorExtensions.x-group-parameters}}({{#requiredParams}}{{{paramName}}}{{^-last}}, {{/-last}}{{/requiredParams}}){{#optionalParams}} .{{{paramName}}}({{{paramName}}}){{/optionalParams}} .execute();{{/vendorExtensions.x-group-parameters}}{{#returnType}} System.out.println(result);{{/returnType}} @@ -136,7 +136,7 @@ All URIs are relative to *{{basePath}}* Class | Method | HTTP request | Description ------------ | ------------- | ------------- | ------------- -{{#apiInfo}}{{#apis}}{{#operations}}{{#operation}}*{{classname}}* | [**{{operationId}}**]({{apiDocPath}}{{classname}}.md#{{operationId}}) | **{{httpMethod}}** {{path}} | {{#summary}}{{summary}}{{/summary}} +{{#apiInfo}}{{#apis}}{{#operations}}{{#operation}}*{{classname}}* | [**{{operationId}}**]({{apiDocPath}}{{classname}}.md#{{operationId}}) | **{{httpMethod}}** {{path}} | {{summary}} {{/operation}}{{/operations}}{{/apis}}{{/apiInfo}} ## Documentation for Models diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/api.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/api.mustache index 6f71a36cd97..2a0f89e94f6 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/api.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/api.mustache @@ -136,7 +136,7 @@ public class {{classname}} { {{^dynamicOperations}} {{#queryParams}} if ({{paramName}} != null) { - {{#collectionFormat}}localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("{{{collectionFormat}}}", {{/collectionFormat}}{{^collectionFormat}}localVarQueryParams.addAll(localVarApiClient.parameterToPair({{/collectionFormat}}"{{baseName}}", {{paramName}})); + {{#collectionFormat}}localVarCollectionQueryParams.addAll(localVarApiClient.parameterToPairs("{{{.}}}", {{/collectionFormat}}{{^collectionFormat}}localVarQueryParams.addAll(localVarApiClient.parameterToPair({{/collectionFormat}}"{{baseName}}", {{paramName}})); } {{/queryParams}} @@ -225,7 +225,7 @@ public class {{classname}} { * {{summary}} * {{notes}}{{#allParams}} * @param {{paramName}} {{description}}{{#required}} (required){{/required}}{{^required}} (optional{{^isContainer}}{{#defaultValue}}, default to {{.}}{{/defaultValue}}{{/isContainer}}){{/required}}{{/allParams}}{{#returnType}} - * @return {{returnType}}{{/returnType}} + * @return {{.}}{{/returnType}} * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body {{#responses.0}} * @http.response.details @@ -247,8 +247,8 @@ public class {{classname}} { {{#isDeprecated}} @Deprecated {{/isDeprecated}} - public {{#returnType}}{{{returnType}}} {{/returnType}}{{^returnType}}void {{/returnType}}{{operationId}}({{#allParams}}{{{dataType}}} {{paramName}}{{^-last}}, {{/-last}}{{/allParams}}) throws ApiException { - {{#returnType}}ApiResponse<{{{returnType}}}> localVarResp = {{/returnType}}{{operationId}}WithHttpInfo({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}});{{#returnType}} + public {{#returnType}}{{{.}}} {{/returnType}}{{^returnType}}void {{/returnType}}{{operationId}}({{#allParams}}{{{dataType}}} {{paramName}}{{^-last}}, {{/-last}}{{/allParams}}) throws ApiException { + {{#returnType}}ApiResponse<{{{.}}}> localVarResp = {{/returnType}}{{operationId}}WithHttpInfo({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}});{{#returnType}} return localVarResp.getData();{{/returnType}} } {{/vendorExtensions.x-group-parameters}} @@ -257,7 +257,7 @@ public class {{classname}} { * {{summary}} * {{notes}}{{#allParams}} * @param {{paramName}} {{description}}{{#required}} (required){{/required}}{{^required}} (optional{{^isContainer}}{{#defaultValue}}, default to {{.}}{{/defaultValue}}{{/isContainer}}){{/required}}{{/allParams}} - * @return ApiResponse<{{#returnType}}{{returnType}}{{/returnType}}{{^returnType}}Void{{/returnType}}> + * @return ApiResponse<{{returnType}}{{^returnType}}Void{{/returnType}}> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body {{#responses.0}} * @http.response.details @@ -279,7 +279,7 @@ public class {{classname}} { {{#isDeprecated}} @Deprecated {{/isDeprecated}} - public{{/vendorExtensions.x-group-parameters}}{{#vendorExtensions.x-group-parameters}}private{{/vendorExtensions.x-group-parameters}} ApiResponse<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}Void{{/returnType}}> {{operationId}}WithHttpInfo({{#allParams}}{{#useBeanValidation}}{{>beanValidationQueryParams}}{{/useBeanValidation}}{{{dataType}}} {{paramName}}{{^-last}}, {{/-last}}{{/allParams}}) throws ApiException { + public{{/vendorExtensions.x-group-parameters}}{{#vendorExtensions.x-group-parameters}}private{{/vendorExtensions.x-group-parameters}} ApiResponse<{{{returnType}}}{{^returnType}}Void{{/returnType}}> {{operationId}}WithHttpInfo({{#allParams}}{{#useBeanValidation}}{{>beanValidationQueryParams}}{{/useBeanValidation}}{{{dataType}}} {{paramName}}{{^-last}}, {{/-last}}{{/allParams}}) throws ApiException { okhttp3.Call localVarCall = {{operationId}}ValidateBeforeCall({{#allParams}}{{paramName}}, {{/allParams}}null); {{#returnType}}Type localVarReturnType = new TypeToken<{{{returnType}}}>(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType);{{/returnType}}{{^returnType}}return localVarApiClient.execute(localVarCall);{{/returnType}} @@ -312,7 +312,7 @@ public class {{classname}} { {{#isDeprecated}} @Deprecated {{/isDeprecated}} - public{{/vendorExtensions.x-group-parameters}}{{#vendorExtensions.x-group-parameters}}private{{/vendorExtensions.x-group-parameters}} okhttp3.Call {{operationId}}Async({{#allParams}}{{{dataType}}} {{paramName}}, {{/allParams}}final ApiCallback<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}Void{{/returnType}}> _callback) throws ApiException { + public{{/vendorExtensions.x-group-parameters}}{{#vendorExtensions.x-group-parameters}}private{{/vendorExtensions.x-group-parameters}} okhttp3.Call {{operationId}}Async({{#allParams}}{{{dataType}}} {{paramName}}, {{/allParams}}final ApiCallback<{{{returnType}}}{{^returnType}}Void{{/returnType}}> _callback) throws ApiException { okhttp3.Call localVarCall = {{operationId}}ValidateBeforeCall({{#allParams}}{{paramName}}, {{/allParams}}_callback); {{#returnType}}Type localVarReturnType = new TypeToken<{{{returnType}}}>(){}.getType(); @@ -374,7 +374,7 @@ public class {{classname}} { /** * Execute {{operationId}} request{{#returnType}} - * @return {{returnType}}{{/returnType}} + * @return {{.}}{{/returnType}} * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body {{#responses.0}} * @http.response.details @@ -392,14 +392,14 @@ public class {{classname}} { {{#isDeprecated}} @Deprecated {{/isDeprecated}} - public {{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}void{{/returnType}} execute() throws ApiException { - {{#returnType}}ApiResponse<{{{returnType}}}> localVarResp = {{/returnType}}{{operationId}}WithHttpInfo({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}});{{#returnType}} + public {{{returnType}}}{{^returnType}}void{{/returnType}} execute() throws ApiException { + {{#returnType}}ApiResponse<{{{.}}}> localVarResp = {{/returnType}}{{operationId}}WithHttpInfo({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}});{{#returnType}} return localVarResp.getData();{{/returnType}} } /** * Execute {{operationId}} request with HTTP info returned - * @return ApiResponse<{{#returnType}}{{returnType}}{{/returnType}}{{^returnType}}Void{{/returnType}}> + * @return ApiResponse<{{returnType}}{{^returnType}}Void{{/returnType}}> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body {{#responses.0}} * @http.response.details @@ -417,7 +417,7 @@ public class {{classname}} { {{#isDeprecated}} @Deprecated {{/isDeprecated}} - public ApiResponse<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}Void{{/returnType}}> executeWithHttpInfo() throws ApiException { + public ApiResponse<{{{returnType}}}{{^returnType}}Void{{/returnType}}> executeWithHttpInfo() throws ApiException { return {{operationId}}WithHttpInfo({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}); } @@ -442,7 +442,7 @@ public class {{classname}} { {{#isDeprecated}} @Deprecated {{/isDeprecated}} - public okhttp3.Call executeAsync(final ApiCallback<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}Void{{/returnType}}> _callback) throws ApiException { + public okhttp3.Call executeAsync(final ApiCallback<{{{returnType}}}{{^returnType}}Void{{/returnType}}> _callback) throws ApiException { return {{operationId}}Async({{#allParams}}{{paramName}}, {{/allParams}}_callback); } } diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/api_doc.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/api_doc.mustache index 332088661a9..5a4e3969c93 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/api_doc.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/api_doc.mustache @@ -1,23 +1,23 @@ # {{classname}}{{#description}} -{{description}}{{/description}} +{{.}}{{/description}} All URIs are relative to *{{basePath}}* Method | HTTP request | Description ------------- | ------------- | ------------- -{{#operations}}{{#operation}}[**{{operationId}}**]({{classname}}.md#{{operationId}}) | **{{httpMethod}}** {{path}} | {{#summary}}{{summary}}{{/summary}} +{{#operations}}{{#operation}}[**{{operationId}}**]({{classname}}.md#{{operationId}}) | **{{httpMethod}}** {{path}} | {{summary}} {{/operation}}{{/operations}} {{#operations}} {{#operation}} # **{{operationId}}**{{^vendorExtensions.x-group-parameters}} -> {{#returnType}}{{returnType}} {{/returnType}}{{operationId}}({{#allParams}}{{{paramName}}}{{^-last}}, {{/-last}}{{/allParams}}){{/vendorExtensions.x-group-parameters}}{{#vendorExtensions.x-group-parameters}} -> {{#returnType}}{{returnType}} {{/returnType}}{{operationId}}({{#requiredParams}}{{paramName}}{{^-last}}, {{/-last}}{{/requiredParams}}){{#optionalParams}}.{{paramName}}({{paramName}}){{/optionalParams}}.execute();{{/vendorExtensions.x-group-parameters}} +> {{#returnType}}{{.}} {{/returnType}}{{operationId}}({{#allParams}}{{{paramName}}}{{^-last}}, {{/-last}}{{/allParams}}){{/vendorExtensions.x-group-parameters}}{{#vendorExtensions.x-group-parameters}} +> {{#returnType}}{{.}} {{/returnType}}{{operationId}}({{#requiredParams}}{{paramName}}{{^-last}}, {{/-last}}{{/requiredParams}}){{#optionalParams}}.{{paramName}}({{paramName}}){{/optionalParams}}.execute();{{/vendorExtensions.x-group-parameters}} {{summary}}{{#notes}} -{{notes}}{{/notes}} +{{.}}{{/notes}} ### Example ```java @@ -58,7 +58,7 @@ public class Example { {{{dataType}}} {{{paramName}}} = {{{example}}}; // {{{dataType}}} | {{{description}}} {{/allParams}} try { - {{#returnType}}{{{returnType}}} result = {{/returnType}}apiInstance.{{{operationId}}}{{^vendorExtensions.x-group-parameters}}({{#allParams}}{{{paramName}}}{{^-last}}, {{/-last}}{{/allParams}});{{/vendorExtensions.x-group-parameters}}{{#vendorExtensions.x-group-parameters}}({{#requiredParams}}{{{paramName}}}{{^-last}}, {{/-last}}{{/requiredParams}}){{#optionalParams}} + {{#returnType}}{{{.}}} result = {{/returnType}}apiInstance.{{{operationId}}}{{^vendorExtensions.x-group-parameters}}({{#allParams}}{{{paramName}}}{{^-last}}, {{/-last}}{{/allParams}});{{/vendorExtensions.x-group-parameters}}{{#vendorExtensions.x-group-parameters}}({{#requiredParams}}{{{paramName}}}{{^-last}}, {{/-last}}{{/requiredParams}}){{#optionalParams}} .{{{paramName}}}({{{paramName}}}){{/optionalParams}} .execute();{{/vendorExtensions.x-group-parameters}}{{#returnType}} System.out.println(result);{{/returnType}} @@ -77,7 +77,7 @@ public class Example { {{^allParams}}This endpoint does not need any parameter.{{/allParams}}{{#allParams}}{{#-last}} Name | Type | Description | Notes ------------- | ------------- | ------------- | -------------{{/-last}}{{/allParams}} -{{#allParams}} **{{paramName}}** | {{#isPrimitiveType}}**{{dataType}}**{{/isPrimitiveType}}{{^isPrimitiveType}}{{#isFile}}**{{dataType}}**{{/isFile}}{{^isFile}}[**{{dataType}}**]({{baseType}}.md){{/isFile}}{{/isPrimitiveType}}| {{description}} |{{^required}} [optional]{{/required}}{{^isContainer}}{{#defaultValue}} [default to {{defaultValue}}]{{/defaultValue}}{{/isContainer}}{{#allowableValues}} [enum: {{#values}}{{{.}}}{{^-last}}, {{/-last}}{{/values}}]{{/allowableValues}} +{{#allParams}} **{{paramName}}** | {{#isPrimitiveType}}**{{dataType}}**{{/isPrimitiveType}}{{^isPrimitiveType}}{{#isFile}}**{{dataType}}**{{/isFile}}{{^isFile}}[**{{dataType}}**]({{baseType}}.md){{/isFile}}{{/isPrimitiveType}}| {{description}} |{{^required}} [optional]{{/required}}{{^isContainer}}{{#defaultValue}} [default to {{.}}]{{/defaultValue}}{{/isContainer}}{{#allowableValues}} [enum: {{#values}}{{{.}}}{{^-last}}, {{/-last}}{{/values}}]{{/allowableValues}} {{/allParams}} ### Return type diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/api_test.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/api_test.mustache index 050bf8617d6..2daa8f44dda 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/api_test.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/api_test.mustache @@ -37,7 +37,7 @@ public class {{classname}}Test { {{#allParams}} {{{dataType}}} {{paramName}} = null; {{/allParams}} - {{#returnType}}{{{returnType}}} response = {{/returnType}}api.{{operationId}}{{^vendorExtensions.x-group-parameters}}({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}});{{/vendorExtensions.x-group-parameters}}{{#vendorExtensions.x-group-parameters}}({{#requiredParams}}{{paramName}}{{^-last}}, {{/-last}}{{/requiredParams}}){{#optionalParams}} + {{#returnType}}{{{.}}} response = {{/returnType}}api.{{operationId}}{{^vendorExtensions.x-group-parameters}}({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}});{{/vendorExtensions.x-group-parameters}}{{#vendorExtensions.x-group-parameters}}({{#requiredParams}}{{paramName}}{{^-last}}, {{/-last}}{{/requiredParams}}){{#optionalParams}} .{{paramName}}({{paramName}}){{/optionalParams}} .execute();{{/vendorExtensions.x-group-parameters}} diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/build.gradle.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/build.gradle.mustache index f6002e0ef9e..e02068856b6 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/build.gradle.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/build.gradle.mustache @@ -110,7 +110,7 @@ dependencies { implementation 'io.gsonfire:gson-fire:1.8.4' {{#openApiNullable}} implementation 'org.openapitools:jackson-databind-nullable:0.2.1' - {{/openApiNullable}} + {{/openApiNullable}} {{#hasOAuthMethods}} implementation group: 'org.apache.oltu.oauth2', name: 'org.apache.oltu.oauth2.client', version: '1.0.1' {{/hasOAuthMethods}} diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/rest-assured/ApiClient.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/rest-assured/ApiClient.mustache index 1a691ea9482..2a0f41737c6 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/rest-assured/ApiClient.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/rest-assured/ApiClient.mustache @@ -19,7 +19,7 @@ import static {{invokerPackage}}.{{#gson}}GsonObjectMapper.gson{{/gson}}{{#jacks public class ApiClient { {{#basePath}} - public static final String BASE_URI = "{{basePath}}"; + public static final String BASE_URI = "{{.}}"; {{/basePath}} private final Config config; diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/rest-assured/README.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/rest-assured/README.mustache index a0fac9d41df..c9877589b5f 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/rest-assured/README.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/rest-assured/README.mustache @@ -40,4 +40,3 @@ It's recommended to create an instance of `ApiClient` per thread in a multithrea {{#apiInfo}}{{#apis}}{{#-last}}{{infoEmail}} {{/-last}}{{/apis}}{{/apiInfo}} - diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/rest-assured/api.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/rest-assured/api.mustache index dea1217125e..8d460251119 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/rest-assured/api.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/rest-assured/api.mustache @@ -71,7 +71,7 @@ public class {{classname}} { @ApiOperation(value = "{{{summary}}}", notes = "{{{notes}}}", nickname = "{{{operationId}}}", - tags = { {{#tags}}{{#name}}"{{{name}}}"{{/name}}{{^-last}}, {{/-last}}{{/tags}} }) + tags = { {{#tags}}{{#name}}"{{{.}}}"{{/name}}{{^-last}}, {{/-last}}{{/tags}} }) @ApiResponses(value = { {{#responses}} @ApiResponse(code = {{{code}}}, message = "{{{message}}}") {{^-last}},{{/-last}}{{/responses}} }) {{#isDeprecated}} @@ -103,7 +103,7 @@ public class {{classname}} { * @see #{{#isPathParam}}{{paramName}}Path{{/isPathParam}}{{#isQueryParam}}{{paramName}}Query{{/isQueryParam}}{{#isFormParam}}{{^isFile}}{{paramName}}Form{{/isFile}}{{#isFile}}{{paramName}}MultiPart{{/isFile}}{{/isFormParam}}{{#isHeaderParam}}{{paramName}}Header{{/isHeaderParam}}{{#isBodyParam}}body{{/isBodyParam}} {{description}}{{#required}} (required){{/required}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}} {{/allParams}} {{#returnType}} - * return {{returnType}} + * return {{.}} {{/returnType}} {{#isDeprecated}} * @deprecated diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/rest-assured/api_doc.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/rest-assured/api_doc.mustache index f173a89016e..c000bc962a1 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/rest-assured/api_doc.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/rest-assured/api_doc.mustache @@ -1,22 +1,22 @@ # {{classname}}{{#description}} -{{description}}{{/description}} +{{.}}{{/description}} All URIs are relative to *{{basePath}}* Method | HTTP request | Description ------------- | ------------- | ------------- -{{#operations}}{{#operation}}[**{{operationId}}**]({{classname}}.md#{{operationId}}) | **{{httpMethod}}** {{path}} | {{#summary}}{{summary}}{{/summary}} +{{#operations}}{{#operation}}[**{{operationId}}**]({{classname}}.md#{{operationId}}) | **{{httpMethod}}** {{path}} | {{summary}} {{/operation}}{{/operations}} {{#operations}} {{#operation}} # **{{operationId}}** -> {{#returnType}}{{returnType}} {{/returnType}}{{operationId}}({{#allParams}}{{{paramName}}}{{^-last}}, {{/-last}}{{/allParams}}) +> {{#returnType}}{{.}} {{/returnType}}{{operationId}}({{#allParams}}{{{paramName}}}{{^-last}}, {{/-last}}{{/allParams}}) {{summary}}{{#notes}} -{{notes}}{{/notes}} +{{.}}{{/notes}} ### Example ```java @@ -42,7 +42,7 @@ api.{{operationId}}(){{#allParams}}{{#required}}{{#isPathParam}} {{^allParams}}This endpoint does not need any parameter.{{/allParams}}{{#allParams}}{{#-last}} Name | Type | Description | Notes ------------- | ------------- | ------------- | -------------{{/-last}}{{/allParams}} -{{#allParams}} **{{paramName}}** | {{#isPrimitiveType}}**{{dataType}}**{{/isPrimitiveType}}{{^isPrimitiveType}}{{#isFile}}**{{dataType}}**{{/isFile}}{{^isFile}}[**{{dataType}}**]({{baseType}}.md){{/isFile}}{{/isPrimitiveType}}| {{description}} |{{^required}} [optional]{{/required}}{{#defaultValue}} [default to {{defaultValue}}]{{/defaultValue}}{{#allowableValues}} [enum: {{#values}}{{{.}}}{{^-last}}, {{/-last}}{{/values}}]{{/allowableValues}} +{{#allParams}} **{{paramName}}** | {{#isPrimitiveType}}**{{dataType}}**{{/isPrimitiveType}}{{^isPrimitiveType}}{{#isFile}}**{{dataType}}**{{/isFile}}{{^isFile}}[**{{dataType}}**]({{baseType}}.md){{/isFile}}{{/isPrimitiveType}}| {{description}} |{{^required}} [optional]{{/required}}{{#defaultValue}} [default to {{.}}]{{/defaultValue}}{{#allowableValues}} [enum: {{#values}}{{{.}}}{{^-last}}, {{/-last}}{{/values}}]{{/allowableValues}} {{/allParams}} ### Return type diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/rest-assured/build.gradle.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/rest-assured/build.gradle.mustache index 28c213b41b7..4659399ee1d 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/rest-assured/build.gradle.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/rest-assured/build.gradle.mustache @@ -24,7 +24,7 @@ if(hasProperty('target') && target == 'android') { apply plugin: 'com.android.library' apply plugin: 'com.github.dcendents.android-maven' - + android { compileSdkVersion 23 buildToolsVersion '23.0.2' @@ -36,7 +36,7 @@ if(hasProperty('target') && target == 'android') { sourceCompatibility JavaVersion.VERSION_1_8 targetCompatibility JavaVersion.VERSION_1_8 } - + // Rename the aar correctly libraryVariants.all { variant -> variant.outputs.each { output -> @@ -52,7 +52,7 @@ if(hasProperty('target') && target == 'android') { provided 'javax.annotation:jsr250-api:1.0' } } - + afterEvaluate { android.libraryVariants.all { variant -> def task = project.tasks.create "jar${variant.name.capitalize()}", Jar @@ -64,12 +64,12 @@ if(hasProperty('target') && target == 'android') { artifacts.add('archives', task); } } - + task sourcesJar(type: Jar) { from android.sourceSets.main.java.srcDirs classifier = 'sources' } - + artifacts { archives sourcesJar } @@ -87,7 +87,7 @@ if(hasProperty('target') && target == 'android') { pom.artifactId = '{{artifactId}}' } } - + task execute(type:JavaExec) { main = System.getProperty('mainClass') classpath = sourceSets.main.runtimeClasspath diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/resteasy/ApiClient.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/resteasy/ApiClient.mustache index 775e0efea40..79ebc96d370 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/resteasy/ApiClient.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/resteasy/ApiClient.mustache @@ -86,7 +86,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { this.json.setDateFormat((DateFormat) dateFormat.clone()); // Set default User-Agent. - setUserAgent("{{#httpUserAgent}}{{{.}}}{{/httpUserAgent}}{{^httpUserAgent}}OpenAPI-Generator/{{{artifactVersion}}}/java{{/httpUserAgent}}"); + setUserAgent("{{{httpUserAgent}}}{{^httpUserAgent}}OpenAPI-Generator/{{{artifactVersion}}}/java{{/httpUserAgent}}"); // Setup authentications (key: authentication name, value: authentication). authentications = new HashMap();{{#authMethods}}{{#isBasic}}{{#isBasicBasic}} diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/resteasy/api.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/resteasy/api.mustache index 85891614c0e..9194b7541a1 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/resteasy/api.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/resteasy/api.mustache @@ -56,7 +56,7 @@ public class {{classname}} { {{#isDeprecated}} @Deprecated {{/isDeprecated}} - public {{#returnType}}{{{returnType}}} {{/returnType}}{{^returnType}}void {{/returnType}}{{operationId}}({{#allParams}}{{{dataType}}} {{paramName}}{{^-last}}, {{/-last}}{{/allParams}}) throws ApiException { + public {{#returnType}}{{{.}}} {{/returnType}}{{^returnType}}void {{/returnType}}{{operationId}}({{#allParams}}{{{dataType}}} {{paramName}}{{^-last}}, {{/-last}}{{/allParams}}) throws ApiException { Object localVarPostBody = {{#bodyParam}}{{paramName}}{{/bodyParam}}{{^bodyParam}}null{{/bodyParam}}; {{#allParams}}{{#required}} // verify the required parameter '{{paramName}}' is set @@ -75,7 +75,7 @@ public class {{classname}} { {{javaUtilPrefix}}Map localVarFormParams = new {{javaUtilPrefix}}HashMap(); {{#queryParams}} - localVarQueryParams.addAll(apiClient.parameterToPairs("{{#collectionFormat}}{{{collectionFormat}}}{{/collectionFormat}}", "{{baseName}}", {{paramName}})); + localVarQueryParams.addAll(apiClient.parameterToPairs("{{{collectionFormat}}}", "{{baseName}}", {{paramName}})); {{/queryParams}} {{#headerParams}}if ({{paramName}} != null) diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/resttemplate/ApiClient.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/resttemplate/ApiClient.mustache index c4a9083f25c..33c4d1ec919 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/resttemplate/ApiClient.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/resttemplate/ApiClient.mustache @@ -868,4 +868,3 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { } } } - diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/resttemplate/api.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/resttemplate/api.mustache index 9c749da027a..cc207bd1b56 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/resttemplate/api.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/resttemplate/api.mustache @@ -54,13 +54,13 @@ public class {{classname}} { * {{summary}} * {{notes}} {{#responses}} - *

{{code}}{{#message}} - {{message}}{{/message}} + *

{{code}}{{#message}} - {{.}}{{/message}} {{/responses}} {{#allParams}} * @param {{paramName}} {{description}}{{#required}} (required){{/required}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}} {{/allParams}} {{#returnType}} - * @return {{returnType}} + * @return {{.}} {{/returnType}} * @throws RestClientException if an error occurs while attempting to invoke the API {{#externalDocs}} @@ -74,7 +74,7 @@ public class {{classname}} { {{#isDeprecated}} @Deprecated {{/isDeprecated}} - public {{#returnType}}{{{returnType}}} {{/returnType}}{{^returnType}}void {{/returnType}}{{operationId}}({{#allParams}}{{#isFile}}{{#useAbstractionForFiles}}{{#collectionFormat}}java.util.Collection{{/collectionFormat}}{{^collectionFormat}}org.springframework.core.io.Resource{{/collectionFormat}}{{/useAbstractionForFiles}}{{^useAbstractionForFiles}}{{{dataType}}}{{/useAbstractionForFiles}}{{/isFile}}{{^isFile}}{{{dataType}}}{{/isFile}} {{paramName}}{{^-last}}, {{/-last}}{{/allParams}}) throws RestClientException { + public {{#returnType}}{{{.}}} {{/returnType}}{{^returnType}}void {{/returnType}}{{operationId}}({{#allParams}}{{#isFile}}{{#useAbstractionForFiles}}{{#collectionFormat}}java.util.Collection{{/collectionFormat}}{{^collectionFormat}}org.springframework.core.io.Resource{{/collectionFormat}}{{/useAbstractionForFiles}}{{^useAbstractionForFiles}}{{{dataType}}}{{/useAbstractionForFiles}}{{/isFile}}{{^isFile}}{{{dataType}}}{{/isFile}} {{paramName}}{{^-last}}, {{/-last}}{{/allParams}}) throws RestClientException { {{#returnType}} return {{operationId}}WithHttpInfo({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}).getBody(); {{/returnType}} @@ -87,12 +87,12 @@ public class {{classname}} { * {{summary}} * {{notes}} {{#responses}} - *

{{code}}{{#message}} - {{message}}{{/message}} + *

{{code}}{{#message}} - {{.}}{{/message}} {{/responses}} {{#allParams}} * @param {{paramName}} {{description}}{{#required}} (required){{/required}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}} {{/allParams}} - * @return ResponseEntity<{{#returnType}}{{returnType}}{{/returnType}}{{^returnType}}Void{{/returnType}}> + * @return ResponseEntity<{{returnType}}{{^returnType}}Void{{/returnType}}> * @throws RestClientException if an error occurs while attempting to invoke the API {{#externalDocs}} * {{description}} @@ -105,7 +105,7 @@ public class {{classname}} { {{#isDeprecated}} @Deprecated {{/isDeprecated}} - public ResponseEntity<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}Void{{/returnType}}> {{operationId}}WithHttpInfo({{#allParams}}{{#isFile}}{{#useAbstractionForFiles}}{{#collectionFormat}}java.util.Collection{{/collectionFormat}}{{^collectionFormat}}org.springframework.core.io.Resource{{/collectionFormat}}{{/useAbstractionForFiles}}{{^useAbstractionForFiles}}{{{dataType}}}{{/useAbstractionForFiles}}{{/isFile}}{{^isFile}}{{{dataType}}}{{/isFile}} {{paramName}}{{^-last}}, {{/-last}}{{/allParams}}) throws RestClientException { + public ResponseEntity<{{{returnType}}}{{^returnType}}Void{{/returnType}}> {{operationId}}WithHttpInfo({{#allParams}}{{#isFile}}{{#useAbstractionForFiles}}{{#collectionFormat}}java.util.Collection{{/collectionFormat}}{{^collectionFormat}}org.springframework.core.io.Resource{{/collectionFormat}}{{/useAbstractionForFiles}}{{^useAbstractionForFiles}}{{{dataType}}}{{/useAbstractionForFiles}}{{/isFile}}{{^isFile}}{{{dataType}}}{{/isFile}} {{paramName}}{{^-last}}, {{/-last}}{{/allParams}}) throws RestClientException { Object postBody = {{#bodyParam}}{{paramName}}{{/bodyParam}}{{^bodyParam}}null{{/bodyParam}}; {{#allParams}}{{#required}} // verify the required parameter '{{paramName}}' is set @@ -122,7 +122,7 @@ public class {{classname}} { final MultiValueMap cookieParams = new LinkedMultiValueMap(); final MultiValueMap formParams = new LinkedMultiValueMap();{{#hasQueryParams}} - {{#queryParams}}queryParams.putAll(apiClient.parameterToMultiValueMap({{#collectionFormat}}ApiClient.CollectionFormat.valueOf("{{{collectionFormat}}}".toUpperCase(Locale.ROOT)){{/collectionFormat}}{{^collectionFormat}}null{{/collectionFormat}}, "{{baseName}}", {{paramName}}));{{^-last}} + {{#queryParams}}queryParams.putAll(apiClient.parameterToMultiValueMap({{#collectionFormat}}ApiClient.CollectionFormat.valueOf("{{{.}}}".toUpperCase(Locale.ROOT)){{/collectionFormat}}{{^collectionFormat}}null{{/collectionFormat}}, "{{baseName}}", {{paramName}}));{{^-last}} {{/-last}}{{/queryParams}}{{/hasQueryParams}}{{#hasHeaderParams}} {{#headerParams}}if ({{paramName}} != null) diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/resttemplate/api_test.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/resttemplate/api_test.mustache index 119194543c3..865572ae8cc 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/resttemplate/api_test.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/resttemplate/api_test.mustache @@ -36,7 +36,7 @@ public class {{classname}}Test { {{#allParams}} {{#isFile}}{{#useAbstractionForFiles}}{{#collectionFormat}}java.util.Collection{{/collectionFormat}}{{^collectionFormat}}org.springframework.core.io.Resource{{/collectionFormat}}{{/useAbstractionForFiles}}{{^useAbstractionForFiles}}{{{dataType}}}{{/useAbstractionForFiles}}{{/isFile}}{{^isFile}}{{{dataType}}}{{/isFile}} {{paramName}} = null; {{/allParams}} - {{#returnType}}{{{returnType}}} response = {{/returnType}}api.{{operationId}}({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}); + {{#returnType}}{{{.}}} response = {{/returnType}}api.{{operationId}}({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}); // TODO: test validations } diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/retrofit/CollectionFormats.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/retrofit/CollectionFormats.mustache index 33331adb026..dbfa4ae767b 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/retrofit/CollectionFormats.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/retrofit/CollectionFormats.mustache @@ -4,18 +4,18 @@ import java.util.Arrays; import java.util.List; public class CollectionFormats { - + public static class CSVParams { protected List params; - + public CSVParams() { } - + public CSVParams(List params) { this.params = params; } - + public CSVParams(String... params) { this.params = Arrays.asList(params); } @@ -27,23 +27,23 @@ public class CollectionFormats { public void setParams(List params) { this.params = params; } - + @Override public String toString() { return StringUtil.join(params.toArray(new String[0]), ","); } - + } - + public static class SPACEParams extends SSVParams { } public static class SSVParams extends CSVParams { - + public SSVParams() { } - + public SSVParams(List params) { super(params); } @@ -57,16 +57,16 @@ public class CollectionFormats { return StringUtil.join(params.toArray(new String[0]), " "); } } - + public static class TSVParams extends CSVParams { - + public TSVParams() { } - + public TSVParams(List params) { super(params); } - + public TSVParams(String... params) { super(params); } @@ -76,16 +76,16 @@ public class CollectionFormats { return StringUtil.join( params.toArray(new String[0]), "\t"); } } - + public static class PIPESParams extends CSVParams { - + public PIPESParams() { } - + public PIPESParams(List params) { super(params); } - + public PIPESParams(String... params) { super(params); } @@ -95,5 +95,5 @@ public class CollectionFormats { return StringUtil.join(params.toArray(new String[0]), "|"); } } - + } diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/retrofit/README.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/retrofit/README.mustache index a0fac9d41df..c9877589b5f 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/retrofit/README.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/retrofit/README.mustache @@ -40,4 +40,3 @@ It's recommended to create an instance of `ApiClient` per thread in a multithrea {{#apiInfo}}{{#apis}}{{#-last}}{{infoEmail}} {{/-last}}{{/apis}}{{/apiInfo}} - diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/retrofit/api.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/retrofit/api.mustache index 041b6a8e910..79e4ff1374b 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/retrofit/api.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/retrofit/api.mustache @@ -26,7 +26,7 @@ public interface {{classname}} { {{#allParams}} * @param {{paramName}} {{description}}{{#required}} (required){{/required}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}} {{/allParams}} - * @return {{#returnType}}{{returnType}}{{/returnType}}{{^returnType}}Void{{/returnType}} + * @return {{returnType}}{{^returnType}}Void{{/returnType}} {{#externalDocs}} * {{description}} * @see {{summary}} Documentation @@ -41,7 +41,7 @@ public interface {{classname}} { {{#formParams}}{{#-first}} {{#isMultipart}}@retrofit.http.Multipart{{/isMultipart}}{{^isMultipart}}@retrofit.http.FormUrlEncoded{{/isMultipart}}{{/-first}}{{/formParams}} @{{httpMethod}}("{{{path}}}") - {{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}Void{{/returnType}} {{operationId}}({{^allParams}});{{/allParams}} + {{{returnType}}}{{^returnType}}Void{{/returnType}} {{operationId}}({{^allParams}});{{/allParams}} {{#allParams}}{{>libraries/retrofit/queryParams}}{{>libraries/retrofit/pathParams}}{{>libraries/retrofit/headerParams}}{{>libraries/retrofit/bodyParams}}{{>libraries/retrofit/formParams}}{{^-last}}, {{/-last}}{{#-last}} );{{/-last}}{{/allParams}} @@ -67,7 +67,7 @@ public interface {{classname}} { {{#isMultipart}}@retrofit.http.Multipart{{/isMultipart}}{{^isMultipart}}@retrofit.http.FormUrlEncoded{{/isMultipart}}{{/-first}}{{/formParams}} @{{httpMethod}}("{{{path}}}") void {{operationId}}( - {{#allParams}}{{>libraries/retrofit/queryParams}}{{>libraries/retrofit/pathParams}}{{>libraries/retrofit/headerParams}}{{>libraries/retrofit/bodyParams}}{{>libraries/retrofit/formParams}}, {{/allParams}}Callback<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}Void{{/returnType}}> cb + {{#allParams}}{{>libraries/retrofit/queryParams}}{{>libraries/retrofit/pathParams}}{{>libraries/retrofit/headerParams}}{{>libraries/retrofit/bodyParams}}{{>libraries/retrofit/formParams}}, {{/allParams}}Callback<{{{returnType}}}{{^returnType}}Void{{/returnType}}> cb ); {{/operation}} } diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/retrofit/api_test.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/retrofit/api_test.mustache index db07fb825c9..112d7f73a80 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/retrofit/api_test.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/retrofit/api_test.mustache @@ -36,7 +36,7 @@ public class {{classname}}Test { {{#allParams}} {{{dataType}}} {{paramName}} = null; {{/allParams}} - // {{#returnType}}{{{returnType}}} response = {{/returnType}}api.{{operationId}}({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}); + // {{#returnType}}{{{.}}} response = {{/returnType}}api.{{operationId}}({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}); // TODO: test validations } diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/retrofit/auth/HttpBasicAuth.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/retrofit/auth/HttpBasicAuth.mustache index 394592f64d9..cf82b2775a7 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/retrofit/auth/HttpBasicAuth.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/retrofit/auth/HttpBasicAuth.mustache @@ -11,7 +11,7 @@ public class HttpBasicAuth implements Interceptor { private String username; private String password; - + public String getUsername() { return username; } diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/retrofit/auth/OAuth.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/retrofit/auth/OAuth.mustache index 4c39f4e629e..57bfd3df238 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/retrofit/auth/OAuth.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/retrofit/auth/OAuth.mustache @@ -66,7 +66,7 @@ public class OAuth implements Interceptor { break; default: break; - } + } } @Override @@ -93,7 +93,7 @@ public class OAuth implements Interceptor { if (getAccessToken() != null) { // Build the request Builder rb = request.newBuilder(); - + String requestAccessToken = new String(getAccessToken()); try { oAuthRequest = new OAuthBearerClientRequest(request.urlString()) @@ -102,15 +102,15 @@ public class OAuth implements Interceptor { } catch (OAuthSystemException e) { throw new IOException(e); } - + for ( Map.Entry header : oAuthRequest.getHeaders().entrySet() ) { rb.addHeader(header.getKey(), header.getValue()); } rb.url( oAuthRequest.getLocationUri()); - + //Execute the request Response response = chain.proceed(rb.build()); - + // 401/403 most likely indicates that access token has expired. Unless it happens two times in a row. if ( response != null && (response.code() == HTTP_UNAUTHORIZED || response.code() == HTTP_FORBIDDEN) && updateTokenAndRetryOnAuthorizationFailure ) { try { @@ -133,7 +133,7 @@ public class OAuth implements Interceptor { * Returns true if the access token has been updated */ public synchronized boolean updateAccessToken(String requestAccessToken) throws IOException { - if (getAccessToken() == null || getAccessToken().equals(requestAccessToken)) { + if (getAccessToken() == null || getAccessToken().equals(requestAccessToken)) { try { OAuthJSONAccessTokenResponse accessTokenResponse = oauthClient.accessToken(this.tokenRequestBuilder.buildBodyMessage()); if (accessTokenResponse != null && accessTokenResponse.getAccessToken() != null) { diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/retrofit/auth/OAuthOkHttpClient.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/retrofit/auth/OAuthOkHttpClient.mustache index ea195f7df04..48fc7ea4c1f 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/retrofit/auth/OAuthOkHttpClient.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/retrofit/auth/OAuthOkHttpClient.mustache @@ -53,7 +53,7 @@ public class OAuthOkHttpClient implements HttpClient { try { Response response = client.newCall(requestBuilder.build()).execute(); return OAuthClientResponseFactory.createCustomResponse( - response.body().string(), + response.body().string(), response.body().contentType().toString(), response.code(), responseClass); diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/ApiClient.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/ApiClient.mustache index de40d727587..1196f2c1372 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/ApiClient.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/ApiClient.mustache @@ -369,7 +369,7 @@ public class ApiClient { throw new RuntimeException("The ApiClient was created with a built OkHttpClient so it's not possible to add an authorization interceptor to it"); } okBuilder.addInterceptor(authorization); - + return this; } diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/README.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/README.mustache index 847b9d5a2a1..5e892a3fa50 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/README.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/README.mustache @@ -36,4 +36,3 @@ After the client library is installed/deployed, you can use it in your Maven pro {{#apiInfo}}{{#apis}}{{#-last}}{{infoEmail}} {{/-last}}{{/apis}}{{/apiInfo}} - diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/api.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/api.mustache index baa89192cd7..dd199a5e108 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/api.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/api.mustache @@ -47,7 +47,7 @@ public interface {{classname}} { {{#allParams}} * @param {{paramName}} {{description}}{{#required}} (required){{/required}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}} {{/allParams}} - * @return {{^doNotUseRx}}{{#useRxJava}}Observable<{{#isResponseFile}}ResponseBody{{/isResponseFile}}{{^isResponseFile}}{{#returnType}}{{returnType}}{{/returnType}}{{^returnType}}Void{{/returnType}}{{/isResponseFile}}>{{/useRxJava}}{{#useRxJava2}}{{#returnType}}Observable<{{#isResponseFile}}ResponseBody{{/isResponseFile}}{{^isResponseFile}}{{returnType}}{{/isResponseFile}}>{{/returnType}}{{^returnType}}Completable{{/returnType}}{{/useRxJava2}}{{#useRxJava3}}{{#returnType}}Observable<{{#isResponseFile}}ResponseBody{{/isResponseFile}}{{^isResponseFile}}{{returnType}}{{/isResponseFile}}>{{/returnType}}{{^returnType}}Completable{{/returnType}}{{/useRxJava3}}{{/doNotUseRx}}{{#doNotUseRx}}Call<{{#isResponseFile}}ResponseBody{{/isResponseFile}}{{^isResponseFile}}{{#returnType}}{{returnType}}{{/returnType}}{{^returnType}}Void{{/returnType}}{{/isResponseFile}}>{{/doNotUseRx}} + * @return {{^doNotUseRx}}{{#useRxJava}}Observable<{{#isResponseFile}}ResponseBody{{/isResponseFile}}{{^isResponseFile}}{{returnType}}{{^returnType}}Void{{/returnType}}{{/isResponseFile}}>{{/useRxJava}}{{#useRxJava2}}{{#returnType}}Observable<{{#isResponseFile}}ResponseBody{{/isResponseFile}}{{^isResponseFile}}{{returnType}}{{/isResponseFile}}>{{/returnType}}{{^returnType}}Completable{{/returnType}}{{/useRxJava2}}{{#useRxJava3}}{{#returnType}}Observable<{{#isResponseFile}}ResponseBody{{/isResponseFile}}{{^isResponseFile}}{{returnType}}{{/isResponseFile}}>{{/returnType}}{{^returnType}}Completable{{/returnType}}{{/useRxJava3}}{{/doNotUseRx}}{{#doNotUseRx}}Call<{{#isResponseFile}}ResponseBody{{/isResponseFile}}{{^isResponseFile}}{{returnType}}{{^returnType}}Void{{/returnType}}{{/isResponseFile}}>{{/doNotUseRx}} {{#isDeprecated}} * @deprecated {{/isDeprecated}} @@ -74,7 +74,7 @@ public interface {{classname}} { {{/prioritizedContentTypes}} {{/formParams}} @{{httpMethod}}("{{{path}}}") - {{^doNotUseRx}}{{#useRxJava}}Observable<{{#isResponseFile}}ResponseBody{{/isResponseFile}}{{^isResponseFile}}{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}Void{{/returnType}}{{/isResponseFile}}>{{/useRxJava}}{{#useRxJava2}}{{#returnType}}Observable<{{#isResponseFile}}ResponseBody{{/isResponseFile}}{{^isResponseFile}}{{{returnType}}}{{/isResponseFile}}>{{/returnType}}{{^returnType}}Completable{{/returnType}}{{/useRxJava2}}{{#useRxJava3}}{{#returnType}}Observable<{{#isResponseFile}}ResponseBody{{/isResponseFile}}{{^isResponseFile}}{{{returnType}}}{{/isResponseFile}}>{{/returnType}}{{^returnType}}Completable{{/returnType}}{{/useRxJava3}}{{/doNotUseRx}}{{#doNotUseRx}}Call<{{#isResponseFile}}ResponseBody{{/isResponseFile}}{{^isResponseFile}}{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}Void{{/returnType}}{{/isResponseFile}}>{{/doNotUseRx}} {{operationId}}({{^allParams}});{{/allParams}} + {{^doNotUseRx}}{{#useRxJava}}Observable<{{#isResponseFile}}ResponseBody{{/isResponseFile}}{{^isResponseFile}}{{{returnType}}}{{^returnType}}Void{{/returnType}}{{/isResponseFile}}>{{/useRxJava}}{{#useRxJava2}}{{#returnType}}Observable<{{#isResponseFile}}ResponseBody{{/isResponseFile}}{{^isResponseFile}}{{{returnType}}}{{/isResponseFile}}>{{/returnType}}{{^returnType}}Completable{{/returnType}}{{/useRxJava2}}{{#useRxJava3}}{{#returnType}}Observable<{{#isResponseFile}}ResponseBody{{/isResponseFile}}{{^isResponseFile}}{{{returnType}}}{{/isResponseFile}}>{{/returnType}}{{^returnType}}Completable{{/returnType}}{{/useRxJava3}}{{/doNotUseRx}}{{#doNotUseRx}}Call<{{#isResponseFile}}ResponseBody{{/isResponseFile}}{{^isResponseFile}}{{{returnType}}}{{^returnType}}Void{{/returnType}}{{/isResponseFile}}>{{/doNotUseRx}} {{operationId}}({{^allParams}});{{/allParams}} {{#allParams}}{{>libraries/retrofit2/queryParams}}{{>libraries/retrofit2/pathParams}}{{>libraries/retrofit2/headerParams}}{{>libraries/retrofit2/bodyParams}}{{>libraries/retrofit2/formParams}}{{^-last}}, {{/-last}}{{#-last}} );{{/-last}}{{/allParams}} diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/api_test.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/api_test.mustache index d214d97724c..3f60dd13dfb 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/api_test.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/api_test.mustache @@ -37,7 +37,7 @@ public class {{classname}}Test { {{#allParams}} {{{dataType}}} {{paramName}} = null; {{/allParams}} - // {{#returnType}}{{{returnType}}} response = {{/returnType}}api.{{operationId}}({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}); + // {{#returnType}}{{{.}}} response = {{/returnType}}api.{{operationId}}({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}); // TODO: test validations } diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/auth/HttpBasicAuth.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/auth/HttpBasicAuth.mustache index d4588426662..9bd756eb856 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/auth/HttpBasicAuth.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/auth/HttpBasicAuth.mustache @@ -12,7 +12,7 @@ public class HttpBasicAuth implements Interceptor { private String username; private String password; - + public String getUsername() { return username; } diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/auth/OAuth.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/auth/OAuth.mustache index 80ec7b3946c..88e4e62bf85 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/auth/OAuth.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/auth/OAuth.mustache @@ -66,7 +66,7 @@ public class OAuth implements Interceptor { break; default: break; - } + } } @Override @@ -133,7 +133,7 @@ public class OAuth implements Interceptor { * Returns true if the access token has been updated */ public synchronized boolean updateAccessToken(String requestAccessToken) throws IOException { - if (getAccessToken() == null || getAccessToken().equals(requestAccessToken)) { + if (getAccessToken() == null || getAccessToken().equals(requestAccessToken)) { try { OAuthJSONAccessTokenResponse accessTokenResponse = oauthClient.accessToken(this.tokenRequestBuilder.buildBodyMessage()); if (accessTokenResponse != null && accessTokenResponse.getAccessToken() != null) { diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/auth/OAuthOkHttpClient.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/auth/OAuthOkHttpClient.mustache index 423fa1ba0e5..a499c7b8ba0 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/auth/OAuthOkHttpClient.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/auth/OAuthOkHttpClient.mustache @@ -56,7 +56,7 @@ public class OAuthOkHttpClient implements HttpClient { try { Response response = client.newCall(requestBuilder.build()).execute(); return OAuthClientResponseFactory.createCustomResponse( - response.body().string(), + response.body().string(), response.body().contentType().toString(), response.code(), responseClass); diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/play24/Play24CallAdapterFactory.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/play24/Play24CallAdapterFactory.mustache index be7cac4a0d5..d9ed3330fbd 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/play24/Play24CallAdapterFactory.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/play24/Play24CallAdapterFactory.mustache @@ -48,7 +48,7 @@ public class Play24CallAdapterFactory extends CallAdapter.Factory { return new ValueAdapter(resultType, includeResponse); } - + /** * Adapter that coverts values returned by API interface into CompletionStage */ diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/play24/api.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/play24/api.mustache index 088f2494650..2b7512d192d 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/play24/api.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/play24/api.mustache @@ -33,7 +33,7 @@ public interface {{classname}} { {{#allParams}} * @param {{paramName}} {{description}}{{#required}} (required){{/required}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}} {{/allParams}} - * @return Call<{{#returnType}}{{returnType}}{{/returnType}}{{^returnType}}Void{{/returnType}}> + * @return Call<{{returnType}}{{^returnType}}Void{{/returnType}}> {{#isDeprecated}} * @deprecated {{/isDeprecated}} @@ -56,7 +56,7 @@ public interface {{classname}} { {{/prioritizedContentTypes}} {{/formParams}} @{{httpMethod}}("{{{path}}}") - F.Promise> {{operationId}}({{^allParams}});{{/allParams}} + F.Promise> {{operationId}}({{^allParams}});{{/allParams}} {{#allParams}}{{>libraries/retrofit2/queryParams}}{{>libraries/retrofit2/pathParams}}{{>libraries/retrofit2/headerParams}}{{>libraries/retrofit2/bodyParams}}{{>libraries/retrofit2/formParams}}{{^-last}}, {{/-last}}{{#-last}} );{{/-last}}{{/allParams}} diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/play25/Play25CallAdapterFactory.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/play25/Play25CallAdapterFactory.mustache index 088c10b160a..62360bf984c 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/play25/Play25CallAdapterFactory.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/play25/Play25CallAdapterFactory.mustache @@ -114,4 +114,3 @@ public class Play25CallAdapterFactory extends CallAdapter.Factory { } } } - diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/play25/api.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/play25/api.mustache index dd59ee37ea2..d4e97cc347b 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/play25/api.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/play25/api.mustache @@ -33,7 +33,7 @@ public interface {{classname}} { {{#allParams}} * @param {{paramName}} {{description}}{{#required}} (required){{/required}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}} {{/allParams}} - * @return Call<{{#returnType}}{{returnType}}{{/returnType}}{{^returnType}}Void{{/returnType}}> + * @return Call<{{returnType}}{{^returnType}}Void{{/returnType}}> {{#isDeprecated}} * @deprecated {{/isDeprecated}} @@ -56,7 +56,7 @@ public interface {{classname}} { {{/prioritizedContentTypes}} {{/formParams}} @{{httpMethod}}("{{{path}}}") - CompletionStage> {{operationId}}({{^allParams}});{{/allParams}} + CompletionStage> {{operationId}}({{^allParams}});{{/allParams}} {{#allParams}}{{>libraries/retrofit2/queryParams}}{{>libraries/retrofit2/pathParams}}{{>libraries/retrofit2/headerParams}}{{>libraries/retrofit2/bodyParams}}{{>libraries/retrofit2/formParams}}{{^-last}}, {{/-last}}{{#-last}} );{{/-last}}{{/allParams}} diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/play26/api.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/play26/api.mustache index dd59ee37ea2..d4e97cc347b 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/play26/api.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/play26/api.mustache @@ -33,7 +33,7 @@ public interface {{classname}} { {{#allParams}} * @param {{paramName}} {{description}}{{#required}} (required){{/required}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}} {{/allParams}} - * @return Call<{{#returnType}}{{returnType}}{{/returnType}}{{^returnType}}Void{{/returnType}}> + * @return Call<{{returnType}}{{^returnType}}Void{{/returnType}}> {{#isDeprecated}} * @deprecated {{/isDeprecated}} @@ -56,7 +56,7 @@ public interface {{classname}} { {{/prioritizedContentTypes}} {{/formParams}} @{{httpMethod}}("{{{path}}}") - CompletionStage> {{operationId}}({{^allParams}});{{/allParams}} + CompletionStage> {{operationId}}({{^allParams}});{{/allParams}} {{#allParams}}{{>libraries/retrofit2/queryParams}}{{>libraries/retrofit2/pathParams}}{{>libraries/retrofit2/headerParams}}{{>libraries/retrofit2/bodyParams}}{{>libraries/retrofit2/formParams}}{{^-last}}, {{/-last}}{{#-last}} );{{/-last}}{{/allParams}} diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/vertx/ApiClient.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/vertx/ApiClient.mustache index 95951e3c06a..b3668e995ad 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/vertx/ApiClient.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/vertx/ApiClient.mustache @@ -656,7 +656,7 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { protected WebClient buildWebClient(Vertx vertx, JsonObject config) { if (!config.containsKey("userAgent")) { - config.put("userAgent", "{{#httpUserAgent}}{{{.}}}{{/httpUserAgent}}{{^httpUserAgent}}OpenAPI-Generator/{{{artifactVersion}}}/java{{/httpUserAgent}}"); + config.put("userAgent", "{{{httpUserAgent}}}{{^httpUserAgent}}OpenAPI-Generator/{{{artifactVersion}}}/java{{/httpUserAgent}}"); } return WebClient.create(vertx, new WebClientOptions(config)); diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/vertx/api.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/vertx/api.mustache index 1f20fa386d3..b81c0610065 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/vertx/api.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/vertx/api.mustache @@ -16,12 +16,12 @@ public interface {{classname}} { {{#isDeprecated}} @Deprecated {{/isDeprecated}} - void {{operationId}}({{#allParams}}{{{dataType}}} {{paramName}}, {{/allParams}}Handler> handler); + void {{operationId}}({{#allParams}}{{{dataType}}} {{paramName}}, {{/allParams}}Handler> handler); {{#isDeprecated}} @Deprecated {{/isDeprecated}} - void {{operationId}}({{#allParams}}{{{dataType}}} {{paramName}}, {{/allParams}}ApiClient.AuthInfo authInfo, Handler> handler); + void {{operationId}}({{#allParams}}{{{dataType}}} {{paramName}}, {{/allParams}}ApiClient.AuthInfo authInfo, Handler> handler); {{/operation}} {{/operations}} diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/vertx/apiImpl.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/vertx/apiImpl.mustache index e9e9a2fe7de..35daaade98f 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/vertx/apiImpl.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/vertx/apiImpl.mustache @@ -51,7 +51,7 @@ public class {{classname}}Impl implements {{classname}} { {{/allParams}} * @param resultHandler Asynchronous result handler */ - public void {{operationId}}({{#allParams}}{{{dataType}}} {{paramName}}, {{/allParams}}Handler> resultHandler) { + public void {{operationId}}({{#allParams}}{{{dataType}}} {{paramName}}, {{/allParams}}Handler> resultHandler) { {{operationId}}({{#allParams}}{{paramName}}, {{/allParams}}null, resultHandler); } @@ -64,7 +64,7 @@ public class {{classname}}Impl implements {{classname}} { * @param authInfo per call authentication override. * @param resultHandler Asynchronous result handler */ - public void {{operationId}}({{#allParams}}{{{dataType}}} {{paramName}}, {{/allParams}}ApiClient.AuthInfo authInfo, Handler> resultHandler) { + public void {{operationId}}({{#allParams}}{{{dataType}}} {{paramName}}, {{/allParams}}ApiClient.AuthInfo authInfo, Handler> resultHandler) { Object localVarBody = {{#bodyParam}}{{paramName}}{{/bodyParam}}{{^bodyParam}}null{{/bodyParam}}; {{#allParams}}{{#required}} // verify the required parameter '{{paramName}}' is set @@ -79,7 +79,7 @@ public class {{classname}}Impl implements {{classname}} { // query params List localVarQueryParams = new ArrayList<>(); {{#queryParams}} - localVarQueryParams.addAll(apiClient.parameterToPairs("{{#collectionFormat}}{{{collectionFormat}}}{{/collectionFormat}}", "{{baseName}}", {{paramName}})); + localVarQueryParams.addAll(apiClient.parameterToPairs("{{{collectionFormat}}}", "{{baseName}}", {{paramName}})); {{/queryParams}} // header params diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/vertx/pom.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/vertx/pom.mustache index 40968fa3cc1..5432485d9df 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/vertx/pom.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/vertx/pom.mustache @@ -223,7 +223,7 @@ jsr305 3.0.2 - + io.vertx diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/vertx/rxApiImpl.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/vertx/rxApiImpl.mustache index f1f5d0323f5..f0103042028 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/vertx/rxApiImpl.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/vertx/rxApiImpl.mustache @@ -33,7 +33,7 @@ public class {{classname}} { {{/allParams}} * @param resultHandler Asynchronous result handler */ - public void {{operationId}}({{#allParams}}{{{dataType}}} {{paramName}}, {{/allParams}}Handler> resultHandler) { + public void {{operationId}}({{#allParams}}{{{dataType}}} {{paramName}}, {{/allParams}}Handler> resultHandler) { delegate.{{operationId}}({{#allParams}}{{paramName}}, {{/allParams}}resultHandler); } @@ -46,7 +46,7 @@ public class {{classname}} { * @param authInfo call specific auth overrides * @param resultHandler Asynchronous result handler */ - public void {{operationId}}({{#allParams}}{{{dataType}}} {{paramName}}, {{/allParams}}ApiClient.AuthInfo authInfo, Handler> resultHandler) { + public void {{operationId}}({{#allParams}}{{{dataType}}} {{paramName}}, {{/allParams}}ApiClient.AuthInfo authInfo, Handler> resultHandler) { delegate.{{operationId}}({{#allParams}}{{paramName}}, {{/allParams}}authInfo, resultHandler); } @@ -58,7 +58,7 @@ public class {{classname}} { {{/allParams}} * @return Asynchronous result handler (RxJava Single) */ - public Single<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}Void{{/returnType}}> rx{{operationIdCamelCase}}({{#allParams}}{{{dataType}}} {{paramName}}{{^-last}}, {{/-last}}{{/allParams}}) { + public Single<{{{returnType}}}{{^returnType}}Void{{/returnType}}> rx{{operationIdCamelCase}}({{#allParams}}{{{dataType}}} {{paramName}}{{^-last}}, {{/-last}}{{/allParams}}) { return Single.create(new io.vertx.rx.java.SingleOnSubscribeAdapter<>(fut -> delegate.{{operationId}}({{#allParams}}{{paramName}}, {{/allParams}}fut) )); @@ -73,7 +73,7 @@ public class {{classname}} { * @param authInfo call specific auth overrides * @return Asynchronous result handler (RxJava Single) */ - public Single<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}Void{{/returnType}}> rx{{operationIdCamelCase}}({{#allParams}}{{{dataType}}} {{paramName}}, {{/allParams}}ApiClient.AuthInfo authInfo) { + public Single<{{{returnType}}}{{^returnType}}Void{{/returnType}}> rx{{operationIdCamelCase}}({{#allParams}}{{{dataType}}} {{paramName}}, {{/allParams}}ApiClient.AuthInfo authInfo) { return Single.create(new io.vertx.rx.java.SingleOnSubscribeAdapter<>(fut -> delegate.{{operationId}}({{#allParams}}{{paramName}}, {{/allParams}}authInfo, fut) )); diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/webclient/api.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/webclient/api.mustache index 2f79b929315..166a4fbcd29 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/webclient/api.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/webclient/api.mustache @@ -54,9 +54,9 @@ public class {{classname}} { /** * {{summary}} * {{notes}} -{{#responses}} *

{{code}}{{#message}} - {{message}}{{/message}} +{{#responses}} *

{{code}}{{#message}} - {{.}}{{/message}} {{/responses}}{{#allParams}} * @param {{paramName}} {{description}}{{^description}}The {{paramName}} parameter{{/description}} -{{/allParams}}{{#returnType}} * @return {{returnType}} +{{/allParams}}{{#returnType}} * @return {{.}} {{/returnType}} * @throws WebClientResponseException if an error occurs while attempting to invoke the API {{#externalDocs}} * {{description}} @@ -95,7 +95,7 @@ public class {{classname}} { {{#hasQueryParams}} {{#queryParams}} - queryParams.putAll(apiClient.parameterToMultiValueMap({{#collectionFormat}}ApiClient.CollectionFormat.valueOf("{{{collectionFormat}}}".toUpperCase(Locale.ROOT)){{/collectionFormat}}{{^collectionFormat}}null{{/collectionFormat}}, "{{baseName}}", {{paramName}})); + queryParams.putAll(apiClient.parameterToMultiValueMap({{#collectionFormat}}ApiClient.CollectionFormat.valueOf("{{{.}}}".toUpperCase(Locale.ROOT)){{/collectionFormat}}{{^collectionFormat}}null{{/collectionFormat}}, "{{baseName}}", {{paramName}})); {{/queryParams}} {{/hasQueryParams}} {{#hasHeaderParams}} @@ -109,7 +109,7 @@ public class {{classname}} { {{#hasCookieParams}} {{#cookieParams}} - cookieParams.putAll(apiClient.parameterToMultiValueMap({{#collectionFormat}}ApiClient.CollectionFormat.valueOf("{{{collectionFormat}}}".toUpperCase(Locale.ROOT)){{/collectionFormat}}{{^collectionFormat}}null{{/collectionFormat}}, "{{baseName}}", {{paramName}})); + cookieParams.putAll(apiClient.parameterToMultiValueMap({{#collectionFormat}}ApiClient.CollectionFormat.valueOf("{{{.}}}".toUpperCase(Locale.ROOT)){{/collectionFormat}}{{^collectionFormat}}null{{/collectionFormat}}, "{{baseName}}", {{paramName}})); {{/cookieParams}} {{/hasCookieParams}} {{#hasFormParams}} @@ -138,9 +138,9 @@ public class {{classname}} { /** * {{summary}} * {{notes}} -{{#responses}} *

{{code}}{{#message}} - {{message}}{{/message}} +{{#responses}} *

{{code}}{{#message}} - {{.}}{{/message}} {{/responses}}{{#allParams}} * @param {{paramName}} {{description}}{{^description}}The {{paramName}} parameter{{/description}} -{{/allParams}}{{#returnType}} * @return {{returnType}} +{{/allParams}}{{#returnType}} * @return {{.}} {{/returnType}} * @throws WebClientResponseException if an error occurs while attempting to invoke the API {{#externalDocs}} * {{description}} diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/webclient/api_test.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/webclient/api_test.mustache index a4757694c5b..b9aea5320fa 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/webclient/api_test.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/webclient/api_test.mustache @@ -34,7 +34,7 @@ public class {{classname}}Test { {{#allParams}} {{#isFile}}{{#useAbstractionForFiles}}{{#collectionFormat}}java.util.Collection{{/collectionFormat}}{{^collectionFormat}}org.springframework.core.io.AbstractResource{{/collectionFormat}}{{/useAbstractionForFiles}}{{^useAbstractionForFiles}}{{{dataType}}}{{/useAbstractionForFiles}}{{/isFile}}{{^isFile}}{{{dataType}}}{{/isFile}} {{paramName}} = null; {{/allParams}} - {{#returnType}}{{{returnType}}} response = {{/returnType}}api.{{operationId}}({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}){{#isArray}}{{#uniqueItems}}.collect(Collectors.toSet()){{/uniqueItems}}{{^uniqueItems}}.collectList(){{/uniqueItems}}.block(){{/isArray}}{{^isArray}}.block(){{/isArray}}; + {{#returnType}}{{{.}}} response = {{/returnType}}api.{{operationId}}({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}){{#isArray}}{{#uniqueItems}}.collect(Collectors.toSet()){{/uniqueItems}}{{^uniqueItems}}.collectList(){{/uniqueItems}}.block(){{/isArray}}{{^isArray}}.block(){{/isArray}}; // TODO: test validations } diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/webclient/build.gradle.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/webclient/build.gradle.mustache index c335e7ad441..9d352d127f9 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/webclient/build.gradle.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/webclient/build.gradle.mustache @@ -105,7 +105,7 @@ if(hasProperty('target') && target == 'android') { main = System.getProperty('mainClass') classpath = sourceSets.main.runtimeClasspath } - + task sourcesJar(type: Jar, dependsOn: classes) { classifier = 'sources' from sourceSets.main.allSource @@ -162,4 +162,3 @@ dependencies { implementation "javax.annotation:javax.annotation-api:$javax_annotation_version" testImplementation "junit:junit:$junit_version" } - diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/webclient/pom.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/webclient/pom.mustache index 67a888863b4..0b24d140966 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/webclient/pom.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/webclient/pom.mustache @@ -71,7 +71,7 @@ swagger-annotations ${swagger-annotations-version} - + com.google.code.findbugs diff --git a/modules/openapi-generator/src/main/resources/Java/licenseInfo.mustache b/modules/openapi-generator/src/main/resources/Java/licenseInfo.mustache index abc2f4578eb..c66209f2794 100644 --- a/modules/openapi-generator/src/main/resources/Java/licenseInfo.mustache +++ b/modules/openapi-generator/src/main/resources/Java/licenseInfo.mustache @@ -2,8 +2,8 @@ * {{{appName}}} * {{{appDescription}}} * - * {{#version}}The version of the OpenAPI document: {{{version}}}{{/version}} - * {{#infoEmail}}Contact: {{{infoEmail}}}{{/infoEmail}} + * {{#version}}The version of the OpenAPI document: {{{.}}}{{/version}} + * {{#infoEmail}}Contact: {{{.}}}{{/infoEmail}} * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech diff --git a/modules/openapi-generator/src/main/resources/Java/modelEnum.mustache b/modules/openapi-generator/src/main/resources/Java/modelEnum.mustache index 207a937ebde..f81c7c93ff1 100644 --- a/modules/openapi-generator/src/main/resources/Java/modelEnum.mustache +++ b/modules/openapi-generator/src/main/resources/Java/modelEnum.mustache @@ -11,20 +11,20 @@ import com.google.gson.stream.JsonWriter; {{/gson}} /** - * {{^description}}Gets or Sets {{{name}}}{{/description}}{{#description}}{{description}}{{/description}} + * {{description}}{{^description}}Gets or Sets {{{name}}}{{/description}} */ {{#gson}} -@JsonAdapter({{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}}.Adapter.class) +@JsonAdapter({{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}}.Adapter.class) {{/gson}} {{#jsonb}} @JsonbTypeSerializer({{datatypeWithEnum}}.Serializer.class) @JsonbTypeDeserializer({{datatypeWithEnum}}.Deserializer.class) {{/jsonb}} -{{>additionalEnumTypeAnnotations}}public enum {{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} { +{{>additionalEnumTypeAnnotations}}public enum {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} { {{#allowableValues}}{{#enumVars}} {{#enumDescription}} /** - * {{enumDescription}} + * {{.}} */ {{/enumDescription}} {{#withXml}} @@ -35,7 +35,7 @@ import com.google.gson.stream.JsonWriter; private {{{dataType}}} value; - {{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}}({{{dataType}}} value) { + {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}}({{{dataType}}} value) { this.value = value; } @@ -54,8 +54,8 @@ import com.google.gson.stream.JsonWriter; {{#jackson}} @JsonCreator {{/jackson}} - public static {{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} fromValue({{{dataType}}} value) { - for ({{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} b : {{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}}.values()) { + public static {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} fromValue({{{dataType}}} value) { + for ({{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} b : {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}}.values()) { if (b.value.equals(value)) { return b; } @@ -64,16 +64,16 @@ import com.google.gson.stream.JsonWriter; } {{#gson}} - public static class Adapter extends TypeAdapter<{{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}}> { + public static class Adapter extends TypeAdapter<{{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}}> { @Override - public void write(final JsonWriter jsonWriter, final {{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} enumeration) throws IOException { + public void write(final JsonWriter jsonWriter, final {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} enumeration) throws IOException { jsonWriter.value(enumeration.getValue()); } @Override - public {{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} read(final JsonReader jsonReader) throws IOException { + public {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} read(final JsonReader jsonReader) throws IOException { {{^isNumber}}{{{dataType}}}{{/isNumber}}{{#isNumber}}String{{/isNumber}} value = jsonReader.{{#isNumber}}nextString(){{/isNumber}}{{#isInteger}}nextInt(){{/isInteger}}{{^isNumber}}{{^isInteger}}next{{{dataType}}}(){{/isInteger}}{{/isNumber}}; - return {{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}}.fromValue({{#isNumber}}new BigDecimal({{/isNumber}}value{{#isNumber}}){{/isNumber}}); + return {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}}.fromValue({{#isNumber}}new BigDecimal({{/isNumber}}value{{#isNumber}}){{/isNumber}}); } } {{/gson}} @@ -81,7 +81,7 @@ import com.google.gson.stream.JsonWriter; public static final class Deserializer implements JsonbDeserializer<{{datatypeWithEnum}}> { @Override public {{datatypeWithEnum}} deserialize(JsonParser parser, DeserializationContext ctx, Type rtType) { - for ({{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} b : {{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}}.values()) { + for ({{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} b : {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}}.values()) { if (String.valueOf(b.value).equals(parser.getString())) { return b; } diff --git a/modules/openapi-generator/src/main/resources/Java/modelInnerEnum.mustache b/modules/openapi-generator/src/main/resources/Java/modelInnerEnum.mustache index e0a194d6ba6..a9c99783fd0 100644 --- a/modules/openapi-generator/src/main/resources/Java/modelInnerEnum.mustache +++ b/modules/openapi-generator/src/main/resources/Java/modelInnerEnum.mustache @@ -1,8 +1,8 @@ /** - * {{^description}}Gets or Sets {{{name}}}{{/description}}{{#description}}{{description}}{{/description}} + * {{description}}{{^description}}Gets or Sets {{{name}}}{{/description}} */ {{#gson}} - @JsonAdapter({{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}.Adapter.class) + @JsonAdapter({{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}.Adapter.class) {{/gson}} {{#jsonb}} @JsonbTypeSerializer({{datatypeWithEnum}}.Serializer.class) @@ -12,12 +12,12 @@ @XmlType(name="{{datatypeWithEnum}}") @XmlEnum({{dataType}}.class) {{/withXml}} - {{>additionalEnumTypeAnnotations}}public enum {{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}} { + {{>additionalEnumTypeAnnotations}}public enum {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}} { {{#allowableValues}} {{#enumVars}} {{#enumDescription}} /** - * {{enumDescription}} + * {{.}} */ {{/enumDescription}} {{#withXml}} @@ -30,7 +30,7 @@ private {{{dataType}}} value; - {{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}({{{dataType}}} value) { + {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}({{{dataType}}} value) { this.value = value; } @@ -49,8 +49,8 @@ {{#jackson}} @JsonCreator {{/jackson}} - public static {{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} fromValue({{{dataType}}} value) { - for ({{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} b : {{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}}.values()) { + public static {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} fromValue({{{dataType}}} value) { + for ({{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} b : {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}}.values()) { if (b.value.equals(value)) { return b; } @@ -59,16 +59,16 @@ } {{#gson}} - public static class Adapter extends TypeAdapter<{{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}> { + public static class Adapter extends TypeAdapter<{{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}> { @Override - public void write(final JsonWriter jsonWriter, final {{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}} enumeration) throws IOException { + public void write(final JsonWriter jsonWriter, final {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}} enumeration) throws IOException { jsonWriter.value(enumeration.getValue()); } @Override - public {{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}} read(final JsonReader jsonReader) throws IOException { + public {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}} read(final JsonReader jsonReader) throws IOException { {{^isNumber}}{{{dataType}}}{{/isNumber}}{{#isNumber}}String{{/isNumber}} value = {{#isFloat}}(float){{/isFloat}} jsonReader.{{#isNumber}}nextString(){{/isNumber}}{{#isInteger}}nextInt(){{/isInteger}}{{^isNumber}}{{^isInteger}}{{#isFloat}}nextDouble{{/isFloat}}{{^isFloat}}next{{{dataType}}}{{/isFloat}}(){{/isInteger}}{{/isNumber}}; - return {{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}.fromValue({{#isNumber}}new BigDecimal({{/isNumber}}value{{#isNumber}}){{/isNumber}}); + return {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}.fromValue({{#isNumber}}new BigDecimal({{/isNumber}}value{{#isNumber}}){{/isNumber}}); } } {{/gson}} @@ -76,7 +76,7 @@ public static final class Deserializer implements JsonbDeserializer<{{datatypeWithEnum}}> { @Override public {{datatypeWithEnum}} deserialize(JsonParser parser, DeserializationContext ctx, Type rtType) { - for ({{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} b : {{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}}.values()) { + for ({{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} b : {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}}.values()) { if (String.valueOf(b.value).equals(parser.getString())) { return b; } diff --git a/modules/openapi-generator/src/main/resources/Java/pojo.mustache b/modules/openapi-generator/src/main/resources/Java/pojo.mustache index 77d080ccba3..b9be16ad565 100644 --- a/modules/openapi-generator/src/main/resources/Java/pojo.mustache +++ b/modules/openapi-generator/src/main/resources/Java/pojo.mustache @@ -1,9 +1,9 @@ /** - * {{#description}}{{.}}{{/description}}{{^description}}{{classname}}{{/description}}{{#isDeprecated}} + * {{description}}{{^description}}{{classname}}{{/description}}{{#isDeprecated}} * @deprecated{{/isDeprecated}} */{{#isDeprecated}} @Deprecated{{/isDeprecated}}{{#description}} -@ApiModel(description = "{{{description}}}"){{/description}} +@ApiModel(description = "{{{.}}}"){{/description}} {{#jackson}} @JsonPropertyOrder({ {{#vars}} @@ -13,7 +13,7 @@ @JsonTypeName("{{name}}") {{/jackson}} {{>additionalModelTypeAnnotations}}{{>generatedAnnotation}}{{#discriminator}}{{>typeInfoAnnotation}}{{/discriminator}}{{>xmlAnnotation}} -public class {{classname}} {{#parent}}extends {{{parent}}} {{/parent}}{{#vendorExtensions.x-implements}}{{#-first}}implements {{{.}}}{{/-first}}{{^-first}}, {{{.}}}{{/-first}}{{#-last}} {{/-last}}{{/vendorExtensions.x-implements}}{ +public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtensions.x-implements}}{{#-first}}implements {{{.}}}{{/-first}}{{^-first}}, {{{.}}}{{/-first}}{{#-last}} {{/-last}}{{/vendorExtensions.x-implements}}{ {{#serializableModel}} private static final long serialVersionUID = 1L; @@ -37,21 +37,21 @@ public class {{classname}} {{#parent}}extends {{{parent}}} {{/parent}}{{#vendorE {{/jackson}} {{#withXml}} {{#isXmlAttribute}} - @XmlAttribute(name = "{{#xmlName}}{{xmlName}}{{/xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}") + @XmlAttribute(name = "{{xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}") {{/isXmlAttribute}} {{^isXmlAttribute}} {{^isContainer}} - @XmlElement({{#xmlNamespace}}namespace="{{xmlNamespace}}", {{/xmlNamespace}}name = "{{#xmlName}}{{xmlName}}{{/xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}") + @XmlElement({{#xmlNamespace}}namespace="{{.}}", {{/xmlNamespace}}name = "{{xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}") {{/isContainer}} {{#isContainer}} // Is a container wrapped={{isXmlWrapped}} {{#items}} // items.name={{name}} items.baseName={{baseName}} items.xmlName={{xmlName}} items.xmlNamespace={{xmlNamespace}} // items.example={{example}} items.type={{dataType}} - @XmlElement({{#xmlNamespace}}namespace="{{xmlNamespace}}", {{/xmlNamespace}}name = "{{#xmlName}}{{xmlName}}{{/xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}") + @XmlElement({{#xmlNamespace}}namespace="{{.}}", {{/xmlNamespace}}name = "{{xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}") {{/items}} {{#isXmlWrapped}} - @XmlElementWrapper({{#xmlNamespace}}namespace="{{xmlNamespace}}", {{/xmlNamespace}}name = "{{#xmlName}}{{xmlName}}{{/xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}") + @XmlElementWrapper({{#xmlNamespace}}namespace="{{.}}", {{/xmlNamespace}}name = "{{xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}") {{/isXmlWrapped}} {{/isContainer}} {{/isXmlAttribute}} @@ -160,16 +160,16 @@ public class {{classname}} {{#parent}}extends {{{parent}}} {{/parent}}{{#vendorE {{/isReadOnly}} /** {{#description}} - * {{description}} + * {{.}} {{/description}} {{^description}} * Get {{name}} {{/description}} {{#minimum}} - * minimum: {{minimum}} + * minimum: {{.}} {{/minimum}} {{#maximum}} - * maximum: {{maximum}} + * maximum: {{.}} {{/maximum}} * @return {{name}} {{#deprecated}} @@ -193,7 +193,7 @@ public class {{classname}} {{#parent}}extends {{{parent}}} {{/parent}}{{#vendorE {{#jsonb}} @JsonbProperty("{{baseName}}") {{/jsonb}} -{{#useBeanValidation}}{{>beanValidation}}{{/useBeanValidation}} @ApiModelProperty({{#example}}example = "{{{example}}}", {{/example}}{{#required}}required = {{required}}, {{/required}}value = "{{{description}}}") +{{#useBeanValidation}}{{>beanValidation}}{{/useBeanValidation}} @ApiModelProperty({{#example}}example = "{{{.}}}", {{/example}}{{#required}}required = {{required}}, {{/required}}value = "{{{description}}}") {{#vendorExtensions.x-extra-annotation}} {{{vendorExtensions.x-extra-annotation}}} {{/vendorExtensions.x-extra-annotation}} diff --git a/modules/openapi-generator/src/main/resources/Java/pojo_doc.mustache b/modules/openapi-generator/src/main/resources/Java/pojo_doc.mustache index f5643754465..247aaf68617 100644 --- a/modules/openapi-generator/src/main/resources/Java/pojo_doc.mustache +++ b/modules/openapi-generator/src/main/resources/Java/pojo_doc.mustache @@ -8,7 +8,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -{{#vars}}**{{name}}** | {{#isEnum}}[**{{datatypeWithEnum}}**](#{{datatypeWithEnum}}){{/isEnum}}{{^isEnum}}{{#isContainer}}{{#isArray}}{{#items}}{{#isModel}}[{{/isModel}}{{/items}}**{{baseType}}{{#items}}<{{dataType}}>**{{#isModel}}]({{^baseType}}{{dataType}}{{/baseType}}{{#baseType}}{{baseType}}{{/baseType}}.md){{/isModel}}{{/items}}{{/isArray}}{{#isMap}}{{#items}}{{#isModel}}[{{/isModel}}**Map<String, {{dataType}}>**{{#isModel}}]({{^baseType}}{{dataType}}{{/baseType}}{{#baseType}}{{baseType}}{{/baseType}}.md){{/isModel}}{{/items}}{{/isMap}}{{/isContainer}}{{^isContainer}}{{#isModel}}[{{/isModel}}**{{dataType}}**{{#isModel}}]({{^baseType}}{{dataType}}{{/baseType}}{{#baseType}}{{baseType}}{{/baseType}}.md){{/isModel}}{{/isContainer}}{{/isEnum}} | {{description}} | {{^required}} [optional]{{/required}}{{#isReadOnly}} [readonly]{{/isReadOnly}} +{{#vars}}**{{name}}** | {{#isEnum}}[**{{datatypeWithEnum}}**](#{{datatypeWithEnum}}){{/isEnum}}{{^isEnum}}{{#isContainer}}{{#isArray}}{{#items}}{{#isModel}}[{{/isModel}}{{/items}}**{{baseType}}{{#items}}<{{dataType}}>**{{#isModel}}]({{^baseType}}{{dataType}}{{/baseType}}{{baseType}}.md){{/isModel}}{{/items}}{{/isArray}}{{#isMap}}{{#items}}{{#isModel}}[{{/isModel}}**Map<String, {{dataType}}>**{{#isModel}}]({{^baseType}}{{dataType}}{{/baseType}}{{baseType}}.md){{/isModel}}{{/items}}{{/isMap}}{{/isContainer}}{{^isContainer}}{{#isModel}}[{{/isModel}}**{{dataType}}**{{#isModel}}]({{^baseType}}{{dataType}}{{/baseType}}{{baseType}}.md){{/isModel}}{{/isContainer}}{{/isEnum}} | {{description}} | {{^required}} [optional]{{/required}}{{#isReadOnly}} [readonly]{{/isReadOnly}} {{/vars}} {{#vars}}{{#isEnum}} diff --git a/modules/openapi-generator/src/main/resources/Java/xmlAnnotation.mustache b/modules/openapi-generator/src/main/resources/Java/xmlAnnotation.mustache index 04566fa1167..4f3b448c8d1 100644 --- a/modules/openapi-generator/src/main/resources/Java/xmlAnnotation.mustache +++ b/modules/openapi-generator/src/main/resources/Java/xmlAnnotation.mustache @@ -1,6 +1,6 @@ {{#withXml}} -@XmlRootElement({{#xmlNamespace}}namespace="{{xmlNamespace}}", {{/xmlNamespace}}name = "{{#xmlName}}{{xmlName}}{{/xmlName}}{{^xmlName}}{{classname}}{{/xmlName}}") +@XmlRootElement({{#xmlNamespace}}namespace="{{.}}", {{/xmlNamespace}}name = "{{xmlName}}{{^xmlName}}{{classname}}{{/xmlName}}") @XmlAccessorType(XmlAccessType.FIELD) {{#jackson}} -@JacksonXmlRootElement({{#xmlNamespace}}namespace="{{xmlNamespace}}", {{/xmlNamespace}}localName = "{{#xmlName}}{{xmlName}}{{/xmlName}}{{^xmlName}}{{classname}}{{/xmlName}}"){{/jackson}}{{/withXml}} \ No newline at end of file +@JacksonXmlRootElement({{#xmlNamespace}}namespace="{{.}}", {{/xmlNamespace}}localName = "{{xmlName}}{{^xmlName}}{{classname}}{{/xmlName}}"){{/jackson}}{{/withXml}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/JavaInflector/README.mustache b/modules/openapi-generator/src/main/resources/JavaInflector/README.mustache index c1309670c5a..924e49fe194 100644 --- a/modules/openapi-generator/src/main/resources/JavaInflector/README.mustache +++ b/modules/openapi-generator/src/main/resources/JavaInflector/README.mustache @@ -5,4 +5,3 @@ Run with ``` mvn package jetty:run `` - diff --git a/modules/openapi-generator/src/main/resources/JavaInflector/api.mustache b/modules/openapi-generator/src/main/resources/JavaInflector/api.mustache index 71056d37509..f980a89d754 100644 --- a/modules/openapi-generator/src/main/resources/JavaInflector/api.mustache +++ b/modules/openapi-generator/src/main/resources/JavaInflector/api.mustache @@ -16,7 +16,7 @@ import {{modelPackage}}.*; {{>generatedAnnotation}} {{#operations}} public class {{classname}} { - /** + /** * Uncomment and implement as you see fit. These operations will map * Directly to operation calls from the routing logic. Because the inflector * Code allows you to implement logic incrementally, they are disabled. @@ -32,4 +32,3 @@ public class {{classname}} { {{/operation}} } {{/operations}} - diff --git a/modules/openapi-generator/src/main/resources/JavaInflector/enumClass.mustache b/modules/openapi-generator/src/main/resources/JavaInflector/enumClass.mustache index 49f3cb7922b..27e8d1254fe 100644 --- a/modules/openapi-generator/src/main/resources/JavaInflector/enumClass.mustache +++ b/modules/openapi-generator/src/main/resources/JavaInflector/enumClass.mustache @@ -1,7 +1,7 @@ /** - * {{^description}}Gets or Sets {{{name}}}{{/description}}{{#description}}{{{description}}}{{/description}} + * {{^description}}Gets or Sets {{{name}}}{{/description}}{{{description}}} */ - {{>additionalEnumTypeAnnotations}}public enum {{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}} { + {{>additionalEnumTypeAnnotations}}public enum {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}} { {{#gson}} {{#allowableValues}} {{#enumVars}} @@ -22,7 +22,7 @@ private {{{dataType}}} value; - {{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}({{{dataType}}} value) { + {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}({{{dataType}}} value) { this.value = value; } @@ -33,8 +33,8 @@ } @JsonCreator - public static {{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} fromValue(String text) { - for ({{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} b : {{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}}.values()) { + public static {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} fromValue(String text) { + for ({{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} b : {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}}.values()) { if (String.valueOf(b.value).equals(text)) { return b; } diff --git a/modules/openapi-generator/src/main/resources/JavaInflector/enumOuterClass.mustache b/modules/openapi-generator/src/main/resources/JavaInflector/enumOuterClass.mustache index 123ccb2ca6a..2832cfa5393 100644 --- a/modules/openapi-generator/src/main/resources/JavaInflector/enumOuterClass.mustache +++ b/modules/openapi-generator/src/main/resources/JavaInflector/enumOuterClass.mustache @@ -3,9 +3,9 @@ import com.fasterxml.jackson.annotation.JsonCreator; {{/jackson}} /** - * {{^description}}Gets or Sets {{{name}}}{{/description}}{{#description}}{{{description}}}{{/description}} + * {{^description}}Gets or Sets {{{name}}}{{/description}}{{{description}}} */ -{{>additionalEnumTypeAnnotations}}public enum {{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} { +{{>additionalEnumTypeAnnotations}}public enum {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} { {{#gson}} {{#allowableValues}}{{#enumVars}} @SerializedName({{#isInteger}}"{{/isInteger}}{{#isDouble}}"{{/isDouble}}{{#isLong}}"{{/isLong}}{{#isFloat}}"{{/isFloat}}{{{value}}}{{#isInteger}}"{{/isInteger}}{{#isDouble}}"{{/isDouble}}{{#isLong}}"{{/isLong}}{{#isFloat}}"{{/isFloat}}) @@ -20,7 +20,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; private {{{dataType}}} value; - {{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}}({{{dataType}}} value) { + {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}}({{{dataType}}} value) { this.value = value; } @@ -31,8 +31,8 @@ import com.fasterxml.jackson.annotation.JsonCreator; } @JsonCreator - public static {{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} fromValue(String text) { - for ({{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} b : {{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}}.values()) { + public static {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} fromValue(String text) { + for ({{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} b : {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}}.values()) { if (String.valueOf(b.value).equals(text)) { return b; } diff --git a/modules/openapi-generator/src/main/resources/JavaInflector/model.mustache b/modules/openapi-generator/src/main/resources/JavaInflector/model.mustache index b9512d2b83c..d2edbebd5b4 100644 --- a/modules/openapi-generator/src/main/resources/JavaInflector/model.mustache +++ b/modules/openapi-generator/src/main/resources/JavaInflector/model.mustache @@ -8,7 +8,7 @@ import java.util.Objects; {{#models}} {{#model}}{{#description}} /** - * {{description}} + * {{.}} **/{{/description}} {{#isEnum}}{{>enumOuterClass}}{{/isEnum}} {{^isEnum}}{{>pojo}}{{/isEnum}} diff --git a/modules/openapi-generator/src/main/resources/JavaInflector/pojo.mustache b/modules/openapi-generator/src/main/resources/JavaInflector/pojo.mustache index 2a13cf41e79..3de4a0d8c31 100644 --- a/modules/openapi-generator/src/main/resources/JavaInflector/pojo.mustache +++ b/modules/openapi-generator/src/main/resources/JavaInflector/pojo.mustache @@ -1,6 +1,6 @@ -{{#description}}@ApiModel(description = "{{{description}}}"){{/description}} +{{#description}}@ApiModel(description = "{{{.}}}"){{/description}} {{>generatedAnnotation}}{{>additionalModelTypeAnnotations}} -public class {{classname}} {{#parent}}extends {{{parent}}}{{/parent}} {{#serializableModel}}implements Serializable{{/serializableModel}} { +public class {{classname}} {{#parent}}extends {{{.}}}{{/parent}} {{#serializableModel}}implements Serializable{{/serializableModel}} { {{#vars}} {{#isEnum}} {{^isContainer}} @@ -28,9 +28,9 @@ public class {{classname}} {{#parent}}extends {{{parent}}}{{/parent}} {{#seriali {{/vars}} {{#vars}} /**{{#description}} - * {{{description}}}{{/description}}{{#minimum}} - * minimum: {{minimum}}{{/minimum}}{{#maximum}} - * maximum: {{maximum}}{{/maximum}} + * {{{.}}}{{/description}}{{#minimum}} + * minimum: {{.}}{{/minimum}}{{#maximum}} + * maximum: {{.}}{{/maximum}} **/ public {{classname}} {{name}}({{{datatypeWithEnum}}} {{name}}) { this.{{name}} = {{name}}; @@ -38,7 +38,7 @@ public class {{classname}} {{#parent}}extends {{{parent}}}{{/parent}} {{#seriali } {{#vendorExtensions.x-extra-annotation}}{{{vendorExtensions.x-extra-annotation}}}{{/vendorExtensions.x-extra-annotation}} - @ApiModelProperty({{#example}}example = "{{{example}}}", {{/example}}{{#required}}required = {{required}}, {{/required}}value = "{{{description}}}") + @ApiModelProperty({{#example}}example = "{{{.}}}", {{/example}}{{#required}}required = {{required}}, {{/required}}value = "{{{description}}}") @JsonProperty("{{baseName}}") public {{{datatypeWithEnum}}} {{getter}}() { return {{name}}; diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/allowableValues.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/allowableValues.mustache index a48256d027a..75bce9385de 100644 --- a/modules/openapi-generator/src/main/resources/JavaJaxRS/allowableValues.mustache +++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/allowableValues.mustache @@ -1 +1 @@ -{{#allowableValues}}allowableValues="{{#values}}{{{.}}}{{^-last}}, {{/-last}}{{/values}}{{^values}}range=[{{#min}}{{.}}{{/min}}{{^min}}-infinity{{/min}}, {{#max}}{{.}}{{/max}}{{^max}}infinity{{/max}}]{{/values}}"{{/allowableValues}} \ No newline at end of file +{{#allowableValues}}allowableValues="{{#values}}{{{.}}}{{^-last}}, {{/-last}}{{/values}}{{^values}}range=[{{min}}{{^min}}-infinity{{/min}}, {{max}}{{^max}}infinity{{/max}}]{{/values}}"{{/allowableValues}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/api.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/api.mustache index 9eb362285cb..b61de13287b 100644 --- a/modules/openapi-generator/src/main/resources/JavaJaxRS/api.mustache +++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/api.mustache @@ -49,7 +49,7 @@ public class {{classname}} { } catch (Exception e) { throw new RuntimeException(e); } - } + } } if (delegate == null) { @@ -64,7 +64,7 @@ public class {{classname}} { {{#subresourceOperation}}@Path("{{{path}}}"){{/subresourceOperation}} {{#hasConsumes}}@Consumes({ {{#consumes}}"{{{mediaType}}}"{{^-last}}, {{/-last}}{{/consumes}} }){{/hasConsumes}} {{#hasProduces}}@Produces({ {{#produces}}"{{{mediaType}}}"{{^-last}}, {{/-last}}{{/produces}} }){{/hasProduces}} - @io.swagger.annotations.ApiOperation(value = "{{{summary}}}", notes = "{{{notes}}}", response = {{{returnBaseType}}}.class{{#returnContainer}}, responseContainer = "{{{returnContainer}}}"{{/returnContainer}}{{#hasAuthMethods}}, authorizations = { + @io.swagger.annotations.ApiOperation(value = "{{{summary}}}", notes = "{{{notes}}}", response = {{{returnBaseType}}}.class{{#returnContainer}}, responseContainer = "{{{.}}}"{{/returnContainer}}{{#hasAuthMethods}}, authorizations = { {{#authMethods}}@io.swagger.annotations.Authorization(value = "{{name}}"{{#isOAuth}}, scopes = { {{#scopes}}@io.swagger.annotations.AuthorizationScope(scope = "{{scope}}", description = "{{description}}"){{^-last}}, {{/-last}}{{/scopes}} @@ -73,7 +73,7 @@ public class {{classname}} { }{{/hasAuthMethods}}, tags={ {{#vendorExtensions.x-tags}}"{{tag}}",{{/vendorExtensions.x-tags}} }) @io.swagger.annotations.ApiResponses(value = { {{#responses}} - @io.swagger.annotations.ApiResponse(code = {{{code}}}, message = "{{{message}}}", response = {{{baseType}}}.class{{#containerType}}, responseContainer = "{{{containerType}}}"{{/containerType}}){{^-last}},{{/-last}} + @io.swagger.annotations.ApiResponse(code = {{{code}}}, message = "{{{message}}}", response = {{{baseType}}}.class{{#containerType}}, responseContainer = "{{{.}}}"{{/containerType}}){{^-last}},{{/-last}} {{/responses}} }) public Response {{nickname}}({{#allParams}}{{>queryParams}}{{>pathParams}}{{>headerParams}}{{>bodyParams}}{{>formParams}},{{/allParams}}@Context SecurityContext securityContext) diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/beanValidationCore.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/beanValidationCore.mustache index 1f9f43e7b86..ff4ffe26c49 100644 --- a/modules/openapi-generator/src/main/resources/JavaJaxRS/beanValidationCore.mustache +++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/beanValidationCore.mustache @@ -4,17 +4,17 @@ minLength && maxLength set minLength set, maxLength not }}{{#minLength}}{{^maxLength}} @Size(min={{minLength}}){{/maxLength}}{{/minLength}}{{! minLength not set, maxLength set -}}{{^minLength}}{{#maxLength}} @Size(max={{maxLength}}){{/maxLength}}{{/minLength}}{{! +}}{{^minLength}}{{#maxLength}} @Size(max={{.}}){{/maxLength}}{{/minLength}}{{! @Size: minItems && maxItems set }}{{#minItems}}{{#maxItems}} @Size(min={{minItems}},max={{maxItems}}){{/maxItems}}{{/minItems}}{{! @Size: minItems set, maxItems not }}{{#minItems}}{{^maxItems}} @Size(min={{minItems}}){{/maxItems}}{{/minItems}}{{! @Size: minItems not set && maxItems set -}}{{^minItems}}{{#maxItems}} @Size(max={{maxItems}}){{/maxItems}}{{/minItems}}{{! +}}{{^minItems}}{{#maxItems}} @Size(max={{.}}){{/maxItems}}{{/minItems}}{{! check for integer or long / all others=decimal type with @Decimal* isInteger set -}}{{#isInteger}}{{#minimum}} @Min({{minimum}}){{/minimum}}{{#maximum}} @Max({{maximum}}){{/maximum}}{{/isInteger}}{{! +}}{{#isInteger}}{{#minimum}} @Min({{.}}){{/minimum}}{{#maximum}} @Max({{.}}){{/maximum}}{{/isInteger}}{{! isLong set -}}{{#isLong}}{{#minimum}} @Min({{minimum}}L){{/minimum}}{{#maximum}} @Max({{maximum}}L){{/maximum}}{{/isLong}}{{! +}}{{#isLong}}{{#minimum}} @Min({{.}}L){{/minimum}}{{#maximum}} @Max({{.}}L){{/maximum}}{{/isLong}}{{! Not Integer, not Long => we have a decimal value! }}{{^isInteger}}{{^isLong}}{{#minimum}} @DecimalMin({{#exclusiveMinimum}}value={{/exclusiveMinimum}}"{{minimum}}"{{#exclusiveMinimum}},inclusive=false{{/exclusiveMinimum}}){{/minimum}}{{#maximum}} @DecimalMax({{#exclusiveMaximum}}value={{/exclusiveMaximum}}"{{maximum}}"{{#exclusiveMaximum}},inclusive=false{{/exclusiveMaximum}}){{/maximum}}{{/isLong}}{{/isInteger}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/bodyParams.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/bodyParams.mustache index a7351b38ac5..7e97a6a4259 100644 --- a/modules/openapi-generator/src/main/resources/JavaJaxRS/bodyParams.mustache +++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/bodyParams.mustache @@ -3,7 +3,7 @@ }}@ApiParam(value = "{{{description}}}"{{! }}{{#required}}, required = true{{/required}}{{! }}{{#allowableValues}}, {{> allowableValues}}{{/allowableValues}}{{! - }}{{#defaultValue}}, defaultValue = "{{{defaultValue}}}"{{/defaultValue}}{{! + }}{{#defaultValue}}, defaultValue = "{{{.}}}"{{/defaultValue}}{{! }}){{! }}{{#useBeanValidation}} {{>beanValidation}}{{/useBeanValidation}}{{! diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-cdi/allowableValues.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-cdi/allowableValues.mustache index a48256d027a..75bce9385de 100644 --- a/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-cdi/allowableValues.mustache +++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-cdi/allowableValues.mustache @@ -1 +1 @@ -{{#allowableValues}}allowableValues="{{#values}}{{{.}}}{{^-last}}, {{/-last}}{{/values}}{{^values}}range=[{{#min}}{{.}}{{/min}}{{^min}}-infinity{{/min}}, {{#max}}{{.}}{{/max}}{{^max}}infinity{{/max}}]{{/values}}"{{/allowableValues}} \ No newline at end of file +{{#allowableValues}}allowableValues="{{#values}}{{{.}}}{{^-last}}, {{/-last}}{{/values}}{{^values}}range=[{{min}}{{^min}}-infinity{{/min}}, {{max}}{{^max}}infinity{{/max}}]{{/values}}"{{/allowableValues}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-cdi/api.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-cdi/api.mustache index f48acfd1dcd..a3c9c9721ee 100644 --- a/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-cdi/api.mustache +++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-cdi/api.mustache @@ -44,14 +44,14 @@ public class {{classname}} { {{#subresourceOperation}}@Path("{{{path}}}"){{/subresourceOperation}} {{#hasConsumes}}@Consumes({ {{#consumes}}"{{{mediaType}}}"{{^-last}}, {{/-last}}{{/consumes}} }){{/hasConsumes}} {{#hasProduces}}@Produces({ {{#produces}}"{{{mediaType}}}"{{^-last}}, {{/-last}}{{/produces}} }){{/hasProduces}} - @ApiOperation(value = "{{{summary}}}", notes = "{{{notes}}}", response = {{{returnBaseType}}}.class{{#returnContainer}}, responseContainer = "{{{returnContainer}}}"{{/returnContainer}}{{#hasAuthMethods}}, authorizations = { + @ApiOperation(value = "{{{summary}}}", notes = "{{{notes}}}", response = {{{returnBaseType}}}.class{{#returnContainer}}, responseContainer = "{{{.}}}"{{/returnContainer}}{{#hasAuthMethods}}, authorizations = { {{#authMethods}}{{#isOAuth}}@Authorization(value = "{{name}}", scopes = { {{#scopes}}@AuthorizationScope(scope = "{{scope}}", description = "{{description}}"){{^-last}}, {{/-last}}{{/scopes}} }){{^-last}},{{/-last}}{{/isOAuth}} {{^isOAuth}}@Authorization(value = "{{name}}"){{^-last}},{{/-last}} {{/isOAuth}}{{/authMethods}} }{{/hasAuthMethods}}, tags={ {{#vendorExtensions.x-tags}}"{{tag}}"{{^-last}}, {{/-last}}{{/vendorExtensions.x-tags}} }) @ApiResponses(value = { {{#responses}} - @ApiResponse(code = {{{code}}}, message = "{{{message}}}", response = {{{baseType}}}.class{{#containerType}}, responseContainer = "{{{containerType}}}"{{/containerType}}){{^-last}},{{/-last}}{{/responses}} }) + @ApiResponse(code = {{{code}}}, message = "{{{message}}}", response = {{{baseType}}}.class{{#containerType}}, responseContainer = "{{{.}}}"{{/containerType}}){{^-last}},{{/-last}}{{/responses}} }) public Response {{nickname}}({{#allParams}}{{>queryParams}}{{>pathParams}}{{>headerParams}}{{>bodyParams}}{{>formParams}}{{^-last}}, {{/-last}}{{/allParams}}) { return delegate.{{nickname}}({{#allParams}}{{#isFile}}{{paramName}}InputStream, {{paramName}}Detail{{/isFile}}{{^isFile}}{{paramName}}{{/isFile}}, {{/allParams}}securityContext); } diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-cdi/beanValidationCore.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-cdi/beanValidationCore.mustache index 1f9f43e7b86..ff4ffe26c49 100644 --- a/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-cdi/beanValidationCore.mustache +++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-cdi/beanValidationCore.mustache @@ -4,17 +4,17 @@ minLength && maxLength set minLength set, maxLength not }}{{#minLength}}{{^maxLength}} @Size(min={{minLength}}){{/maxLength}}{{/minLength}}{{! minLength not set, maxLength set -}}{{^minLength}}{{#maxLength}} @Size(max={{maxLength}}){{/maxLength}}{{/minLength}}{{! +}}{{^minLength}}{{#maxLength}} @Size(max={{.}}){{/maxLength}}{{/minLength}}{{! @Size: minItems && maxItems set }}{{#minItems}}{{#maxItems}} @Size(min={{minItems}},max={{maxItems}}){{/maxItems}}{{/minItems}}{{! @Size: minItems set, maxItems not }}{{#minItems}}{{^maxItems}} @Size(min={{minItems}}){{/maxItems}}{{/minItems}}{{! @Size: minItems not set && maxItems set -}}{{^minItems}}{{#maxItems}} @Size(max={{maxItems}}){{/maxItems}}{{/minItems}}{{! +}}{{^minItems}}{{#maxItems}} @Size(max={{.}}){{/maxItems}}{{/minItems}}{{! check for integer or long / all others=decimal type with @Decimal* isInteger set -}}{{#isInteger}}{{#minimum}} @Min({{minimum}}){{/minimum}}{{#maximum}} @Max({{maximum}}){{/maximum}}{{/isInteger}}{{! +}}{{#isInteger}}{{#minimum}} @Min({{.}}){{/minimum}}{{#maximum}} @Max({{.}}){{/maximum}}{{/isInteger}}{{! isLong set -}}{{#isLong}}{{#minimum}} @Min({{minimum}}L){{/minimum}}{{#maximum}} @Max({{maximum}}L){{/maximum}}{{/isLong}}{{! +}}{{#isLong}}{{#minimum}} @Min({{.}}L){{/minimum}}{{#maximum}} @Max({{.}}L){{/maximum}}{{/isLong}}{{! Not Integer, not Long => we have a decimal value! }}{{^isInteger}}{{^isLong}}{{#minimum}} @DecimalMin({{#exclusiveMinimum}}value={{/exclusiveMinimum}}"{{minimum}}"{{#exclusiveMinimum}},inclusive=false{{/exclusiveMinimum}}){{/minimum}}{{#maximum}} @DecimalMax({{#exclusiveMaximum}}value={{/exclusiveMaximum}}"{{maximum}}"{{#exclusiveMaximum}},inclusive=false{{/exclusiveMaximum}}){{/maximum}}{{/isLong}}{{/isInteger}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-cdi/bodyParams.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-cdi/bodyParams.mustache index 2b28441d3d0..dd3506d206d 100644 --- a/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-cdi/bodyParams.mustache +++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-cdi/bodyParams.mustache @@ -1 +1 @@ -{{#isBodyParam}}@ApiParam(value = "{{{description}}}" {{#required}},required=true{{/required}}{{#allowableValues}}, {{> allowableValues }}{{/allowableValues}}{{#defaultValue}}, defaultValue="{{{defaultValue}}}"{{/defaultValue}}) {{{dataType}}} {{paramName}}{{/isBodyParam}} \ No newline at end of file +{{#isBodyParam}}@ApiParam(value = "{{{description}}}" {{#required}},required=true{{/required}}{{#allowableValues}}, {{> allowableValues }}{{/allowableValues}}{{#defaultValue}}, defaultValue="{{{.}}}"{{/defaultValue}}) {{{dataType}}} {{paramName}}{{/isBodyParam}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-cdi/enumClass.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-cdi/enumClass.mustache index 829a9f6e314..046f2785fd4 100644 --- a/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-cdi/enumClass.mustache +++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-cdi/enumClass.mustache @@ -1,6 +1,6 @@ @XmlType(name="{{datatypeWithEnum}}") @XmlEnum({{dataType}}.class) -{{>additionalEnumTypeAnnotations}}public enum {{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} { +{{>additionalEnumTypeAnnotations}}public enum {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} { {{#allowableValues}} {{#enumVars}}@XmlEnumValue({{^isString}}"{{/isString}}{{{value}}}{{^isString}}"{{/isString}}) {{name}}({{dataType}}.valueOf({{{value}}})){{^-last}}, {{/-last}}{{#-last}};{{/-last}}{{/enumVars}} @@ -9,7 +9,7 @@ private {{dataType}} value; - {{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}}({{dataType}} v) { + {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}}({{dataType}} v) { value = v; } @@ -22,8 +22,8 @@ return String.valueOf(value); } - public static {{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} fromValue({{dataType}} value) { - for ({{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} b : {{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}}.values()) { + public static {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} fromValue({{dataType}} value) { + for ({{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} b : {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}}.values()) { if (b.value.equals(value)) { return b; } diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-cdi/headerParams.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-cdi/headerParams.mustache index 200a109ca64..00cd70487be 100644 --- a/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-cdi/headerParams.mustache +++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-cdi/headerParams.mustache @@ -1 +1 @@ -{{#isHeaderParam}}{{#useBeanValidation}}{{>beanValidationHeaderParams}}{{/useBeanValidation}} @ApiParam(value = "{{{description}}}" {{#required}},required=true{{/required}}{{#allowableValues}}, {{> allowableValues }}{{/allowableValues}}{{#defaultValue}}, defaultValue="{{{defaultValue}}}"{{/defaultValue}})@HeaderParam("{{baseName}}") {{{dataType}}} {{paramName}}{{/isHeaderParam}} \ No newline at end of file +{{#isHeaderParam}}{{#useBeanValidation}}{{>beanValidationHeaderParams}}{{/useBeanValidation}} @ApiParam(value = "{{{description}}}" {{#required}},required=true{{/required}}{{#allowableValues}}, {{> allowableValues }}{{/allowableValues}}{{#defaultValue}}, defaultValue="{{{.}}}"{{/defaultValue}})@HeaderParam("{{baseName}}") {{{dataType}}} {{paramName}}{{/isHeaderParam}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-cdi/model.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-cdi/model.mustache index df7d1df8d21..96d4ac3277c 100644 --- a/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-cdi/model.mustache +++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-cdi/model.mustache @@ -11,7 +11,7 @@ import javax.validation.constraints.*; {{#models}} {{#model}}{{#description}} /** - * {{description}} + * {{.}} **/{{/description}} {{#isEnum}}{{>enumOuterClass}}{{/isEnum}} {{^isEnum}}{{>pojo}}{{/isEnum}} diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-cdi/pathParams.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-cdi/pathParams.mustache index 4e21dd6091e..d8ab20f4655 100644 --- a/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-cdi/pathParams.mustache +++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-cdi/pathParams.mustache @@ -1 +1 @@ -{{#isPathParam}}{{#useBeanValidation}}{{>beanValidationPathParams}}{{/useBeanValidation}}@ApiParam(value = "{{{description}}}"{{#required}},required=true{{/required}}{{#allowableValues}}, {{> allowableValues }}{{/allowableValues}}{{#defaultValue}}, defaultValue="{{{defaultValue}}}"{{/defaultValue}}) @PathParam("{{baseName}}") {{{dataType}}} {{paramName}}{{/isPathParam}} \ No newline at end of file +{{#isPathParam}}{{#useBeanValidation}}{{>beanValidationPathParams}}{{/useBeanValidation}}@ApiParam(value = "{{{description}}}"{{#required}},required=true{{/required}}{{#allowableValues}}, {{> allowableValues }}{{/allowableValues}}{{#defaultValue}}, defaultValue="{{{.}}}"{{/defaultValue}}) @PathParam("{{baseName}}") {{{dataType}}} {{paramName}}{{/isPathParam}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-cdi/pojo.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-cdi/pojo.mustache index 1f93ba848d3..5a9867bad2b 100644 --- a/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-cdi/pojo.mustache +++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-cdi/pojo.mustache @@ -3,8 +3,8 @@ import java.util.Objects; import javax.xml.bind.annotation.*; -{{#description}}@ApiModel(description = "{{{description}}}"){{/description}}{{>additionalModelTypeAnnotations}}{{#discriminator}}{{>typeInfoAnnotation}}{{/discriminator}} -public class {{classname}} {{#parent}}extends {{{parent}}}{{/parent}} {{#serializableModel}}implements Serializable{{/serializableModel}} { +{{#description}}@ApiModel(description = "{{{.}}}"){{/description}}{{>additionalModelTypeAnnotations}}{{#discriminator}}{{>typeInfoAnnotation}}{{/discriminator}} +public class {{classname}} {{#parent}}extends {{{.}}}{{/parent}} {{#serializableModel}}implements Serializable{{/serializableModel}} { {{#vars}}{{#isEnum}}{{^isContainer}} {{>enumClass}}{{/isContainer}}{{#isContainer}}{{#mostInnerItems}} @@ -20,13 +20,13 @@ public class {{classname}} {{#parent}}extends {{{parent}}}{{/parent}} {{#seriali {{#vars}} /** {{#description}} - * {{description}} + * {{.}} {{/description}} {{#minimum}} - * minimum: {{minimum}} + * minimum: {{.}} {{/minimum}} {{#maximum}} - * maximum: {{maximum}} + * maximum: {{.}} {{/maximum}} **/ public {{classname}} {{name}}({{{datatypeWithEnum}}} {{name}}) { @@ -35,7 +35,7 @@ public class {{classname}} {{#parent}}extends {{{parent}}}{{/parent}} {{#seriali } {{#vendorExtensions.x-extra-annotation}}{{{vendorExtensions.x-extra-annotation}}}{{/vendorExtensions.x-extra-annotation}} - @ApiModelProperty({{#example}}example = "{{{example}}}", {{/example}}{{#required}}required = {{required}}, {{/required}}value = "{{{description}}}") + @ApiModelProperty({{#example}}example = "{{{.}}}", {{/example}}{{#required}}required = {{required}}, {{/required}}value = "{{{description}}}") @JsonProperty("{{baseName}}") {{#useBeanValidation}}{{>beanValidation}}{{/useBeanValidation}} public {{{datatypeWithEnum}}} {{getter}}() { return {{name}}; diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-cdi/pom.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-cdi/pom.mustache index 1f2caa5a5f4..2066179d96e 100644 --- a/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-cdi/pom.mustache +++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-cdi/pom.mustache @@ -76,14 +76,14 @@ swagger-annotations [1.5.3,1.5.16] - + com.google.code.findbugs jsr305 3.0.2 - + {{#useBeanValidation}} diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-cdi/queryParams.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-cdi/queryParams.mustache index e132b51a756..b7addff1a93 100644 --- a/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-cdi/queryParams.mustache +++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-cdi/queryParams.mustache @@ -1 +1 @@ -{{#isQueryParam}}{{#useBeanValidation}}{{>beanValidationQueryParams}}{{/useBeanValidation}}@ApiParam(value = "{{{description}}}"{{#required}},required=true{{/required}}{{^isContainer}}{{#allowableValues}}, {{> allowableValues }}{{/allowableValues}}{{#defaultValue}}, defaultValue="{{{defaultValue}}}"{{/defaultValue}}{{/isContainer}}) {{^isContainer}}{{#defaultValue}}@DefaultValue("{{{defaultValue}}}") {{/defaultValue}}{{/isContainer}} @QueryParam("{{baseName}}") {{{dataType}}} {{paramName}}{{/isQueryParam}} \ No newline at end of file +{{#isQueryParam}}{{#useBeanValidation}}{{>beanValidationQueryParams}}{{/useBeanValidation}}@ApiParam(value = "{{{description}}}"{{#required}},required=true{{/required}}{{^isContainer}}{{#allowableValues}}, {{> allowableValues }}{{/allowableValues}}{{#defaultValue}}, defaultValue="{{{.}}}"{{/defaultValue}}{{/isContainer}}) {{^isContainer}}{{#defaultValue}}@DefaultValue("{{{.}}}") {{/defaultValue}}{{/isContainer}} @QueryParam("{{baseName}}") {{{dataType}}} {{paramName}}{{/isQueryParam}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-ext/allowableValues.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-ext/allowableValues.mustache index a48256d027a..75bce9385de 100644 --- a/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-ext/allowableValues.mustache +++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-ext/allowableValues.mustache @@ -1 +1 @@ -{{#allowableValues}}allowableValues="{{#values}}{{{.}}}{{^-last}}, {{/-last}}{{/values}}{{^values}}range=[{{#min}}{{.}}{{/min}}{{^min}}-infinity{{/min}}, {{#max}}{{.}}{{/max}}{{^max}}infinity{{/max}}]{{/values}}"{{/allowableValues}} \ No newline at end of file +{{#allowableValues}}allowableValues="{{#values}}{{{.}}}{{^-last}}, {{/-last}}{{/values}}{{^values}}range=[{{min}}{{^min}}-infinity{{/min}}, {{max}}{{^max}}infinity{{/max}}]{{/values}}"{{/allowableValues}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-ext/api.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-ext/api.mustache index a38ba492662..8c517fd6dd5 100644 --- a/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-ext/api.mustache +++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-ext/api.mustache @@ -27,7 +27,7 @@ import javax.validation.Valid; * {{{appName}}} * {{#appDescription}} - *

{{{appDescription}}} + *

{{{.}}} * {{/appDescription}} */ @@ -47,7 +47,7 @@ public interface {{classname}} { * {{summary}} * {{#notes}} - * {{notes}} + * {{.}} * {{/notes}} */ @@ -62,9 +62,8 @@ public interface {{classname}} { {{/hasProduces}} @ApiOperation(value = "{{{summary}}}", tags={ {{#vendorExtensions.x-tags}}"{{tag}}"{{^-last}}, {{/-last}}{{/vendorExtensions.x-tags}} }) @ApiResponses(value = { {{#responses}} - @ApiResponse(code = {{{code}}}, message = "{{{message}}}"{{^vendorExtensions.x-java-is-response-void}}, response = {{{baseType}}}.class{{#containerType}}, responseContainer = "{{{containerType}}}"{{/containerType}}{{/vendorExtensions.x-java-is-response-void}}){{^-last}},{{/-last}}{{/responses}} }) + @ApiResponse(code = {{{code}}}, message = "{{{message}}}"{{^vendorExtensions.x-java-is-response-void}}, response = {{{baseType}}}.class{{#containerType}}, responseContainer = "{{{.}}}"{{/containerType}}{{/vendorExtensions.x-java-is-response-void}}){{^-last}},{{/-last}}{{/responses}} }) public {{>returnTypes}} {{operationId}}({{#allParams}}{{>queryParams}}{{>pathParams}}{{>headerParams}}{{>bodyParams}}{{>formParams}}{{^-last}}, {{/-last}}{{/allParams}}); {{/operation}} } {{/operations}} - diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-ext/apiServiceImpl.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-ext/apiServiceImpl.mustache index 633f014cf44..d93ffe8166b 100644 --- a/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-ext/apiServiceImpl.mustache +++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-ext/apiServiceImpl.mustache @@ -39,7 +39,7 @@ import org.springframework.stereotype.Service; * {{{appName}}} * {{#appDescription}} - *

{{{appDescription}}} + *

{{{.}}} {{/appDescription}} * */ @@ -68,7 +68,7 @@ public class {{classname}}ServiceImpl implements {{classname}} { * {{summary}} * {{#notes}} - * {{notes}} + * {{.}} * {{/notes}} */ diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-ext/api_test.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-ext/api_test.mustache index 6b141183c24..7df1a6c2ee5 100644 --- a/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-ext/api_test.mustache +++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-ext/api_test.mustache @@ -61,11 +61,11 @@ import org.openapitools.codegen.utils.JsonCache; /** {{#appName}} - * {{{appName}}} + * {{{.}}} * {{/appName}} {{#appDescription}} - *

{{{appDescription}}} + *

{{{.}}} * {{/appDescription}} * API tests for {{classname}}. @@ -96,7 +96,7 @@ public class {{classname}}Test { {{#generateSpringBootApplication}} @LocalServerPort private int serverPort; -{{/generateSpringBootApplication}} +{{/generateSpringBootApplication}} private {{classname}} api; @@ -104,23 +104,23 @@ public class {{classname}}Test { public void setup() { List providers = Arrays.asList(new JacksonJsonProvider(), new JacksonXMLProvider(), new MultipartProvider()); -{{#generateSpringBootApplication}} +{{#generateSpringBootApplication}} api = JAXRSClientFactory.create("http://localhost:" + serverPort + "/services", {{classname}}.class, providers); -{{/generateSpringBootApplication}} +{{/generateSpringBootApplication}} {{^generateSpringBootApplication}} api = JAXRSClientFactory.create("{{{basePath}}}", {{classname}}.class, providers); {{/generateSpringBootApplication}} org.apache.cxf.jaxrs.client.Client client = WebClient.client(api); - ClientConfiguration config = WebClient.getConfig(client); -{{#useGzipFeatureForTests}} + ClientConfiguration config = WebClient.getConfig(client); +{{#useGzipFeatureForTests}} // Example for using Gzipping GZIPOutInterceptor gzipOutInterceptor = new GZIPOutInterceptor(); // use Gzipping for first request sent to server //gzipOutInterceptor.setForce(true); config.getOutInterceptors().add(gzipOutInterceptor); - config.getInInterceptors().add(new GZIPInInterceptor()); + config.getInInterceptors().add(new GZIPInInterceptor()); {{/useGzipFeatureForTests}} {{#useLoggingFeatureForTests}} LoggingOutInterceptor loggingOutInterceptor = new LoggingOutInterceptor(); @@ -147,7 +147,7 @@ public class {{classname}}Test { * {{summary}} * {{#notes}} - * {{notes}} + * {{.}} * {{/notes}} {{/summary}} diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-ext/beanValidationCore.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-ext/beanValidationCore.mustache index e1c2d841e0a..252828809b3 100644 --- a/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-ext/beanValidationCore.mustache +++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-ext/beanValidationCore.mustache @@ -4,17 +4,17 @@ minLength && maxLength set minLength set, maxLength not }}{{#minLength}}{{^maxLength}} @Size(min={{minLength}}){{/maxLength}}{{/minLength}}{{! minLength not set, maxLength set -}}{{^minLength}}{{#maxLength}} @Size(max={{maxLength}}){{/maxLength}}{{/minLength}}{{! +}}{{^minLength}}{{#maxLength}} @Size(max={{.}}){{/maxLength}}{{/minLength}}{{! @Size: minItems && maxItems set }}{{#minItems}}{{#maxItems}} @Size(min={{minItems}},max={{maxItems}}){{/maxItems}}{{/minItems}}{{! @Size: minItems set, maxItems not }}{{#minItems}}{{^maxItems}} @Size(min={{minItems}}){{/maxItems}}{{/minItems}}{{! @Size: minItems not set && maxItems set -}}{{^minItems}}{{#maxItems}} @Size(max={{maxItems}}){{/maxItems}}{{/minItems}}{{! +}}{{^minItems}}{{#maxItems}} @Size(max={{.}}){{/maxItems}}{{/minItems}}{{! check for integer or long / all others=decimal type with @Decimal* isInteger set -}}{{#isInteger}}{{#minimum}} @Min({{minimum}}){{/minimum}}{{#maximum}} @Max({{maximum}}){{/maximum}}{{/isInteger}}{{! +}}{{#isInteger}}{{#minimum}} @Min({{.}}){{/minimum}}{{#maximum}} @Max({{.}}){{/maximum}}{{/isInteger}}{{! isLong set -}}{{#isLong}}{{#minimum}} @Min({{minimum}}L){{/minimum}}{{#maximum}} @Max({{maximum}}L){{/maximum}}{{/isLong}}{{! +}}{{#isLong}}{{#minimum}} @Min({{.}}L){{/minimum}}{{#maximum}} @Max({{.}}L){{/maximum}}{{/isLong}}{{! Not Integer, not Long => we have a decimal value! -}}{{^isInteger}}{{^isLong}}{{#minimum}} @DecimalMin("{{minimum}}"){{/minimum}}{{#maximum}} @DecimalMax("{{maximum}}"){{/maximum}}{{/isLong}}{{/isInteger}} \ No newline at end of file +}}{{^isInteger}}{{^isLong}}{{#minimum}} @DecimalMin("{{.}}"){{/minimum}}{{#maximum}} @DecimalMax("{{.}}"){{/maximum}}{{/isLong}}{{/isInteger}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-ext/beanValidationHeaderParams.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-ext/beanValidationHeaderParams.mustache index f8eef8f94c7..c4ff01d7e55 100644 --- a/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-ext/beanValidationHeaderParams.mustache +++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-ext/beanValidationHeaderParams.mustache @@ -1 +1 @@ -{{#required}} @NotNull{{/required}}{{>beanValidationCore}} \ No newline at end of file +{{#required}} @NotNull{{/required}}{{>beanValidationCore}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-ext/beanValidationQueryParams.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-ext/beanValidationQueryParams.mustache index f8eef8f94c7..c4ff01d7e55 100644 --- a/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-ext/beanValidationQueryParams.mustache +++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-ext/beanValidationQueryParams.mustache @@ -1 +1 @@ -{{#required}} @NotNull{{/required}}{{>beanValidationCore}} \ No newline at end of file +{{#required}} @NotNull{{/required}}{{>beanValidationCore}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-ext/enumClass.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-ext/enumClass.mustache index ea397c86bbf..a27b23ef753 100644 --- a/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-ext/enumClass.mustache +++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-ext/enumClass.mustache @@ -3,7 +3,7 @@ {{>additionalEnumTypeAnnotations}}public enum {{datatypeWithEnum}} { {{#allowableValues}} - {{#enumVars}}@XmlEnumValue({{#isInteger}}"{{/isInteger}}{{#isDouble}}"{{/isDouble}}{{#isLong}}"{{/isLong}}{{#isFloat}}"{{/isFloat}}{{{value}}}{{#isInteger}}"{{/isInteger}}{{#isDouble}}"{{/isDouble}}{{#isLong}}"{{/isLong}}{{#isFloat}}"{{/isFloat}}) @JsonProperty({{#isInteger}}"{{/isInteger}}{{#isDouble}}"{{/isDouble}}{{#isLong}}"{{/isLong}}{{#isFloat}}"{{/isFloat}}{{{value}}}{{#isInteger}}"{{/isInteger}}{{#isDouble}}"{{/isDouble}}{{#isLong}}"{{/isLong}}{{#isFloat}}"{{/isFloat}}) {{name}}({{dataType}}.valueOf({{{value}}})){{^-last}}, + {{#enumVars}}@XmlEnumValue({{#isInteger}}"{{/isInteger}}{{#isDouble}}"{{/isDouble}}{{#isLong}}"{{/isLong}}{{#isFloat}}"{{/isFloat}}{{{value}}}{{#isInteger}}"{{/isInteger}}{{#isDouble}}"{{/isDouble}}{{#isLong}}"{{/isLong}}{{#isFloat}}"{{/isFloat}}) @JsonProperty({{#isInteger}}"{{/isInteger}}{{#isDouble}}"{{/isDouble}}{{#isLong}}"{{/isLong}}{{#isFloat}}"{{/isFloat}}{{{value}}}{{#isInteger}}"{{/isInteger}}{{#isDouble}}"{{/isDouble}}{{#isLong}}"{{/isLong}}{{#isFloat}}"{{/isFloat}}) {{name}}({{dataType}}.valueOf({{{value}}})){{^-last}}, {{/-last}}{{#-last}};{{/-last}}{{/enumVars}} {{/allowableValues}} @@ -23,7 +23,7 @@ } public static {{datatypeWithEnum}} fromValue({{dataType}} value) { - for ({{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} b : {{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}}.values()) { + for ({{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} b : {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}}.values()) { if (b.value.equals(value)) { return b; } diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-ext/enumOuterClass.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-ext/enumOuterClass.mustache index 8d5639a8dec..149cb8a9953 100644 --- a/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-ext/enumOuterClass.mustache +++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-ext/enumOuterClass.mustache @@ -4,9 +4,9 @@ import com.fasterxml.jackson.annotation.JsonValue; {{/jackson}} /** - * {{^description}}Gets or Sets {{{name}}}{{/description}}{{#description}}{{description}}{{/description}} + * {{description}}{{^description}}Gets or Sets {{{name}}}{{/description}} */ -{{>additionalEnumTypeAnnotations}}public enum {{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} { +{{>additionalEnumTypeAnnotations}}public enum {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} { {{#gson}} {{#allowableValues}}{{#enumVars}} @SerializedName({{#isInteger}}"{{/isInteger}}{{#isDouble}}"{{/isDouble}}{{#isLong}}"{{/isLong}}{{#isFloat}}"{{/isFloat}}{{{value}}}{{#isInteger}}"{{/isInteger}}{{#isDouble}}"{{/isDouble}}{{#isLong}}"{{/isLong}}{{#isFloat}}"{{/isFloat}}) @@ -21,14 +21,14 @@ import com.fasterxml.jackson.annotation.JsonValue; private {{{dataType}}} value; - {{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}}({{{dataType}}} value) { + {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}}({{{dataType}}} value) { this.value = value; } @Override {{#jackson}} @JsonValue -{{/jackson}} +{{/jackson}} public String toString() { return String.valueOf(value); } @@ -36,13 +36,13 @@ import com.fasterxml.jackson.annotation.JsonValue; {{#jackson}} @JsonCreator {{/jackson}} - public static {{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} fromValue({{{dataType}}} value) { - for ({{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} b : {{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}}.values()) { + public static {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} fromValue({{{dataType}}} value) { + for ({{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} b : {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}}.values()) { if (b.value.equals(value)) { return b; } } {{#isNullable}}return null;{{/isNullable}}{{^isNullable}}throw new IllegalArgumentException("Unexpected value '" + value + "'");{{/isNullable}} } - + } diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-ext/licenseInfo.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-ext/licenseInfo.mustache index 9866f297a4d..be193d0c4fe 100644 --- a/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-ext/licenseInfo.mustache +++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-ext/licenseInfo.mustache @@ -2,8 +2,8 @@ * {{{appName}}} * {{{appDescription}}} * - * {{#version}}The version of the OpenAPI document: {{{version}}}{{/version}} - * {{#infoEmail}}Contact: {{{infoEmail}}}{{/infoEmail}} + * {{#version}}The version of the OpenAPI document: {{{.}}}{{/version}} + * {{#infoEmail}}Contact: {{{.}}}{{/infoEmail}} * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-ext/pojo.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-ext/pojo.mustache index b5546d95a40..c8fb8fb44d2 100644 --- a/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-ext/pojo.mustache +++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-ext/pojo.mustache @@ -23,19 +23,19 @@ import com.fasterxml.jackson.annotation.JsonProperty; */ @ApiModel(description="{{{description}}}") {{/description}}{{>additionalModelTypeAnnotations}} -public class {{classname}} {{#parent}}extends {{{parent}}}{{/parent}}{{#serializableModel}} implements Serializable{{/serializableModel}} { +public class {{classname}} {{#parent}}extends {{{.}}}{{/parent}}{{#serializableModel}} implements Serializable{{/serializableModel}} { {{#vars}}{{#isEnum}}{{^isContainer}} {{>enumClass}}{{/isContainer}}{{#isContainer}}{{#mostInnerItems}} {{>enumClass}}{{/mostInnerItems}}{{/isContainer}}{{/isEnum}} {{#description}} /** - * {{{description}}} + * {{{.}}} */ {{/description}} {{#withXml}} @XmlElement(name="{{baseName}}"{{#required}}, required = {{required}}{{/required}}) {{/withXml}} - @ApiModelProperty({{#example}}example = "{{{example}}}", {{/example}}{{#required}}required = {{required}}, {{/required}}value = "{{{description}}}"){{^isPrimitiveType}}{{^isDate}}{{^isDateTime}}{{^isString}}{{^isFile}}{{#useBeanValidation}} + @ApiModelProperty({{#example}}example = "{{{.}}}", {{/example}}{{#required}}required = {{required}}, {{/required}}value = "{{{description}}}"){{^isPrimitiveType}}{{^isDate}}{{^isDateTime}}{{^isString}}{{^isFile}}{{#useBeanValidation}} @Valid{{/useBeanValidation}}{{/isFile}}{{/isString}}{{/isDateTime}}{{/isDate}}{{/isPrimitiveType}} {{#isDate}} @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd") @@ -53,16 +53,16 @@ public class {{classname}} {{#parent}}extends {{{parent}}}{{/parent}}{{#serializ {{#vars}} /** {{#description}} - * {{description}} + * {{.}} {{/description}} {{^description}} * Get {{name}} {{/description}} {{#minimum}} - * minimum: {{minimum}} + * minimum: {{.}} {{/minimum}} {{#maximum}} - * maximum: {{maximum}} + * maximum: {{.}} {{/maximum}} * @return {{name}} */ diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-ext/pom.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-ext/pom.mustache index e9df52a01a6..3942068dc5f 100644 --- a/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-ext/pom.mustache +++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-ext/pom.mustache @@ -5,7 +5,7 @@ jar {{artifactId}} {{#appDescription}} - {{appDescription}} + {{.}} {{/appDescription}} {{artifactVersion}} @@ -131,7 +131,7 @@ ${cxf-version} test - + org.apache.cxf @@ -183,13 +183,13 @@ ${jackson-jaxrs-version} {{/java8}} -{{#useBeanValidationFeature}} +{{#useBeanValidationFeature}} org.hibernate hibernate-validator 5.2.2.Final -{{/useBeanValidationFeature}} +{{/useBeanValidationFeature}} diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-ext/queryParams.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-ext/queryParams.mustache index f89529fdb5d..38bfb9ed06e 100644 --- a/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-ext/queryParams.mustache +++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-ext/queryParams.mustache @@ -1 +1 @@ -{{#isQueryParam}}@QueryParam("{{baseName}}"){{#useBeanValidation}}{{>beanValidationQueryParams}}{{/useBeanValidation}} {{^isContainer}}{{#defaultValue}}@DefaultValue("{{{defaultValue}}}") {{/defaultValue}}{{/isContainer}}{{{dataType}}} {{paramName}}{{/isQueryParam}} \ No newline at end of file +{{#isQueryParam}}@QueryParam("{{baseName}}"){{#useBeanValidation}}{{>beanValidationQueryParams}}{{/useBeanValidation}} {{^isContainer}}{{#defaultValue}}@DefaultValue("{{{.}}}") {{/defaultValue}}{{/isContainer}}{{{dataType}}} {{paramName}}{{/isQueryParam}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-ext/returnTypes.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-ext/returnTypes.mustache index 6af86ffe4e4..32f96a90472 100644 --- a/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-ext/returnTypes.mustache +++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-ext/returnTypes.mustache @@ -1,4 +1,4 @@ -{{#useGenericResponse}}Response{{/useGenericResponse}}{{! non-generic response: +{{#useGenericResponse}}Response{{/useGenericResponse}}{{! non-generic response: }}{{^useGenericResponse}}{{! }}{{{returnType}}}{{! }}{{/useGenericResponse}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-ext/server/ApplicationContext.xml.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-ext/server/ApplicationContext.xml.mustache index b911475e293..e85294fb336 100644 --- a/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-ext/server/ApplicationContext.xml.mustache +++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-ext/server/ApplicationContext.xml.mustache @@ -1,6 +1,6 @@ - {{! http://cxf.apache.org/docs/swagger2feature.html }} + {{! http://cxf.apache.org/docs/swagger2feature.html }} {{#useSwaggerUI}} @@ -54,7 +54,7 @@ {{#useGzipFeature}} {{/useGzipFeature}} -{{#useBeanValidationFeature}} +{{#useBeanValidationFeature}} {{/useBeanValidationFeature}} @@ -81,14 +81,14 @@ -{{#useWadlFeature}} +{{#useWadlFeature}} {{/useWadlFeature}} -{{#useGzipFeature}} +{{#useGzipFeature}} @@ -136,10 +136,10 @@ {{/useWadlFeature}} -{{#useSwaggerFeature}} +{{#useSwaggerFeature}} {{/useSwaggerFeature}} -{{#useBeanValidationFeature}} +{{#useBeanValidationFeature}} {{/useBeanValidationFeature}} diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-ext/server/SpringBootApplication.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-ext/server/SpringBootApplication.mustache index a65a60f3ec2..a2c2d9c645d 100644 --- a/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-ext/server/SpringBootApplication.mustache +++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-ext/server/SpringBootApplication.mustache @@ -11,15 +11,15 @@ import org.springframework.context.annotation.ImportResource; @EnableAutoConfiguration @SpringBootConfiguration public class SpringBootApplication extends SpringBootServletInitializer { - + @Override protected SpringApplicationBuilder configure(SpringApplicationBuilder application) { return application.sources(SpringBootApplication.class); } - + public static void main(String[] args) { SpringApplication.run(SpringBootApplication.class, args); } - - + + } \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-ext/server/context.xml.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-ext/server/context.xml.mustache index a14b9a13d01..0dc82b9a2e9 100644 --- a/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-ext/server/context.xml.mustache +++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-ext/server/context.xml.mustache @@ -1,6 +1,6 @@ - - + + - + diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-ext/server/pom.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-ext/server/pom.mustache index 8cb82501d51..be1e78234c4 100644 --- a/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-ext/server/pom.mustache +++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-ext/server/pom.mustache @@ -5,7 +5,7 @@ war {{artifactId}} {{#appDescription}} - {{appDescription}} + {{.}} {{/appDescription}} {{artifactVersion}} {{#generateSpringBootApplication}} @@ -96,7 +96,7 @@ - + maven-war-plugin @@ -227,7 +227,7 @@ {{/generateSpringBootApplication}} {{/java8}} -{{#generateSpringApplication}} +{{#generateSpringApplication}} org.springframework @@ -256,7 +256,7 @@ {{^generateSpringBootApplication}} ${spring-version} {{/generateSpringBootApplication}} - + {{/generateSpringApplication}} {{#generateSpringBootApplication}} @@ -331,11 +331,11 @@ {{#useBeanValidation}} 1.1.0.Final {{/useBeanValidation}} -{{#generateSpringApplication}} +{{#generateSpringApplication}} {{^generateSpringBootApplication}} 5.0.8.RELEASE {{/generateSpringBootApplication}} -{{/generateSpringApplication}} +{{/generateSpringApplication}} {{^generateSpringBootApplication}} 4.13 1.2.0 diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-ext/server/web.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-ext/server/web.mustache index 9d905ae076b..890f10ef14d 100644 --- a/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-ext/server/web.mustache +++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf-ext/server/web.mustache @@ -19,5 +19,5 @@ CXFServiceServlet /rest/* - + diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf/allowableValues.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf/allowableValues.mustache index a48256d027a..75bce9385de 100644 --- a/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf/allowableValues.mustache +++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf/allowableValues.mustache @@ -1 +1 @@ -{{#allowableValues}}allowableValues="{{#values}}{{{.}}}{{^-last}}, {{/-last}}{{/values}}{{^values}}range=[{{#min}}{{.}}{{/min}}{{^min}}-infinity{{/min}}, {{#max}}{{.}}{{/max}}{{^max}}infinity{{/max}}]{{/values}}"{{/allowableValues}} \ No newline at end of file +{{#allowableValues}}allowableValues="{{#values}}{{{.}}}{{^-last}}, {{/-last}}{{/values}}{{^values}}range=[{{min}}{{^min}}-infinity{{/min}}, {{max}}{{^max}}infinity{{/max}}]{{/values}}"{{/allowableValues}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf/api.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf/api.mustache index 6b8e85e9239..09f19bbe5dd 100644 --- a/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf/api.mustache +++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf/api.mustache @@ -27,7 +27,7 @@ import javax.validation.Valid; * {{{appName}}} * {{#appDescription}} - *

{{{appDescription}}} + *

{{{.}}} * {{/appDescription}} */ @@ -47,7 +47,7 @@ public interface {{classname}} { * {{summary}} * {{#notes}} - * {{notes}} + * {{.}} * {{/notes}} */ @@ -62,9 +62,8 @@ public interface {{classname}} { {{/hasProduces}} @ApiOperation(value = "{{{summary}}}", tags={ {{#vendorExtensions.x-tags}}"{{tag}}"{{^-last}}, {{/-last}}{{/vendorExtensions.x-tags}} }) @ApiResponses(value = { {{#responses}} - @ApiResponse(code = {{{code}}}, message = "{{{message}}}"{{^vendorExtensions.x-java-is-response-void}}, response = {{{baseType}}}.class{{#containerType}}, responseContainer = "{{{containerType}}}"{{/containerType}}{{/vendorExtensions.x-java-is-response-void}}){{^-last}},{{/-last}}{{/responses}} }) + @ApiResponse(code = {{{code}}}, message = "{{{message}}}"{{^vendorExtensions.x-java-is-response-void}}, response = {{{baseType}}}.class{{#containerType}}, responseContainer = "{{{.}}}"{{/containerType}}{{/vendorExtensions.x-java-is-response-void}}){{^-last}},{{/-last}}{{/responses}} }) public {{>returnTypes}} {{nickname}}({{#allParams}}{{>queryParams}}{{>pathParams}}{{>headerParams}}{{>bodyParams}}{{>formParams}}{{^-last}}, {{/-last}}{{/allParams}}); {{/operation}} } {{/operations}} - diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf/apiServiceImpl.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf/apiServiceImpl.mustache index 52aa0e90ef7..bb9bc8d55fa 100644 --- a/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf/apiServiceImpl.mustache +++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf/apiServiceImpl.mustache @@ -30,7 +30,7 @@ import org.springframework.stereotype.Service; * {{{appName}}} * {{#appDescription}} - *

{{{appDescription}}} + *

{{{.}}} {{/appDescription}} * */ @@ -43,18 +43,17 @@ public class {{classname}}ServiceImpl implements {{classname}} { * {{summary}} * {{#notes}} - * {{notes}} + * {{.}} * {{/notes}} */ {{/summary}} public {{>returnTypes}} {{nickname}}({{#allParams}}{{>queryParamsImpl}}{{>pathParamsImpl}}{{>headerParamsImpl}}{{>bodyParamsImpl}}{{>formParamsImpl}}{{^-last}}, {{/-last}}{{/allParams}}) { // TODO: Implement... - + {{#useGenericResponse}}return Response.ok().entity("magic!").build();{{/useGenericResponse}}{{^useGenericResponse}}{{^vendorExtensions.x-java-is-response-void}}return null;{{/vendorExtensions.x-java-is-response-void}}{{/useGenericResponse}} } - + {{/operation}} } {{/operations}} - diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf/api_test.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf/api_test.mustache index 063c6554300..43c1d40d7a1 100644 --- a/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf/api_test.mustache +++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf/api_test.mustache @@ -43,14 +43,14 @@ import org.springframework.test.context.web.WebAppConfiguration; /** {{#appName}} - * {{{appName}}} + * {{{.}}} * {{/appName}} {{#appDescription}} - *

{{{appDescription}}} + *

{{{.}}} * {{/appDescription}} - * API tests for {{classname}} + * API tests for {{classname}} */ {{#generateSpringBootApplication}} @RunWith(SpringJUnit4ClassRunner.class) @@ -63,33 +63,33 @@ public class {{classname}}Test { {{#generateSpringBootApplication}} @Value("${local.server.port}") private int serverPort; -{{/generateSpringBootApplication}} +{{/generateSpringBootApplication}} private {{classname}} api; - + @Before public void setup() { JacksonJsonProvider provider = new JacksonJsonProvider(); List providers = new ArrayList(); providers.add(provider); - -{{#generateSpringBootApplication}} + +{{#generateSpringBootApplication}} api = JAXRSClientFactory.create("http://localhost:" + serverPort + "/services", {{classname}}.class, providers); -{{/generateSpringBootApplication}} +{{/generateSpringBootApplication}} {{^generateSpringBootApplication}} api = JAXRSClientFactory.create("{{{basePath}}}", {{classname}}.class, providers); {{/generateSpringBootApplication}} org.apache.cxf.jaxrs.client.Client client = WebClient.client(api); - - ClientConfiguration config = WebClient.getConfig(client); -{{#useGzipFeatureForTests}} + + ClientConfiguration config = WebClient.getConfig(client); +{{#useGzipFeatureForTests}} // Example for using Gzipping GZIPOutInterceptor gzipOutInterceptor = new GZIPOutInterceptor(); // use Gzipping for first request sent to server //gzipOutInterceptor.setForce(true); config.getOutInterceptors().add(gzipOutInterceptor); - - config.getInInterceptors().add(new GZIPInInterceptor()); + + config.getInInterceptors().add(new GZIPInInterceptor()); {{/useGzipFeatureForTests}} {{#useLoggingFeatureForTests}} LoggingOutInterceptor loggingOutInterceptor = new LoggingOutInterceptor(); @@ -103,7 +103,7 @@ public class {{classname}}Test { * {{summary}} * {{#notes}} - * {{notes}} + * {{.}} * {{/notes}} {{/summary}} @@ -118,8 +118,8 @@ public class {{classname}}Test { //{{^vendorExtensions.x-java-is-response-void}}{{>returnTypes}} response = {{/vendorExtensions.x-java-is-response-void}}api.{{operationId}}({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}); {{^vendorExtensions.x-java-is-response-void}}//assertNotNull(response);{{/vendorExtensions.x-java-is-response-void}} // TODO: test validations - - + + } {{/operation}}{{/operations}} } diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf/beanValidationCore.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf/beanValidationCore.mustache index 1f9f43e7b86..ff4ffe26c49 100644 --- a/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf/beanValidationCore.mustache +++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf/beanValidationCore.mustache @@ -4,17 +4,17 @@ minLength && maxLength set minLength set, maxLength not }}{{#minLength}}{{^maxLength}} @Size(min={{minLength}}){{/maxLength}}{{/minLength}}{{! minLength not set, maxLength set -}}{{^minLength}}{{#maxLength}} @Size(max={{maxLength}}){{/maxLength}}{{/minLength}}{{! +}}{{^minLength}}{{#maxLength}} @Size(max={{.}}){{/maxLength}}{{/minLength}}{{! @Size: minItems && maxItems set }}{{#minItems}}{{#maxItems}} @Size(min={{minItems}},max={{maxItems}}){{/maxItems}}{{/minItems}}{{! @Size: minItems set, maxItems not }}{{#minItems}}{{^maxItems}} @Size(min={{minItems}}){{/maxItems}}{{/minItems}}{{! @Size: minItems not set && maxItems set -}}{{^minItems}}{{#maxItems}} @Size(max={{maxItems}}){{/maxItems}}{{/minItems}}{{! +}}{{^minItems}}{{#maxItems}} @Size(max={{.}}){{/maxItems}}{{/minItems}}{{! check for integer or long / all others=decimal type with @Decimal* isInteger set -}}{{#isInteger}}{{#minimum}} @Min({{minimum}}){{/minimum}}{{#maximum}} @Max({{maximum}}){{/maximum}}{{/isInteger}}{{! +}}{{#isInteger}}{{#minimum}} @Min({{.}}){{/minimum}}{{#maximum}} @Max({{.}}){{/maximum}}{{/isInteger}}{{! isLong set -}}{{#isLong}}{{#minimum}} @Min({{minimum}}L){{/minimum}}{{#maximum}} @Max({{maximum}}L){{/maximum}}{{/isLong}}{{! +}}{{#isLong}}{{#minimum}} @Min({{.}}L){{/minimum}}{{#maximum}} @Max({{.}}L){{/maximum}}{{/isLong}}{{! Not Integer, not Long => we have a decimal value! }}{{^isInteger}}{{^isLong}}{{#minimum}} @DecimalMin({{#exclusiveMinimum}}value={{/exclusiveMinimum}}"{{minimum}}"{{#exclusiveMinimum}},inclusive=false{{/exclusiveMinimum}}){{/minimum}}{{#maximum}} @DecimalMax({{#exclusiveMaximum}}value={{/exclusiveMaximum}}"{{maximum}}"{{#exclusiveMaximum}},inclusive=false{{/exclusiveMaximum}}){{/maximum}}{{/isLong}}{{/isInteger}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf/beanValidationHeaderParams.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf/beanValidationHeaderParams.mustache index f8eef8f94c7..c4ff01d7e55 100644 --- a/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf/beanValidationHeaderParams.mustache +++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf/beanValidationHeaderParams.mustache @@ -1 +1 @@ -{{#required}} @NotNull{{/required}}{{>beanValidationCore}} \ No newline at end of file +{{#required}} @NotNull{{/required}}{{>beanValidationCore}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf/beanValidationQueryParams.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf/beanValidationQueryParams.mustache index f8eef8f94c7..c4ff01d7e55 100644 --- a/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf/beanValidationQueryParams.mustache +++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf/beanValidationQueryParams.mustache @@ -1 +1 @@ -{{#required}} @NotNull{{/required}}{{>beanValidationCore}} \ No newline at end of file +{{#required}} @NotNull{{/required}}{{>beanValidationCore}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf/enumClass.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf/enumClass.mustache index f2944aa5913..fa2e6804f31 100644 --- a/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf/enumClass.mustache +++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf/enumClass.mustache @@ -29,7 +29,7 @@ @JsonCreator {{/jackson}} public static {{datatypeWithEnum}} fromValue({{dataType}} value) { - for ({{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} b : {{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}}.values()) { + for ({{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} b : {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}}.values()) { if (b.value.equals(value)) { return b; } diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf/enumOuterClass.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf/enumOuterClass.mustache index 8d5639a8dec..149cb8a9953 100644 --- a/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf/enumOuterClass.mustache +++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf/enumOuterClass.mustache @@ -4,9 +4,9 @@ import com.fasterxml.jackson.annotation.JsonValue; {{/jackson}} /** - * {{^description}}Gets or Sets {{{name}}}{{/description}}{{#description}}{{description}}{{/description}} + * {{description}}{{^description}}Gets or Sets {{{name}}}{{/description}} */ -{{>additionalEnumTypeAnnotations}}public enum {{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} { +{{>additionalEnumTypeAnnotations}}public enum {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} { {{#gson}} {{#allowableValues}}{{#enumVars}} @SerializedName({{#isInteger}}"{{/isInteger}}{{#isDouble}}"{{/isDouble}}{{#isLong}}"{{/isLong}}{{#isFloat}}"{{/isFloat}}{{{value}}}{{#isInteger}}"{{/isInteger}}{{#isDouble}}"{{/isDouble}}{{#isLong}}"{{/isLong}}{{#isFloat}}"{{/isFloat}}) @@ -21,14 +21,14 @@ import com.fasterxml.jackson.annotation.JsonValue; private {{{dataType}}} value; - {{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}}({{{dataType}}} value) { + {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}}({{{dataType}}} value) { this.value = value; } @Override {{#jackson}} @JsonValue -{{/jackson}} +{{/jackson}} public String toString() { return String.valueOf(value); } @@ -36,13 +36,13 @@ import com.fasterxml.jackson.annotation.JsonValue; {{#jackson}} @JsonCreator {{/jackson}} - public static {{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} fromValue({{{dataType}}} value) { - for ({{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} b : {{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}}.values()) { + public static {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} fromValue({{{dataType}}} value) { + for ({{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} b : {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}}.values()) { if (b.value.equals(value)) { return b; } } {{#isNullable}}return null;{{/isNullable}}{{^isNullable}}throw new IllegalArgumentException("Unexpected value '" + value + "'");{{/isNullable}} } - + } diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf/licenseInfo.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf/licenseInfo.mustache index 9866f297a4d..be193d0c4fe 100644 --- a/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf/licenseInfo.mustache +++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf/licenseInfo.mustache @@ -2,8 +2,8 @@ * {{{appName}}} * {{{appDescription}}} * - * {{#version}}The version of the OpenAPI document: {{{version}}}{{/version}} - * {{#infoEmail}}Contact: {{{infoEmail}}}{{/infoEmail}} + * {{#version}}The version of the OpenAPI document: {{{.}}}{{/version}} + * {{#infoEmail}}Contact: {{{.}}}{{/infoEmail}} * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf/pojo.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf/pojo.mustache index 0dd381f8ee4..23fc0fb38ac 100644 --- a/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf/pojo.mustache +++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf/pojo.mustache @@ -14,18 +14,18 @@ import com.fasterxml.jackson.annotation.JsonProperty; **/ @ApiModel(description="{{{description}}}") {{/description}} -{{>additionalModelTypeAnnotations}}{{>xmlPojoAnnotation}}{{#discriminator}}{{>typeInfoAnnotation}}{{/discriminator}}public class {{classname}} {{#parent}}extends {{{parent}}}{{/parent}}{{#serializableModel}} implements Serializable{{/serializableModel}} { +{{>additionalModelTypeAnnotations}}{{>xmlPojoAnnotation}}{{#discriminator}}{{>typeInfoAnnotation}}{{/discriminator}}public class {{classname}} {{#parent}}extends {{{.}}}{{/parent}}{{#serializableModel}} implements Serializable{{/serializableModel}} { {{#vars}}{{#isEnum}}{{^isContainer}} {{>enumClass}}{{/isContainer}}{{#isContainer}}{{#mostInnerItems}} {{>enumClass}}{{/mostInnerItems}}{{/isContainer}}{{/isEnum}} {{#withXml}} @XmlElement(name="{{baseName}}"{{#required}}, required = {{required}}{{/required}}) {{/withXml}} - @ApiModelProperty({{#example}}example = "{{{example}}}", {{/example}}{{#required}}required = {{required}}, {{/required}}value = "{{{description}}}"){{^isPrimitiveType}}{{^isDate}}{{^isDateTime}}{{^isString}}{{^isFile}}{{#useBeanValidation}} + @ApiModelProperty({{#example}}example = "{{{.}}}", {{/example}}{{#required}}required = {{required}}, {{/required}}value = "{{{description}}}"){{^isPrimitiveType}}{{^isDate}}{{^isDateTime}}{{^isString}}{{^isFile}}{{#useBeanValidation}} @Valid{{/useBeanValidation}}{{/isFile}}{{/isString}}{{/isDateTime}}{{/isDate}}{{/isPrimitiveType}} {{#description}} /** - * {{{description}}} + * {{{.}}} **/ {{/description}} {{#vendorExtensions.x-is-jackson-optional-nullable}} @@ -48,16 +48,16 @@ import com.fasterxml.jackson.annotation.JsonProperty; {{#vars}} /** {{#description}} - * {{description}} + * {{.}} {{/description}} {{^description}} * Get {{name}} {{/description}} {{#minimum}} - * minimum: {{minimum}} + * minimum: {{.}} {{/minimum}} {{#maximum}} - * maximum: {{maximum}} + * maximum: {{.}} {{/maximum}} * @return {{name}} **/ diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf/pom.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf/pom.mustache index 493fd683cf9..653db6baad6 100644 --- a/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf/pom.mustache +++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf/pom.mustache @@ -5,7 +5,7 @@ jar {{artifactId}} {{#appDescription}} - {{appDescription}} + {{.}} {{/appDescription}} {{artifactVersion}} @@ -131,7 +131,7 @@ ${cxf-version} test - + org.apache.cxf @@ -177,7 +177,7 @@ ${jackson-jaxrs-version} {{/java8}} -{{#useBeanValidationFeature}} +{{#useBeanValidationFeature}} org.hibernate hibernate-validator diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf/queryParams.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf/queryParams.mustache index 292a818f8f1..6a1045abc50 100644 --- a/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf/queryParams.mustache +++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf/queryParams.mustache @@ -1 +1 @@ -{{#isQueryParam}}@QueryParam("{{baseName}}"){{#useBeanValidation}}{{>beanValidationQueryParams}}{{/useBeanValidation}} {{^isContainer}}{{#defaultValue}}@DefaultValue("{{{defaultValue}}}"){{/defaultValue}}{{/isContainer}}{{{dataType}}} {{paramName}}{{/isQueryParam}} \ No newline at end of file +{{#isQueryParam}}@QueryParam("{{baseName}}"){{#useBeanValidation}}{{>beanValidationQueryParams}}{{/useBeanValidation}} {{^isContainer}}{{#defaultValue}}@DefaultValue("{{{.}}}"){{/defaultValue}}{{/isContainer}}{{{dataType}}} {{paramName}}{{/isQueryParam}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf/returnTypes.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf/returnTypes.mustache index 6af86ffe4e4..32f96a90472 100644 --- a/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf/returnTypes.mustache +++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf/returnTypes.mustache @@ -1,4 +1,4 @@ -{{#useGenericResponse}}Response{{/useGenericResponse}}{{! non-generic response: +{{#useGenericResponse}}Response{{/useGenericResponse}}{{! non-generic response: }}{{^useGenericResponse}}{{! }}{{{returnType}}}{{! }}{{/useGenericResponse}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf/server/ApplicationContext.xml.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf/server/ApplicationContext.xml.mustache index b4cdc5b6cfd..fea1aecd174 100644 --- a/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf/server/ApplicationContext.xml.mustache +++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf/server/ApplicationContext.xml.mustache @@ -1,6 +1,6 @@ - -{{#useMultipartFeature}} + +{{#useMultipartFeature}} -{{/useMultipartFeature}} - +{{/useMultipartFeature}} + -{{#useSpringAnnotationConfig}} +{{#useSpringAnnotationConfig}} {{/useSpringAnnotationConfig}} -{{^useSpringAnnotationConfig}} +{{^useSpringAnnotationConfig}} {{#apiInfo}} {{#apis}} @@ -33,71 +33,71 @@ {{/apiInfo}} {{/useSpringAnnotationConfig}} -{{#useSwaggerFeature}} +{{#useSwaggerFeature}} - {{! http://cxf.apache.org/docs/swagger2feature.html }} + {{! http://cxf.apache.org/docs/swagger2feature.html }} -{{#useSwaggerUI}} +{{#useSwaggerUI}} -{{/useSwaggerUI}} +{{/useSwaggerUI}} - + {{/useSwaggerFeature}} -{{#useGzipFeature}} +{{#useGzipFeature}} {{/useGzipFeature}} -{{#useBeanValidationFeature}} +{{#useBeanValidationFeature}} -{{/useBeanValidationFeature}} +{{/useBeanValidationFeature}} -{{#useGzipFeature}} +{{#useGzipFeature}} -{{/useGzipFeature}} +{{/useGzipFeature}} {{#useBeanValidationFeature}} -{{/useBeanValidationFeature}} +{{/useBeanValidationFeature}} -{{#useLoggingFeature}} +{{#useLoggingFeature}} -{{/useLoggingFeature}} -{{#useGzipFeature}} +{{/useLoggingFeature}} +{{#useGzipFeature}} -{{/useGzipFeature}} +{{/useGzipFeature}} - -{{#useWadlFeature}} + +{{#useWadlFeature}} {{/useWadlFeature}} -{{#useGzipFeature}} +{{#useGzipFeature}} - + -{{/useGzipFeature}} +{{/useGzipFeature}} {{#useBeanValidationFeature}} @@ -107,17 +107,17 @@ - + - + {{/useBeanValidationFeature}} {{^useBeanValidationFeature}} {{/useBeanValidationFeature}} - + @@ -129,21 +129,21 @@ -{{#useMultipartFeature}} +{{#useMultipartFeature}} -{{/useMultipartFeature}} -{{#useWadlFeature}} +{{/useMultipartFeature}} +{{#useWadlFeature}} -{{/useWadlFeature}} +{{/useWadlFeature}} -{{#useSwaggerFeature}} +{{#useSwaggerFeature}} -{{/useSwaggerFeature}} -{{#useBeanValidationFeature}} +{{/useSwaggerFeature}} +{{#useBeanValidationFeature}} -{{/useBeanValidationFeature}} +{{/useBeanValidationFeature}} - + diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf/server/SpringBootApplication.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf/server/SpringBootApplication.mustache index f6d08e71296..b71ad21f3ee 100644 --- a/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf/server/SpringBootApplication.mustache +++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf/server/SpringBootApplication.mustache @@ -9,15 +9,15 @@ import org.springframework.context.annotation.ImportResource; @ImportResource({"classpath:/ApplicationContext.xml"}) @EnableAutoConfiguration public class SpringBootApplication extends SpringBootServletInitializer { - + @Override protected SpringApplicationBuilder configure(SpringApplicationBuilder application) { return application.sources(SpringBootApplication.class); } - + public static void main(String[] args) { SpringApplication.run(SpringBootApplication.class, args); } - - + + } \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf/server/context.xml.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf/server/context.xml.mustache index a14b9a13d01..0dc82b9a2e9 100644 --- a/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf/server/context.xml.mustache +++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf/server/context.xml.mustache @@ -1,6 +1,6 @@ - - + + - + diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf/server/pom.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf/server/pom.mustache index 28a678bb612..edd5bef2893 100644 --- a/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf/server/pom.mustache +++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf/server/pom.mustache @@ -5,7 +5,7 @@ war {{artifactId}} {{#appDescription}} - {{appDescription}} + {{.}} {{/appDescription}} {{artifactVersion}} @@ -88,7 +88,7 @@ - + maven-war-plugin @@ -140,7 +140,7 @@ ${cxf-version} test - + org.apache.cxf @@ -192,7 +192,7 @@ ${jackson-jaxrs-version} {{/java8}} -{{#generateSpringApplication}} +{{#generateSpringApplication}} org.springframework @@ -203,7 +203,7 @@ org.springframework spring-web ${spring-version} - + {{/generateSpringApplication}} {{#generateSpringBootApplication}} @@ -220,7 +220,7 @@ ${spring.boot-version} test - + org.apache.cxf cxf-spring-boot-starter-jaxrs @@ -263,12 +263,12 @@ {{#useBeanValidation}} 1.1.0.Final {{/useBeanValidation}} -{{#generateSpringApplication}} +{{#generateSpringApplication}} 4.3.13.RELEASE -{{/generateSpringApplication}} +{{/generateSpringApplication}} {{#generateSpringBootApplication}} 1.5.9.RELEASE -{{/generateSpringBootApplication}} +{{/generateSpringBootApplication}} 3.3.0 2.9.9 1.3.2 diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf/server/web.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf/server/web.mustache index 9d905ae076b..890f10ef14d 100644 --- a/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf/server/web.mustache +++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/cxf/server/web.mustache @@ -19,5 +19,5 @@ CXFServiceServlet /rest/* - + diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/enumClass.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/enumClass.mustache index 579070d66e6..d5394d737de 100644 --- a/modules/openapi-generator/src/main/resources/JavaJaxRS/enumClass.mustache +++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/enumClass.mustache @@ -1,13 +1,13 @@ /** - * {{^description}}Gets or Sets {{{name}}}{{/description}}{{#description}}{{description}}{{/description}} + * {{description}}{{^description}}Gets or Sets {{{name}}}{{/description}} */ - {{>additionalEnumTypeAnnotations}}public enum {{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}} { + {{>additionalEnumTypeAnnotations}}public enum {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}} { {{#gson}} {{#allowableValues}} {{#enumVars}} {{#enumDescription}} /** - * {{enumDescription}} + * {{.}} */ {{/enumDescription}} @SerializedName({{#isInteger}}"{{/isInteger}}{{#isDouble}}"{{/isDouble}}{{#isLong}}"{{/isLong}}{{#isFloat}}"{{/isFloat}}{{{value}}}{{#isInteger}}"{{/isInteger}}{{#isDouble}}"{{/isDouble}}{{#isLong}}"{{/isLong}}{{#isFloat}}"{{/isFloat}}) @@ -21,7 +21,7 @@ {{#enumVars}} {{#enumDescription}} /** - * {{enumDescription}} + * {{.}} */ {{/enumDescription}} {{{name}}}({{{value}}}){{^-last}}, @@ -32,7 +32,7 @@ private {{{dataType}}} value; - {{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}({{{dataType}}} value) { + {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}({{{dataType}}} value) { this.value = value; } @@ -43,8 +43,8 @@ } @JsonCreator - public static {{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} fromValue({{{dataType}}} value) { - for ({{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} b : {{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}}.values()) { + public static {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} fromValue({{{dataType}}} value) { + for ({{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} b : {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}}.values()) { if (b.value.equals(value)) { return b; } diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/enumOuterClass.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/enumOuterClass.mustache index 84e034d1cf3..f41a3eb8455 100644 --- a/modules/openapi-generator/src/main/resources/JavaJaxRS/enumOuterClass.mustache +++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/enumOuterClass.mustache @@ -3,14 +3,14 @@ import com.fasterxml.jackson.annotation.JsonCreator; {{/jackson}} /** - * {{^description}}Gets or Sets {{{name}}}{{/description}}{{#description}}{{description}}{{/description}} + * {{description}}{{^description}}Gets or Sets {{{name}}}{{/description}} */ -{{>additionalEnumTypeAnnotations}}public enum {{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} { +{{>additionalEnumTypeAnnotations}}public enum {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} { {{#gson}} {{#allowableValues}}{{#enumVars}} {{#enumDescription}} /** - * {{enumDescription}} + * {{.}} */ {{/enumDescription}} @SerializedName({{#isInteger}}"{{/isInteger}}{{#isDouble}}"{{/isDouble}}{{#isLong}}"{{/isLong}}{{#isFloat}}"{{/isFloat}}{{{value}}}{{#isInteger}}"{{/isInteger}}{{#isDouble}}"{{/isDouble}}{{#isLong}}"{{/isLong}}{{#isFloat}}"{{/isFloat}}) @@ -21,7 +21,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; {{#allowableValues}}{{#enumVars}} {{#enumDescription}} /** - * {{enumDescription}} + * {{.}} */ {{/enumDescription}} {{{name}}}({{{value}}}){{^-last}}, @@ -30,7 +30,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; private {{{dataType}}} value; - {{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}}({{{dataType}}} value) { + {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}}({{{dataType}}} value) { this.value = value; } @@ -41,8 +41,8 @@ import com.fasterxml.jackson.annotation.JsonCreator; } @JsonCreator - public static {{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} fromValue({{{dataType}}} value) { - for ({{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} b : {{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}}.values()) { + public static {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} fromValue({{{dataType}}} value) { + for ({{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} b : {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}}.values()) { if (b.value.equals(value)) { return b; } diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/formParams.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/formParams.mustache index bb84392b9c3..ec1f31d77ac 100644 --- a/modules/openapi-generator/src/main/resources/JavaJaxRS/formParams.mustache +++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/formParams.mustache @@ -1,2 +1,2 @@ -{{#isFormParam}}{{^isFile}}@ApiParam(value = "{{{description}}}"{{#required}}, required=true{{/required}}{{#allowableValues}}, {{> allowableValues }}{{/allowableValues}}{{#defaultValue}}, defaultValue="{{{defaultValue}}}"{{/defaultValue}}){{#vendorExtensions.x-multipart}}@FormDataParam("{{baseName}}") {{{dataType}}} {{paramName}}{{/vendorExtensions.x-multipart}}{{^vendorExtensions.x-multipart}} {{#defaultValue}} @DefaultValue("{{{defaultValue}}}"){{/defaultValue}} @FormParam("{{baseName}}") {{{dataType}}} {{paramName}}{{/vendorExtensions.x-multipart}}{{/isFile}}{{#isFile}} +{{#isFormParam}}{{^isFile}}@ApiParam(value = "{{{description}}}"{{#required}}, required=true{{/required}}{{#allowableValues}}, {{> allowableValues }}{{/allowableValues}}{{#defaultValue}}, defaultValue="{{{.}}}"{{/defaultValue}}){{#vendorExtensions.x-multipart}}@FormDataParam("{{baseName}}") {{{dataType}}} {{paramName}}{{/vendorExtensions.x-multipart}}{{^vendorExtensions.x-multipart}} {{#defaultValue}} @DefaultValue("{{{.}}}"){{/defaultValue}} @FormParam("{{baseName}}") {{{dataType}}} {{paramName}}{{/vendorExtensions.x-multipart}}{{/isFile}}{{#isFile}} {{^isArray}} @FormDataParam("{{baseName}}") FormDataBodyPart {{paramName}}Bodypart {{/isArray}}{{#isArray}} @FormDataParam("{{baseName}}") List {{paramName}}Bodypart {{/isArray}}{{/isFile}}{{/isFormParam}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/headerParams.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/headerParams.mustache index 1360d796826..59bc4938251 100644 --- a/modules/openapi-generator/src/main/resources/JavaJaxRS/headerParams.mustache +++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/headerParams.mustache @@ -1 +1 @@ -{{#isHeaderParam}}@ApiParam(value = "{{{description}}}" {{#required}},required=true{{/required}}{{#allowableValues}}, {{> allowableValues }}{{/allowableValues}}{{#defaultValue}}, defaultValue="{{{defaultValue}}}"{{/defaultValue}})@HeaderParam("{{baseName}}") {{{dataType}}} {{paramName}}{{/isHeaderParam}} \ No newline at end of file +{{#isHeaderParam}}@ApiParam(value = "{{{description}}}" {{#required}},required=true{{/required}}{{#allowableValues}}, {{> allowableValues }}{{/allowableValues}}{{#defaultValue}}, defaultValue="{{{.}}}"{{/defaultValue}})@HeaderParam("{{baseName}}") {{{dataType}}} {{paramName}}{{/isHeaderParam}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/libraries/jersey1/api.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/libraries/jersey1/api.mustache index a8b1cafb8f9..d7299149e05 100644 --- a/modules/openapi-generator/src/main/resources/JavaJaxRS/libraries/jersey1/api.mustache +++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/libraries/jersey1/api.mustache @@ -42,7 +42,7 @@ public class {{classname}} { {{#subresourceOperation}}@Path("{{{path}}}"){{/subresourceOperation}} {{#hasConsumes}}@Consumes({ {{#consumes}}"{{{mediaType}}}"{{^-last}}, {{/-last}}{{/consumes}} }){{/hasConsumes}} {{#hasProduces}}@Produces({ {{#produces}}"{{{mediaType}}}"{{^-last}}, {{/-last}}{{/produces}} }){{/hasProduces}} - @io.swagger.annotations.ApiOperation(value = "{{{summary}}}", notes = "{{{notes}}}", response = {{{returnBaseType}}}.class{{#returnContainer}}, responseContainer = "{{{returnContainer}}}"{{/returnContainer}}{{#hasAuthMethods}}, authorizations = { + @io.swagger.annotations.ApiOperation(value = "{{{summary}}}", notes = "{{{notes}}}", response = {{{returnBaseType}}}.class{{#returnContainer}}, responseContainer = "{{{.}}}"{{/returnContainer}}{{#hasAuthMethods}}, authorizations = { {{#authMethods}}@io.swagger.annotations.Authorization(value = "{{name}}"{{#isOAuth}}, scopes = { {{#scopes}}@io.swagger.annotations.AuthorizationScope(scope = "{{scope}}", description = "{{description}}"){{^-last}}, {{/-last}}{{/scopes}} @@ -50,7 +50,7 @@ public class {{classname}} { {{/-last}}{{/authMethods}} }{{/hasAuthMethods}}, tags={ {{#vendorExtensions.x-tags}}"{{tag}}"{{^-last}}, {{/-last}}{{/vendorExtensions.x-tags}} }) @io.swagger.annotations.ApiResponses(value = { {{#responses}} - @io.swagger.annotations.ApiResponse(code = {{{code}}}, message = "{{{message}}}", response = {{{baseType}}}.class{{#containerType}}, responseContainer = "{{{containerType}}}"{{/containerType}}){{^-last}},{{/-last}}{{/responses}} }) + @io.swagger.annotations.ApiResponse(code = {{{code}}}, message = "{{{message}}}", response = {{{baseType}}}.class{{#containerType}}, responseContainer = "{{{.}}}"{{/containerType}}){{^-last}},{{/-last}}{{/responses}} }) public Response {{nickname}}( {{#allParams}}{{>queryParams}}{{>pathParams}}{{>headerParams}}{{>bodyParams}}{{>formParams}}, {{/allParams}}@Context SecurityContext securityContext) diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/libraries/jersey1/formParams.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/libraries/jersey1/formParams.mustache index d02af8c3d3d..1ac5c8f37a9 100644 --- a/modules/openapi-generator/src/main/resources/JavaJaxRS/libraries/jersey1/formParams.mustache +++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/libraries/jersey1/formParams.mustache @@ -1 +1 @@ -{{#isFormParam}}{{^isFile}}{{^vendorExtensions.x-multipart}}@ApiParam(value = "{{{description}}}"{{#required}}, required=true{{/required}}{{#allowableValues}}, {{> allowableValues }}{{/allowableValues}}{{#defaultValue}}, defaultValue="{{{defaultValue}}}"{{/defaultValue}}){{/vendorExtensions.x-multipart}}{{#vendorExtensions.x-multipart}}@FormDataParam("{{baseName}}") {{{dataType}}} {{paramName}}{{/vendorExtensions.x-multipart}}{{^vendorExtensions.x-multipart}} {{#defaultValue}} @DefaultValue("{{{defaultValue}}}"){{/defaultValue}} @FormParam("{{baseName}}") {{{dataType}}} {{paramName}}{{/vendorExtensions.x-multipart}}{{/isFile}}{{#isFile}}{{^isArray}}@FormDataParam("{{baseName}}") FormDataBodyPart {{paramName}}Bodypart{{/isArray}}{{#isArray}}@FormDataParam("{{baseName}}") List {{paramName}}Bodypart{{/isArray}}{{/isFile}}{{/isFormParam}} \ No newline at end of file +{{#isFormParam}}{{^isFile}}{{^vendorExtensions.x-multipart}}@ApiParam(value = "{{{description}}}"{{#required}}, required=true{{/required}}{{#allowableValues}}, {{> allowableValues }}{{/allowableValues}}{{#defaultValue}}, defaultValue="{{{.}}}"{{/defaultValue}}){{/vendorExtensions.x-multipart}}{{#vendorExtensions.x-multipart}}@FormDataParam("{{baseName}}") {{{dataType}}} {{paramName}}{{/vendorExtensions.x-multipart}}{{^vendorExtensions.x-multipart}} {{#defaultValue}} @DefaultValue("{{{.}}}"){{/defaultValue}} @FormParam("{{baseName}}") {{{dataType}}} {{paramName}}{{/vendorExtensions.x-multipart}}{{/isFile}}{{#isFile}}{{^isArray}}@FormDataParam("{{baseName}}") FormDataBodyPart {{paramName}}Bodypart{{/isArray}}{{#isArray}}@FormDataParam("{{baseName}}") List {{paramName}}Bodypart{{/isArray}}{{/isFile}}{{/isFormParam}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/licenseInfo.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/licenseInfo.mustache index abc2f4578eb..c66209f2794 100644 --- a/modules/openapi-generator/src/main/resources/JavaJaxRS/licenseInfo.mustache +++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/licenseInfo.mustache @@ -2,8 +2,8 @@ * {{{appName}}} * {{{appDescription}}} * - * {{#version}}The version of the OpenAPI document: {{{version}}}{{/version}} - * {{#infoEmail}}Contact: {{{infoEmail}}}{{/infoEmail}} + * {{#version}}The version of the OpenAPI document: {{{.}}}{{/version}} + * {{#infoEmail}}Contact: {{{.}}}{{/infoEmail}} * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/modelEnum.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/modelEnum.mustache index bff968c4689..ba82ea473b4 100644 --- a/modules/openapi-generator/src/main/resources/JavaJaxRS/modelEnum.mustache +++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/modelEnum.mustache @@ -4,9 +4,9 @@ import com.fasterxml.jackson.annotation.JsonValue; {{/jackson}} /** - * {{^description}}Gets or Sets {{{name}}}{{/description}}{{#description}}{{description}}{{/description}} + * {{description}}{{^description}}Gets or Sets {{{name}}}{{/description}} */ -{{>additionalEnumTypeAnnotations}}public enum {{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} { +{{>additionalEnumTypeAnnotations}}public enum {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} { {{#gson}} {{#allowableValues}}{{#enumVars}} @SerializedName({{#isInteger}}"{{/isInteger}}{{#isDouble}}"{{/isDouble}}{{#isLong}}"{{/isLong}}{{#isFloat}}"{{/isFloat}}{{{value}}}{{#isInteger}}"{{/isInteger}}{{#isDouble}}"{{/isDouble}}{{#isLong}}"{{/isLong}}{{#isFloat}}"{{/isFloat}}) @@ -21,7 +21,7 @@ import com.fasterxml.jackson.annotation.JsonValue; private {{{dataType}}} value; - {{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}}({{{dataType}}} value) { + {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}}({{{dataType}}} value) { this.value = value; } @@ -39,8 +39,8 @@ import com.fasterxml.jackson.annotation.JsonValue; {{#jackson}} @JsonCreator - public static {{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} fromValue({{{dataType}}} value) { - for ({{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} b : {{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}}.values()) { + public static {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} fromValue({{{dataType}}} value) { + for ({{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} b : {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}}.values()) { if (b.value.equals(value)) { return b; } diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/pathParams.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/pathParams.mustache index 15a08e20b05..8287f8d6a53 100644 --- a/modules/openapi-generator/src/main/resources/JavaJaxRS/pathParams.mustache +++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/pathParams.mustache @@ -3,7 +3,7 @@ }}@ApiParam(value = "{{{description}}}"{{! }}{{#required}}, required = true{{/required}}{{! }}{{#allowableValues}}, {{> allowableValues}}{{/allowableValues}}{{! - }}{{#defaultValue}}, defaultValue = "{{{defaultValue}}}"{{/defaultValue}}{{! + }}{{#defaultValue}}, defaultValue = "{{{.}}}"{{/defaultValue}}{{! }}){{! }} @PathParam("{{baseName}}"){{! diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/pojo.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/pojo.mustache index 637add30c23..e55b7e95724 100644 --- a/modules/openapi-generator/src/main/resources/JavaJaxRS/pojo.mustache +++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/pojo.mustache @@ -1,7 +1,7 @@ /** - * {{#description}}{{.}}{{/description}}{{^description}}{{classname}}{{/description}} + * {{description}}{{^description}}{{classname}}{{/description}} */{{#description}} -@ApiModel(description = "{{{description}}}"){{/description}} +@ApiModel(description = "{{{.}}}"){{/description}} {{#jackson}} @JsonPropertyOrder({ {{#vars}} @@ -10,7 +10,7 @@ }) {{/jackson}} {{>additionalModelTypeAnnotations}}{{>generatedAnnotation}}{{#discriminator}}{{>typeInfoAnnotation}}{{/discriminator}} -public class {{classname}} {{#parent}}extends {{{parent}}}{{/parent}} {{#serializableModel}}implements Serializable{{/serializableModel}} { +public class {{classname}} {{#parent}}extends {{{.}}}{{/parent}} {{#serializableModel}}implements Serializable{{/serializableModel}} { {{#vars}} {{#isEnum}} {{^isContainer}} @@ -70,16 +70,16 @@ public class {{classname}} {{#parent}}extends {{{parent}}}{{/parent}} {{#seriali /** {{#description}} - * {{description}} + * {{.}} {{/description}} {{^description}} * Get {{name}} {{/description}} {{#minimum}} - * minimum: {{minimum}} + * minimum: {{.}} {{/minimum}} {{#maximum}} - * maximum: {{maximum}} + * maximum: {{.}} {{/maximum}} * @return {{name}} **/ @@ -89,7 +89,7 @@ public class {{classname}} {{#parent}}extends {{{parent}}}{{/parent}} {{#seriali {{#jackson}} @JsonProperty(value = "{{baseName}}"{{#isReadOnly}}, access = JsonProperty.Access.READ_ONLY{{/isReadOnly}}{{#isWriteOnly}}, access = JsonProperty.Access.WRITE_ONLY{{/isWriteOnly}}) {{/jackson}} - @ApiModelProperty({{#example}}example = "{{{example}}}", {{/example}}{{#required}}required = {{required}}, {{/required}}value = "{{{description}}}") + @ApiModelProperty({{#example}}example = "{{{.}}}", {{/example}}{{#required}}required = {{required}}, {{/required}}value = "{{{description}}}") {{#useBeanValidation}}{{>beanValidation}}{{/useBeanValidation}} public {{{datatypeWithEnum}}} {{getter}}() { return {{name}}; diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/pom.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/pom.mustache index dc2a043addb..3c3b77b82c3 100644 --- a/modules/openapi-generator/src/main/resources/JavaJaxRS/pom.mustache +++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/pom.mustache @@ -13,7 +13,7 @@ repo - + src/main/java @@ -181,7 +181,7 @@ ${commons_io_version} {{/supportJava6}} - + {{#useBeanValidation}} diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/queryParams.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/queryParams.mustache index 2600cbe7518..18a82c524a6 100644 --- a/modules/openapi-generator/src/main/resources/JavaJaxRS/queryParams.mustache +++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/queryParams.mustache @@ -4,7 +4,7 @@ }}{{#required}}, required = true{{/required}}{{! }}{{^isContainer}}{{! }}{{#allowableValues}}, {{> allowableValues}}{{/allowableValues}}{{! - }}{{#defaultValue}}, defaultValue = "{{{defaultValue}}}"{{/defaultValue}}{{! + }}{{#defaultValue}}, defaultValue = "{{{.}}}"{{/defaultValue}}{{! }}{{/isContainer}}{{! }}){{! diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/resteasy/ApiResponseMessage.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/resteasy/ApiResponseMessage.mustache index f47a5350943..c883e16b5e6 100644 --- a/modules/openapi-generator/src/main/resources/JavaJaxRS/resteasy/ApiResponseMessage.mustache +++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/resteasy/ApiResponseMessage.mustache @@ -14,9 +14,9 @@ public class ApiResponseMessage { int code; String type; String message; - + public ApiResponseMessage(){} - + public ApiResponseMessage(int code, String message){ this.code = code; switch(code){ diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/resteasy/allowableValues.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/resteasy/allowableValues.mustache index a48256d027a..75bce9385de 100644 --- a/modules/openapi-generator/src/main/resources/JavaJaxRS/resteasy/allowableValues.mustache +++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/resteasy/allowableValues.mustache @@ -1 +1 @@ -{{#allowableValues}}allowableValues="{{#values}}{{{.}}}{{^-last}}, {{/-last}}{{/values}}{{^values}}range=[{{#min}}{{.}}{{/min}}{{^min}}-infinity{{/min}}, {{#max}}{{.}}{{/max}}{{^max}}infinity{{/max}}]{{/values}}"{{/allowableValues}} \ No newline at end of file +{{#allowableValues}}allowableValues="{{#values}}{{{.}}}{{^-last}}, {{/-last}}{{/values}}{{^values}}range=[{{min}}{{^min}}-infinity{{/min}}, {{max}}{{^max}}infinity{{/max}}]{{/values}}"{{/allowableValues}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/resteasy/api.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/resteasy/api.mustache index 4b4575440be..5cdf6ea0be0 100644 --- a/modules/openapi-generator/src/main/resources/JavaJaxRS/resteasy/api.mustache +++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/resteasy/api.mustache @@ -42,7 +42,7 @@ public class {{classname}} { {{#subresourceOperation}}@Path("{{{path}}}"){{/subresourceOperation}} {{#hasConsumes}}@Consumes({ {{#consumes}}"{{{mediaType}}}"{{^-last}}, {{/-last}}{{/consumes}} }){{/hasConsumes}} {{#hasProduces}}@Produces({ {{#produces}}"{{{mediaType}}}"{{^-last}}, {{/-last}}{{/produces}} }){{/hasProduces}} - @io.swagger.annotations.ApiOperation(value = "{{{summary}}}", notes = "{{{notes}}}", response = {{{returnBaseType}}}.class{{#returnContainer}}, responseContainer = "{{{returnContainer}}}"{{/returnContainer}}{{#hasAuthMethods}}, authorizations = { + @io.swagger.annotations.ApiOperation(value = "{{{summary}}}", notes = "{{{notes}}}", response = {{{returnBaseType}}}.class{{#returnContainer}}, responseContainer = "{{{.}}}"{{/returnContainer}}{{#hasAuthMethods}}, authorizations = { {{#authMethods}}@io.swagger.annotations.Authorization(value = "{{name}}"{{#isOAuth}}, scopes = { {{#scopes}}@io.swagger.annotations.AuthorizationScope(scope = "{{scope}}", description = "{{description}}"){{^-last}}, {{/-last}}{{/scopes}} @@ -50,7 +50,7 @@ public class {{classname}} { {{/-last}}{{/authMethods}} }{{/hasAuthMethods}}, tags={ {{#vendorExtensions.x-tags}}"{{tag}}",{{/vendorExtensions.x-tags}} }) @io.swagger.annotations.ApiResponses(value = { {{#responses}} - @io.swagger.annotations.ApiResponse(code = {{{code}}}, message = "{{{message}}}", response = {{{baseType}}}.class{{#containerType}}, responseContainer = "{{{containerType}}}"{{/containerType}}){{^-last}}, + @io.swagger.annotations.ApiResponse(code = {{{code}}}, message = "{{{message}}}", response = {{{baseType}}}.class{{#containerType}}, responseContainer = "{{{.}}}"{{/containerType}}){{^-last}}, {{/-last}}{{/responses}} }) public Response {{nickname}}({{#isMultipart}}MultipartFormDataInput input,{{/isMultipart}}{{#allParams}}{{>queryParams}}{{>pathParams}}{{>headerParams}}{{>bodyParams}}{{^isMultipart}}{{>formParams}},{{/isMultipart}}{{#isMultipart}}{{^isFormParam}},{{/isFormParam}}{{/isMultipart}}{{/allParams}}@Context SecurityContext securityContext) throws NotFoundException { diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/resteasy/beanValidationCore.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/resteasy/beanValidationCore.mustache index 1f9f43e7b86..ff4ffe26c49 100644 --- a/modules/openapi-generator/src/main/resources/JavaJaxRS/resteasy/beanValidationCore.mustache +++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/resteasy/beanValidationCore.mustache @@ -4,17 +4,17 @@ minLength && maxLength set minLength set, maxLength not }}{{#minLength}}{{^maxLength}} @Size(min={{minLength}}){{/maxLength}}{{/minLength}}{{! minLength not set, maxLength set -}}{{^minLength}}{{#maxLength}} @Size(max={{maxLength}}){{/maxLength}}{{/minLength}}{{! +}}{{^minLength}}{{#maxLength}} @Size(max={{.}}){{/maxLength}}{{/minLength}}{{! @Size: minItems && maxItems set }}{{#minItems}}{{#maxItems}} @Size(min={{minItems}},max={{maxItems}}){{/maxItems}}{{/minItems}}{{! @Size: minItems set, maxItems not }}{{#minItems}}{{^maxItems}} @Size(min={{minItems}}){{/maxItems}}{{/minItems}}{{! @Size: minItems not set && maxItems set -}}{{^minItems}}{{#maxItems}} @Size(max={{maxItems}}){{/maxItems}}{{/minItems}}{{! +}}{{^minItems}}{{#maxItems}} @Size(max={{.}}){{/maxItems}}{{/minItems}}{{! check for integer or long / all others=decimal type with @Decimal* isInteger set -}}{{#isInteger}}{{#minimum}} @Min({{minimum}}){{/minimum}}{{#maximum}} @Max({{maximum}}){{/maximum}}{{/isInteger}}{{! +}}{{#isInteger}}{{#minimum}} @Min({{.}}){{/minimum}}{{#maximum}} @Max({{.}}){{/maximum}}{{/isInteger}}{{! isLong set -}}{{#isLong}}{{#minimum}} @Min({{minimum}}L){{/minimum}}{{#maximum}} @Max({{maximum}}L){{/maximum}}{{/isLong}}{{! +}}{{#isLong}}{{#minimum}} @Min({{.}}L){{/minimum}}{{#maximum}} @Max({{.}}L){{/maximum}}{{/isLong}}{{! Not Integer, not Long => we have a decimal value! }}{{^isInteger}}{{^isLong}}{{#minimum}} @DecimalMin({{#exclusiveMinimum}}value={{/exclusiveMinimum}}"{{minimum}}"{{#exclusiveMinimum}},inclusive=false{{/exclusiveMinimum}}){{/minimum}}{{#maximum}} @DecimalMax({{#exclusiveMaximum}}value={{/exclusiveMaximum}}"{{maximum}}"{{#exclusiveMaximum}},inclusive=false{{/exclusiveMaximum}}){{/maximum}}{{/isLong}}{{/isInteger}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/resteasy/beanValidationHeaderParams.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/resteasy/beanValidationHeaderParams.mustache index f8eef8f94c7..c4ff01d7e55 100644 --- a/modules/openapi-generator/src/main/resources/JavaJaxRS/resteasy/beanValidationHeaderParams.mustache +++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/resteasy/beanValidationHeaderParams.mustache @@ -1 +1 @@ -{{#required}} @NotNull{{/required}}{{>beanValidationCore}} \ No newline at end of file +{{#required}} @NotNull{{/required}}{{>beanValidationCore}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/resteasy/beanValidationQueryParams.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/resteasy/beanValidationQueryParams.mustache index f8eef8f94c7..c4ff01d7e55 100644 --- a/modules/openapi-generator/src/main/resources/JavaJaxRS/resteasy/beanValidationQueryParams.mustache +++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/resteasy/beanValidationQueryParams.mustache @@ -1 +1 @@ -{{#required}} @NotNull{{/required}}{{>beanValidationCore}} \ No newline at end of file +{{#required}} @NotNull{{/required}}{{>beanValidationCore}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/resteasy/bodyParams.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/resteasy/bodyParams.mustache index eec07e9062d..879b7f2fc0c 100644 --- a/modules/openapi-generator/src/main/resources/JavaJaxRS/resteasy/bodyParams.mustache +++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/resteasy/bodyParams.mustache @@ -1 +1 @@ -{{#isBodyParam}}@ApiParam(value = "{{{description}}}" {{#required}},required=true{{/required}}{{#allowableValues}}, {{> allowableValues }}{{/allowableValues}}{{#defaultValue}}, defaultValue="{{{defaultValue}}}"{{/defaultValue}}){{#useBeanValidation}}{{#required}} @NotNull{{/required}} @Valid{{/useBeanValidation}} {{{dataType}}} {{paramName}}{{/isBodyParam}} \ No newline at end of file +{{#isBodyParam}}@ApiParam(value = "{{{description}}}" {{#required}},required=true{{/required}}{{#allowableValues}}, {{> allowableValues }}{{/allowableValues}}{{#defaultValue}}, defaultValue="{{{.}}}"{{/defaultValue}}){{#useBeanValidation}}{{#required}} @NotNull{{/required}} @Valid{{/useBeanValidation}} {{{dataType}}} {{paramName}}{{/isBodyParam}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/resteasy/eap/JacksonConfig.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/resteasy/eap/JacksonConfig.mustache index 923d26477d9..3750df40bf8 100644 --- a/modules/openapi-generator/src/main/resources/JavaJaxRS/resteasy/eap/JacksonConfig.mustache +++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/resteasy/eap/JacksonConfig.mustache @@ -26,8 +26,8 @@ public class JacksonConfig implements ContextResolver { public JacksonConfig() throws Exception { this.objectMapper = new ObjectMapper(); - -{{#java8}} + +{{#java8}} this.objectMapper.registerModule(new JavaTimeModule()); {{/java8}} {{^java8}} @@ -37,7 +37,7 @@ public class JacksonConfig implements ContextResolver { // sample to convert any DateTime to readable timestamps //this.objectMapper.configure(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS, true); } - + public ObjectMapper getContext(Class objectType) { return objectMapper; } diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/resteasy/eap/RestApplication.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/resteasy/eap/RestApplication.mustache index 0f9c4b28e86..d68fdfd4adf 100644 --- a/modules/openapi-generator/src/main/resources/JavaJaxRS/resteasy/eap/RestApplication.mustache +++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/resteasy/eap/RestApplication.mustache @@ -13,7 +13,7 @@ import io.swagger.jaxrs.config.BeanConfig; {{#apis}} import {{package}}.impl.{{classname}}ServiceImpl; {{/apis}} -{{/apiInfo}} +{{/apiInfo}} @ApplicationPath("{{{contextPath}}}") public class RestApplication extends Application { @@ -40,12 +40,12 @@ public class RestApplication extends Application { {{#apis}} resources.add({{classname}}ServiceImpl.class); {{/apis}} -{{/apiInfo}} +{{/apiInfo}} -{{#useSwaggerFeature}} +{{#useSwaggerFeature}} resources.add(io.swagger.jaxrs.listing.ApiListingResource.class); resources.add(io.swagger.jaxrs.listing.SwaggerSerializers.class); -{{/useSwaggerFeature}} +{{/useSwaggerFeature}} return resources; } diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/resteasy/eap/allowableValues.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/resteasy/eap/allowableValues.mustache index a48256d027a..75bce9385de 100644 --- a/modules/openapi-generator/src/main/resources/JavaJaxRS/resteasy/eap/allowableValues.mustache +++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/resteasy/eap/allowableValues.mustache @@ -1 +1 @@ -{{#allowableValues}}allowableValues="{{#values}}{{{.}}}{{^-last}}, {{/-last}}{{/values}}{{^values}}range=[{{#min}}{{.}}{{/min}}{{^min}}-infinity{{/min}}, {{#max}}{{.}}{{/max}}{{^max}}infinity{{/max}}]{{/values}}"{{/allowableValues}} \ No newline at end of file +{{#allowableValues}}allowableValues="{{#values}}{{{.}}}{{^-last}}, {{/-last}}{{/values}}{{^values}}range=[{{min}}{{^min}}-infinity{{/min}}, {{max}}{{^max}}infinity{{/max}}]{{/values}}"{{/allowableValues}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/resteasy/eap/api.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/resteasy/eap/api.mustache index e2dfc12d905..db3a8fb3430 100644 --- a/modules/openapi-generator/src/main/resources/JavaJaxRS/resteasy/eap/api.mustache +++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/resteasy/eap/api.mustache @@ -30,13 +30,13 @@ import javax.validation.Valid; {{>generatedAnnotation}} {{#operations}} public interface {{classname}} { - + {{#operation}} @{{httpMethod}} {{#subresourceOperation}}@Path("{{{path}}}"){{/subresourceOperation}} {{#hasConsumes}}@Consumes({ {{#consumes}}"{{{mediaType}}}"{{^-last}}, {{/-last}}{{/consumes}} }){{/hasConsumes}} {{#hasProduces}}@Produces({ {{#produces}}"{{{mediaType}}}"{{^-last}}, {{/-last}}{{/produces}} }){{/hasProduces}} - @io.swagger.annotations.ApiOperation(value = "{{{summary}}}", notes = "{{{notes}}}", response = {{{returnBaseType}}}.class{{#returnContainer}}, responseContainer = "{{{returnContainer}}}"{{/returnContainer}}{{#hasAuthMethods}}, authorizations = { + @io.swagger.annotations.ApiOperation(value = "{{{summary}}}", notes = "{{{notes}}}", response = {{{returnBaseType}}}.class{{#returnContainer}}, responseContainer = "{{{.}}}"{{/returnContainer}}{{#hasAuthMethods}}, authorizations = { {{#authMethods}}@io.swagger.annotations.Authorization(value = "{{name}}"{{#isOAuth}}, scopes = { {{#scopes}}@io.swagger.annotations.AuthorizationScope(scope = "{{scope}}", description = "{{description}}"){{^-last}}, {{/-last}}{{/scopes}} @@ -44,7 +44,7 @@ public interface {{classname}} { {{/-last}}{{/authMethods}} }{{/hasAuthMethods}}, tags={ {{#vendorExtensions.x-tags}}"{{tag}}",{{/vendorExtensions.x-tags}} }) @io.swagger.annotations.ApiResponses(value = { {{#responses}} - @io.swagger.annotations.ApiResponse(code = {{{code}}}, message = "{{{message}}}", response = {{{baseType}}}.class{{#containerType}}, responseContainer = "{{{containerType}}}"{{/containerType}}){{^-last}}, + @io.swagger.annotations.ApiResponse(code = {{{code}}}, message = "{{{message}}}", response = {{{baseType}}}.class{{#containerType}}, responseContainer = "{{{.}}}"{{/containerType}}){{^-last}}, {{/-last}}{{/responses}} }) public Response {{nickname}}({{#isMultipart}}MultipartFormDataInput input,{{/isMultipart}}{{#allParams}}{{>queryParams}}{{>pathParams}}{{>headerParams}}{{>bodyParams}}{{^isMultipart}}{{>formParams}},{{/isMultipart}}{{#isMultipart}}{{^isFormParam}},{{/isFormParam}}{{/isMultipart}}{{/allParams}}@Context SecurityContext securityContext); {{/operation}} diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/resteasy/eap/beanValidationCore.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/resteasy/eap/beanValidationCore.mustache index ae26b2739f1..d6e2f13b457 100644 --- a/modules/openapi-generator/src/main/resources/JavaJaxRS/resteasy/eap/beanValidationCore.mustache +++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/resteasy/eap/beanValidationCore.mustache @@ -1,20 +1,20 @@ -{{#pattern}} @Pattern(regexp="{{{pattern}}}"){{/pattern}}{{! +{{#pattern}} @Pattern(regexp="{{{.}}}"){{/pattern}}{{! minLength && maxLength set }}{{#minLength}}{{#maxLength}} @Size(min={{minLength}},max={{maxLength}}){{/maxLength}}{{/minLength}}{{! minLength set, maxLength not }}{{#minLength}}{{^maxLength}} @Size(min={{minLength}}){{/maxLength}}{{/minLength}}{{! minLength not set, maxLength set -}}{{^minLength}}{{#maxLength}} @Size(max={{maxLength}}){{/maxLength}}{{/minLength}}{{! +}}{{^minLength}}{{#maxLength}} @Size(max={{.}}){{/maxLength}}{{/minLength}}{{! @Size: minItems && maxItems set }}{{#minItems}}{{#maxItems}} @Size(min={{minItems}},max={{maxItems}}){{/maxItems}}{{/minItems}}{{! @Size: minItems set, maxItems not }}{{#minItems}}{{^maxItems}} @Size(min={{minItems}}){{/maxItems}}{{/minItems}}{{! @Size: minItems not set && maxItems set -}}{{^minItems}}{{#maxItems}} @Size(max={{maxItems}}){{/maxItems}}{{/minItems}}{{! +}}{{^minItems}}{{#maxItems}} @Size(max={{.}}){{/maxItems}}{{/minItems}}{{! check for integer or long / all others=decimal type with @Decimal* isInteger set -}}{{#isInteger}}{{#minimum}} @Min({{minimum}}){{/minimum}}{{#maximum}} @Max({{maximum}}){{/maximum}}{{/isInteger}}{{! +}}{{#isInteger}}{{#minimum}} @Min({{.}}){{/minimum}}{{#maximum}} @Max({{.}}){{/maximum}}{{/isInteger}}{{! isLong set -}}{{#isLong}}{{#minimum}} @Min({{minimum}}L){{/minimum}}{{#maximum}} @Max({{maximum}}L){{/maximum}}{{/isLong}}{{! +}}{{#isLong}}{{#minimum}} @Min({{.}}L){{/minimum}}{{#maximum}} @Max({{.}}L){{/maximum}}{{/isLong}}{{! Not Integer, not Long => we have a decimal value! }}{{^isInteger}}{{^isLong}}{{#minimum}} @DecimalMin({{#exclusiveMinimum}}value={{/exclusiveMinimum}}"{{minimum}}"{{#exclusiveMinimum}},inclusive=false{{/exclusiveMinimum}}){{/minimum}}{{#maximum}} @DecimalMax({{#exclusiveMaximum}}value={{/exclusiveMaximum}}"{{maximum}}"{{#exclusiveMaximum}},inclusive=false{{/exclusiveMaximum}}){{/maximum}}{{/isLong}}{{/isInteger}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/resteasy/eap/beanValidationHeaderParams.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/resteasy/eap/beanValidationHeaderParams.mustache index f8eef8f94c7..c4ff01d7e55 100644 --- a/modules/openapi-generator/src/main/resources/JavaJaxRS/resteasy/eap/beanValidationHeaderParams.mustache +++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/resteasy/eap/beanValidationHeaderParams.mustache @@ -1 +1 @@ -{{#required}} @NotNull{{/required}}{{>beanValidationCore}} \ No newline at end of file +{{#required}} @NotNull{{/required}}{{>beanValidationCore}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/resteasy/eap/beanValidationQueryParams.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/resteasy/eap/beanValidationQueryParams.mustache index f8eef8f94c7..c4ff01d7e55 100644 --- a/modules/openapi-generator/src/main/resources/JavaJaxRS/resteasy/eap/beanValidationQueryParams.mustache +++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/resteasy/eap/beanValidationQueryParams.mustache @@ -1 +1 @@ -{{#required}} @NotNull{{/required}}{{>beanValidationCore}} \ No newline at end of file +{{#required}} @NotNull{{/required}}{{>beanValidationCore}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/resteasy/eap/bodyParams.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/resteasy/eap/bodyParams.mustache index eec07e9062d..879b7f2fc0c 100644 --- a/modules/openapi-generator/src/main/resources/JavaJaxRS/resteasy/eap/bodyParams.mustache +++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/resteasy/eap/bodyParams.mustache @@ -1 +1 @@ -{{#isBodyParam}}@ApiParam(value = "{{{description}}}" {{#required}},required=true{{/required}}{{#allowableValues}}, {{> allowableValues }}{{/allowableValues}}{{#defaultValue}}, defaultValue="{{{defaultValue}}}"{{/defaultValue}}){{#useBeanValidation}}{{#required}} @NotNull{{/required}} @Valid{{/useBeanValidation}} {{{dataType}}} {{paramName}}{{/isBodyParam}} \ No newline at end of file +{{#isBodyParam}}@ApiParam(value = "{{{description}}}" {{#required}},required=true{{/required}}{{#allowableValues}}, {{> allowableValues }}{{/allowableValues}}{{#defaultValue}}, defaultValue="{{{.}}}"{{/defaultValue}}){{#useBeanValidation}}{{#required}} @NotNull{{/required}} @Valid{{/useBeanValidation}} {{{dataType}}} {{paramName}}{{/isBodyParam}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/resteasy/eap/enumClass.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/resteasy/eap/enumClass.mustache index 6e41c39177f..5dca420a51c 100644 --- a/modules/openapi-generator/src/main/resources/JavaJaxRS/resteasy/eap/enumClass.mustache +++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/resteasy/eap/enumClass.mustache @@ -1,7 +1,7 @@ /** - * {{^description}}Gets or Sets {{{name}}}{{/description}}{{#description}}{{description}}{{/description}} + * {{description}}{{^description}}Gets or Sets {{{name}}}{{/description}} */ - {{>additionalEnumTypeAnnotations}}public enum {{#datatypeWithEnum}}{{.}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}} { + {{>additionalEnumTypeAnnotations}}public enum {{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}} { {{#allowableValues}} {{#enumVars}} {{{name}}}({{{value}}}){{^-last}}, @@ -12,7 +12,7 @@ {{/allowableValues}} private {{dataType}} value; - {{#datatypeWithEnum}}{{.}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}({{dataType}} value) { + {{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}({{dataType}} value) { this.value = value; } diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/resteasy/eap/formParams.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/resteasy/eap/formParams.mustache index 79d5e482e3d..1d72d944c2f 100644 --- a/modules/openapi-generator/src/main/resources/JavaJaxRS/resteasy/eap/formParams.mustache +++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/resteasy/eap/formParams.mustache @@ -1 +1 @@ -{{#isFormParam}}{{^isFile}}@ApiParam(value = "{{{description}}}"{{#required}}, required=true{{/required}}{{#allowableValues}}, {{> allowableValues }}{{/allowableValues}}{{#defaultValue}}, defaultValue="{{{defaultValue}}}"{{/defaultValue}}) @FormParam("{{baseName}}") {{{dataType}}} {{paramName}}{{/isFile}}{{/isFormParam}} \ No newline at end of file +{{#isFormParam}}{{^isFile}}@ApiParam(value = "{{{description}}}"{{#required}}, required=true{{/required}}{{#allowableValues}}, {{> allowableValues }}{{/allowableValues}}{{#defaultValue}}, defaultValue="{{{.}}}"{{/defaultValue}}) @FormParam("{{baseName}}") {{{dataType}}} {{paramName}}{{/isFile}}{{/isFormParam}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/resteasy/eap/headerParams.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/resteasy/eap/headerParams.mustache index 6dafce8fe79..3e047779034 100644 --- a/modules/openapi-generator/src/main/resources/JavaJaxRS/resteasy/eap/headerParams.mustache +++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/resteasy/eap/headerParams.mustache @@ -1 +1 @@ -{{#isHeaderParam}}{{#useBeanValidation}}{{>beanValidationHeaderParams}}{{/useBeanValidation}} @ApiParam(value = "{{{description}}}" {{#required}},required=true{{/required}}{{#allowableValues}}, {{> allowableValues }}{{/allowableValues}}{{#defaultValue}}, defaultValue="{{{defaultValue}}}"{{/defaultValue}}) @HeaderParam("{{baseName}}") {{{dataType}}} {{paramName}}{{/isHeaderParam}} \ No newline at end of file +{{#isHeaderParam}}{{#useBeanValidation}}{{>beanValidationHeaderParams}}{{/useBeanValidation}} @ApiParam(value = "{{{description}}}" {{#required}},required=true{{/required}}{{#allowableValues}}, {{> allowableValues }}{{/allowableValues}}{{#defaultValue}}, defaultValue="{{{.}}}"{{/defaultValue}}) @HeaderParam("{{baseName}}") {{{dataType}}} {{paramName}}{{/isHeaderParam}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/resteasy/eap/pojo.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/resteasy/eap/pojo.mustache index 343fe1933b1..eaa4f0a0d6a 100644 --- a/modules/openapi-generator/src/main/resources/JavaJaxRS/resteasy/eap/pojo.mustache +++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/resteasy/eap/pojo.mustache @@ -1,7 +1,7 @@ import io.swagger.annotations.*; -{{#description}}@ApiModel(description="{{{description}}}"){{/description}}{{>additionalModelTypeAnnotations}}{{>generatedAnnotation}}{{#discriminator}}{{>typeInfoAnnotation}}{{/discriminator}} -public class {{classname}} {{#parent}}extends {{{parent}}}{{/parent}} {{#serializableModel}}implements Serializable{{/serializableModel}} { +{{#description}}@ApiModel(description="{{{.}}}"){{/description}}{{>additionalModelTypeAnnotations}}{{>generatedAnnotation}}{{#discriminator}}{{>typeInfoAnnotation}}{{/discriminator}} +public class {{classname}} {{#parent}}extends {{{.}}}{{/parent}} {{#serializableModel}}implements Serializable{{/serializableModel}} { {{#serializableModel}} private static final long serialVersionUID = 1L; {{/serializableModel}} @@ -11,22 +11,22 @@ public class {{classname}} {{#parent}}extends {{{parent}}}{{/parent}} {{#seriali {{>enumClass}}{{/mostInnerItems}}{{/isContainer}}{{/isEnum}} - private {{{datatypeWithEnum}}} {{name}}{{#defaultValue}} = {{{defaultValue}}}{{/defaultValue}};{{/vars}} + private {{{datatypeWithEnum}}} {{name}}{{#defaultValue}} = {{{.}}}{{/defaultValue}};{{/vars}} {{#vars}} /** {{#description}} - * {{description}} + * {{.}} {{/description}} {{#minimum}} - * minimum: {{minimum}} + * minimum: {{.}} {{/minimum}} {{#maximum}} - * maximum: {{maximum}} + * maximum: {{.}} {{/maximum}} **/ {{#vendorExtensions.x-extra-annotation}}{{{vendorExtensions.x-extra-annotation}}}{{/vendorExtensions.x-extra-annotation}} - @ApiModelProperty({{#example}}example = "{{{example}}}", {{/example}}{{#required}}required = {{required}}, {{/required}}value = "{{{description}}}") + @ApiModelProperty({{#example}}example = "{{{.}}}", {{/example}}{{#required}}required = {{required}}, {{/required}}value = "{{{description}}}") @JsonProperty("{{baseName}}") {{#useBeanValidation}}{{>beanValidation}}{{/useBeanValidation}} public {{{datatypeWithEnum}}} {{getter}}() { return {{name}}; diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/resteasy/eap/pom.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/resteasy/eap/pom.mustache index 48d331f4aee..6f7f2c24515 100644 --- a/modules/openapi-generator/src/main/resources/JavaJaxRS/resteasy/eap/pom.mustache +++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/resteasy/eap/pom.mustache @@ -166,7 +166,7 @@ 2.9.9 {{/java8}} - + diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/resteasy/eap/queryParams.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/resteasy/eap/queryParams.mustache index 86b8bdf7b5b..88a7eb85a2f 100644 --- a/modules/openapi-generator/src/main/resources/JavaJaxRS/resteasy/eap/queryParams.mustache +++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/resteasy/eap/queryParams.mustache @@ -1 +1 @@ -{{#isQueryParam}}{{#useBeanValidation}}{{>beanValidationQueryParams}}{{/useBeanValidation}}{{^isContainer}}{{#allowableValues}}, {{> allowableValues }}{{/allowableValues}}{{#defaultValue}} @DefaultValue("{{{defaultValue}}}"){{/defaultValue}}{{/isContainer}} @QueryParam("{{baseName}}") {{{dataType}}} {{paramName}}{{/isQueryParam}} \ No newline at end of file +{{#isQueryParam}}{{#useBeanValidation}}{{>beanValidationQueryParams}}{{/useBeanValidation}}{{^isContainer}}{{#allowableValues}}, {{> allowableValues }}{{/allowableValues}}{{#defaultValue}} @DefaultValue("{{{.}}}"){{/defaultValue}}{{/isContainer}} @QueryParam("{{baseName}}") {{{dataType}}} {{paramName}}{{/isQueryParam}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/resteasy/eap/web.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/resteasy/eap/web.mustache index be8e25fc2c6..0a3de16aea9 100644 --- a/modules/openapi-generator/src/main/resources/JavaJaxRS/resteasy/eap/web.mustache +++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/resteasy/eap/web.mustache @@ -2,8 +2,8 @@ - - resteasy.providers + + resteasy.providers {{invokerPackage}}.JacksonConfig diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/resteasy/enumClass.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/resteasy/enumClass.mustache index 6e41c39177f..5dca420a51c 100644 --- a/modules/openapi-generator/src/main/resources/JavaJaxRS/resteasy/enumClass.mustache +++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/resteasy/enumClass.mustache @@ -1,7 +1,7 @@ /** - * {{^description}}Gets or Sets {{{name}}}{{/description}}{{#description}}{{description}}{{/description}} + * {{description}}{{^description}}Gets or Sets {{{name}}}{{/description}} */ - {{>additionalEnumTypeAnnotations}}public enum {{#datatypeWithEnum}}{{.}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}} { + {{>additionalEnumTypeAnnotations}}public enum {{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}} { {{#allowableValues}} {{#enumVars}} {{{name}}}({{{value}}}){{^-last}}, @@ -12,7 +12,7 @@ {{/allowableValues}} private {{dataType}} value; - {{#datatypeWithEnum}}{{.}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}({{dataType}} value) { + {{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}({{dataType}} value) { this.value = value; } diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/resteasy/formParams.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/resteasy/formParams.mustache index 79d5e482e3d..1d72d944c2f 100644 --- a/modules/openapi-generator/src/main/resources/JavaJaxRS/resteasy/formParams.mustache +++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/resteasy/formParams.mustache @@ -1 +1 @@ -{{#isFormParam}}{{^isFile}}@ApiParam(value = "{{{description}}}"{{#required}}, required=true{{/required}}{{#allowableValues}}, {{> allowableValues }}{{/allowableValues}}{{#defaultValue}}, defaultValue="{{{defaultValue}}}"{{/defaultValue}}) @FormParam("{{baseName}}") {{{dataType}}} {{paramName}}{{/isFile}}{{/isFormParam}} \ No newline at end of file +{{#isFormParam}}{{^isFile}}@ApiParam(value = "{{{description}}}"{{#required}}, required=true{{/required}}{{#allowableValues}}, {{> allowableValues }}{{/allowableValues}}{{#defaultValue}}, defaultValue="{{{.}}}"{{/defaultValue}}) @FormParam("{{baseName}}") {{{dataType}}} {{paramName}}{{/isFile}}{{/isFormParam}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/resteasy/headerParams.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/resteasy/headerParams.mustache index 6dafce8fe79..3e047779034 100644 --- a/modules/openapi-generator/src/main/resources/JavaJaxRS/resteasy/headerParams.mustache +++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/resteasy/headerParams.mustache @@ -1 +1 @@ -{{#isHeaderParam}}{{#useBeanValidation}}{{>beanValidationHeaderParams}}{{/useBeanValidation}} @ApiParam(value = "{{{description}}}" {{#required}},required=true{{/required}}{{#allowableValues}}, {{> allowableValues }}{{/allowableValues}}{{#defaultValue}}, defaultValue="{{{defaultValue}}}"{{/defaultValue}}) @HeaderParam("{{baseName}}") {{{dataType}}} {{paramName}}{{/isHeaderParam}} \ No newline at end of file +{{#isHeaderParam}}{{#useBeanValidation}}{{>beanValidationHeaderParams}}{{/useBeanValidation}} @ApiParam(value = "{{{description}}}" {{#required}},required=true{{/required}}{{#allowableValues}}, {{> allowableValues }}{{/allowableValues}}{{#defaultValue}}, defaultValue="{{{.}}}"{{/defaultValue}}) @HeaderParam("{{baseName}}") {{{dataType}}} {{paramName}}{{/isHeaderParam}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/resteasy/pojo.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/resteasy/pojo.mustache index 4478f50ae29..f962101b988 100644 --- a/modules/openapi-generator/src/main/resources/JavaJaxRS/resteasy/pojo.mustache +++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/resteasy/pojo.mustache @@ -1,7 +1,7 @@ import io.swagger.annotations.*; -{{#description}}@ApiModel(description="{{{description}}}"){{/description}}{{>additionalModelTypeAnnotations}}{{>generatedAnnotation}}{{#discriminator}}{{>typeInfoAnnotation}}{{/discriminator}} -public class {{classname}} {{#parent}}extends {{{parent}}}{{/parent}} {{#serializableModel}}implements Serializable{{/serializableModel}} { +{{#description}}@ApiModel(description="{{{.}}}"){{/description}}{{>additionalModelTypeAnnotations}}{{>generatedAnnotation}}{{#discriminator}}{{>typeInfoAnnotation}}{{/discriminator}} +public class {{classname}} {{#parent}}extends {{{.}}}{{/parent}} {{#serializableModel}}implements Serializable{{/serializableModel}} { {{#serializableModel}} private static final long serialVersionUID = 1L; {{/serializableModel}} @@ -10,22 +10,22 @@ public class {{classname}} {{#parent}}extends {{{parent}}}{{/parent}} {{#seriali {{>enumClass}}{{/isContainer}}{{#isContainer}}{{#mostInnerItems}} {{>enumClass}}{{/mostInnerItems}}{{/isContainer}}{{/isEnum}} - private {{{datatypeWithEnum}}} {{name}}{{#defaultValue}} = {{{defaultValue}}}{{/defaultValue}};{{/vars}} + private {{{datatypeWithEnum}}} {{name}}{{#defaultValue}} = {{{.}}}{{/defaultValue}};{{/vars}} {{#vars}} /** {{#description}} - * {{description}} + * {{.}} {{/description}} {{#minimum}} - * minimum: {{minimum}} + * minimum: {{.}} {{/minimum}} {{#maximum}} - * maximum: {{maximum}} + * maximum: {{.}} {{/maximum}} **/ {{#vendorExtensions.x-extra-annotation}}{{{vendorExtensions.x-extra-annotation}}}{{/vendorExtensions.x-extra-annotation}} - @ApiModelProperty({{#example}}example = "{{{example}}}", {{/example}}{{#required}}required = {{required}}, {{/required}}value = "{{{description}}}") + @ApiModelProperty({{#example}}example = "{{{.}}}", {{/example}}{{#required}}required = {{required}}, {{/required}}value = "{{{description}}}") @JsonProperty("{{baseName}}") {{#useBeanValidation}}{{>beanValidation}}{{/useBeanValidation}} public {{{datatypeWithEnum}}} {{getter}}() { return {{name}}; diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/resteasy/pom.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/resteasy/pom.mustache index 997588b8b75..f233909cbd7 100644 --- a/modules/openapi-generator/src/main/resources/JavaJaxRS/resteasy/pom.mustache +++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/resteasy/pom.mustache @@ -184,8 +184,8 @@ 1.1.0.Final provided -{{/useBeanValidation}} - +{{/useBeanValidation}} + diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/resteasy/queryParams.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/resteasy/queryParams.mustache index 86b8bdf7b5b..88a7eb85a2f 100644 --- a/modules/openapi-generator/src/main/resources/JavaJaxRS/resteasy/queryParams.mustache +++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/resteasy/queryParams.mustache @@ -1 +1 @@ -{{#isQueryParam}}{{#useBeanValidation}}{{>beanValidationQueryParams}}{{/useBeanValidation}}{{^isContainer}}{{#allowableValues}}, {{> allowableValues }}{{/allowableValues}}{{#defaultValue}} @DefaultValue("{{{defaultValue}}}"){{/defaultValue}}{{/isContainer}} @QueryParam("{{baseName}}") {{{dataType}}} {{paramName}}{{/isQueryParam}} \ No newline at end of file +{{#isQueryParam}}{{#useBeanValidation}}{{>beanValidationQueryParams}}{{/useBeanValidation}}{{^isContainer}}{{#allowableValues}}, {{> allowableValues }}{{/allowableValues}}{{#defaultValue}} @DefaultValue("{{{.}}}"){{/defaultValue}}{{/isContainer}} @QueryParam("{{baseName}}") {{{dataType}}} {{paramName}}{{/isQueryParam}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/spec/apiInterface.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/spec/apiInterface.mustache index e4bf4e05bfa..0fcf5420c28 100644 --- a/modules/openapi-generator/src/main/resources/JavaJaxRS/spec/apiInterface.mustache +++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/spec/apiInterface.mustache @@ -9,5 +9,5 @@ {{^isOAuth}}@Authorization(value = "{{name}}"){{^-last}},{{/-last}} {{/isOAuth}}{{/authMethods}} }{{/hasAuthMethods}}, tags={ {{#vendorExtensions.x-tags}}"{{tag}}"{{^-last}}, {{/-last}}{{/vendorExtensions.x-tags}} }) @ApiResponses(value = { {{#responses}} - @ApiResponse(code = {{{code}}}, message = "{{{message}}}", response = {{{baseType}}}.class{{#returnContainer}}, responseContainer = "{{{returnContainer}}}"{{/returnContainer}}){{^-last}},{{/-last}}{{/responses}} }){{/useSwaggerAnnotations}} + @ApiResponse(code = {{{code}}}, message = "{{{message}}}", response = {{{baseType}}}.class{{#returnContainer}}, responseContainer = "{{{.}}}"{{/returnContainer}}){{^-last}},{{/-last}}{{/responses}} }){{/useSwaggerAnnotations}} {{#returnResponse}}Response{{/returnResponse}}{{^returnResponse}}{{>returnTypeInterface}}{{/returnResponse}} {{nickname}}({{#allParams}}{{>queryParams}}{{>pathParams}}{{>headerParams}}{{>bodyParams}}{{>formParams}}{{^-last}},{{/-last}}{{/allParams}}); \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/spec/apiMethod.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/spec/apiMethod.mustache index 09db050cd76..d6c4ae7c82c 100644 --- a/modules/openapi-generator/src/main/resources/JavaJaxRS/spec/apiMethod.mustache +++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/spec/apiMethod.mustache @@ -2,14 +2,14 @@ @Path("{{{path}}}"){{/subresourceOperation}}{{#hasConsumes}} @Consumes({ {{#consumes}}"{{{mediaType}}}"{{^-last}}, {{/-last}}{{/consumes}} }){{/hasConsumes}}{{#hasProduces}} @Produces({ {{#produces}}"{{{mediaType}}}"{{^-last}}, {{/-last}}{{/produces}} }){{/hasProduces}}{{#useSwaggerAnnotations}} - @ApiOperation(value = "{{{summary}}}", notes = "{{{notes}}}", response = {{{returnBaseType}}}.class{{#returnContainer}}, responseContainer = "{{{returnContainer}}}"{{/returnContainer}}{{#hasAuthMethods}}, authorizations = { + @ApiOperation(value = "{{{summary}}}", notes = "{{{notes}}}", response = {{{returnBaseType}}}.class{{#returnContainer}}, responseContainer = "{{{.}}}"{{/returnContainer}}{{#hasAuthMethods}}, authorizations = { {{#authMethods}}{{#isOAuth}}@Authorization(value = "{{name}}", scopes = { {{#scopes}}@AuthorizationScope(scope = "{{scope}}", description = "{{description}}"){{^-last}}, {{/-last}}{{/scopes}} }){{^-last}},{{/-last}}{{/isOAuth}} {{^isOAuth}}@Authorization(value = "{{name}}"){{^-last}},{{/-last}} {{/isOAuth}}{{/authMethods}} }{{/hasAuthMethods}}, tags={ {{#vendorExtensions.x-tags}}"{{tag}}"{{^-last}}, {{/-last}}{{/vendorExtensions.x-tags}} }) @ApiResponses(value = { {{#responses}} - @ApiResponse(code = {{{code}}}, message = "{{{message}}}", response = {{{baseType}}}.class{{#containerType}}, responseContainer = "{{{containerType}}}"{{/containerType}}){{^-last}},{{/-last}}{{/responses}} + @ApiResponse(code = {{{code}}}, message = "{{{message}}}", response = {{{baseType}}}.class{{#containerType}}, responseContainer = "{{{.}}}"{{/containerType}}){{^-last}},{{/-last}}{{/responses}} }){{/useSwaggerAnnotations}} public Response {{nickname}}({{#allParams}}{{>queryParams}}{{>pathParams}}{{>cookieParams}}{{>headerParams}}{{>bodyParams}}{{>formParams}}{{^-last}},{{/-last}}{{/allParams}}) { return Response.ok().entity("magic!").build(); diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/spec/beanValidationCore.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/spec/beanValidationCore.mustache index ae26b2739f1..d6e2f13b457 100644 --- a/modules/openapi-generator/src/main/resources/JavaJaxRS/spec/beanValidationCore.mustache +++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/spec/beanValidationCore.mustache @@ -1,20 +1,20 @@ -{{#pattern}} @Pattern(regexp="{{{pattern}}}"){{/pattern}}{{! +{{#pattern}} @Pattern(regexp="{{{.}}}"){{/pattern}}{{! minLength && maxLength set }}{{#minLength}}{{#maxLength}} @Size(min={{minLength}},max={{maxLength}}){{/maxLength}}{{/minLength}}{{! minLength set, maxLength not }}{{#minLength}}{{^maxLength}} @Size(min={{minLength}}){{/maxLength}}{{/minLength}}{{! minLength not set, maxLength set -}}{{^minLength}}{{#maxLength}} @Size(max={{maxLength}}){{/maxLength}}{{/minLength}}{{! +}}{{^minLength}}{{#maxLength}} @Size(max={{.}}){{/maxLength}}{{/minLength}}{{! @Size: minItems && maxItems set }}{{#minItems}}{{#maxItems}} @Size(min={{minItems}},max={{maxItems}}){{/maxItems}}{{/minItems}}{{! @Size: minItems set, maxItems not }}{{#minItems}}{{^maxItems}} @Size(min={{minItems}}){{/maxItems}}{{/minItems}}{{! @Size: minItems not set && maxItems set -}}{{^minItems}}{{#maxItems}} @Size(max={{maxItems}}){{/maxItems}}{{/minItems}}{{! +}}{{^minItems}}{{#maxItems}} @Size(max={{.}}){{/maxItems}}{{/minItems}}{{! check for integer or long / all others=decimal type with @Decimal* isInteger set -}}{{#isInteger}}{{#minimum}} @Min({{minimum}}){{/minimum}}{{#maximum}} @Max({{maximum}}){{/maximum}}{{/isInteger}}{{! +}}{{#isInteger}}{{#minimum}} @Min({{.}}){{/minimum}}{{#maximum}} @Max({{.}}){{/maximum}}{{/isInteger}}{{! isLong set -}}{{#isLong}}{{#minimum}} @Min({{minimum}}L){{/minimum}}{{#maximum}} @Max({{maximum}}L){{/maximum}}{{/isLong}}{{! +}}{{#isLong}}{{#minimum}} @Min({{.}}L){{/minimum}}{{#maximum}} @Max({{.}}L){{/maximum}}{{/isLong}}{{! Not Integer, not Long => we have a decimal value! }}{{^isInteger}}{{^isLong}}{{#minimum}} @DecimalMin({{#exclusiveMinimum}}value={{/exclusiveMinimum}}"{{minimum}}"{{#exclusiveMinimum}},inclusive=false{{/exclusiveMinimum}}){{/minimum}}{{#maximum}} @DecimalMax({{#exclusiveMaximum}}value={{/exclusiveMaximum}}"{{maximum}}"{{#exclusiveMaximum}},inclusive=false{{/exclusiveMaximum}}){{/maximum}}{{/isLong}}{{/isInteger}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/spec/beanValidationHeaderParams.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/spec/beanValidationHeaderParams.mustache index f8eef8f94c7..c4ff01d7e55 100644 --- a/modules/openapi-generator/src/main/resources/JavaJaxRS/spec/beanValidationHeaderParams.mustache +++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/spec/beanValidationHeaderParams.mustache @@ -1 +1 @@ -{{#required}} @NotNull{{/required}}{{>beanValidationCore}} \ No newline at end of file +{{#required}} @NotNull{{/required}}{{>beanValidationCore}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/spec/beanValidationQueryParams.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/spec/beanValidationQueryParams.mustache index f8eef8f94c7..c4ff01d7e55 100644 --- a/modules/openapi-generator/src/main/resources/JavaJaxRS/spec/beanValidationQueryParams.mustache +++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/spec/beanValidationQueryParams.mustache @@ -1 +1 @@ -{{#required}} @NotNull{{/required}}{{>beanValidationCore}} \ No newline at end of file +{{#required}} @NotNull{{/required}}{{>beanValidationCore}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/spec/cookieParams.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/spec/cookieParams.mustache index 71dbe46aba2..0d015d6cf68 100644 --- a/modules/openapi-generator/src/main/resources/JavaJaxRS/spec/cookieParams.mustache +++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/spec/cookieParams.mustache @@ -1 +1 @@ -{{#isCookieParam}}@CookieParam("{{baseName}}"){{#useBeanValidation}}{{>beanValidationQueryParams}}{{/useBeanValidation}}{{^isContainer}}{{#defaultValue}} @DefaultValue("{{{defaultValue}}}"){{/defaultValue}}{{/isContainer}} {{#useSwaggerAnnotations}}{{#description}} @ApiParam("{{description}}"){{/description}}{{/useSwaggerAnnotations}} {{{dataType}}} {{paramName}}{{/isCookieParam}} \ No newline at end of file +{{#isCookieParam}}@CookieParam("{{baseName}}"){{#useBeanValidation}}{{>beanValidationQueryParams}}{{/useBeanValidation}}{{^isContainer}}{{#defaultValue}} @DefaultValue("{{{.}}}"){{/defaultValue}}{{/isContainer}} {{#useSwaggerAnnotations}}{{#description}} @ApiParam("{{.}}"){{/description}}{{/useSwaggerAnnotations}} {{{dataType}}} {{paramName}}{{/isCookieParam}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/spec/enumClass.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/spec/enumClass.mustache index 9a4bb71d9d7..4b111457153 100644 --- a/modules/openapi-generator/src/main/resources/JavaJaxRS/spec/enumClass.mustache +++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/spec/enumClass.mustache @@ -23,7 +23,7 @@ @JsonCreator public static {{datatypeWithEnum}} fromValue({{dataType}} value) { - for ({{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} b : {{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}}.values()) { + for ({{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} b : {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}}.values()) { if (b.value.equals(value)) { return b; } diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/spec/enumOuterClass.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/spec/enumOuterClass.mustache index dd9020ea9b8..66f6745ff9f 100644 --- a/modules/openapi-generator/src/main/resources/JavaJaxRS/spec/enumOuterClass.mustache +++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/spec/enumOuterClass.mustache @@ -4,9 +4,9 @@ import com.fasterxml.jackson.annotation.JsonValue; {{/jackson}} /** - * {{^description}}Gets or Sets {{{name}}}{{/description}}{{#description}}{{description}}{{/description}} + * {{description}}{{^description}}Gets or Sets {{{name}}}{{/description}} */ -{{>additionalEnumTypeAnnotations}}public enum {{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} { +{{>additionalEnumTypeAnnotations}}public enum {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} { {{#gson}} {{#allowableValues}}{{#enumVars}} @SerializedName({{#isInteger}}"{{/isInteger}}{{#isDouble}}"{{/isDouble}}{{#isLong}}"{{/isLong}}{{#isFloat}}"{{/isFloat}}{{{value}}}{{#isInteger}}"{{/isInteger}}{{#isDouble}}"{{/isDouble}}{{#isLong}}"{{/isLong}}{{#isFloat}}"{{/isFloat}}) @@ -21,7 +21,7 @@ import com.fasterxml.jackson.annotation.JsonValue; private {{{dataType}}} value; - {{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}}({{{dataType}}} value) { + {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}}({{{dataType}}} value) { this.value = value; } @@ -32,8 +32,8 @@ import com.fasterxml.jackson.annotation.JsonValue; } @JsonCreator - public static {{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} fromValue({{{dataType}}} value) { - for ({{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} b : {{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}}.values()) { + public static {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} fromValue({{{dataType}}} value) { + for ({{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} b : {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}}.values()) { if (b.value.equals(value)) { return b; } diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/spec/headerParams.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/spec/headerParams.mustache index 77f98a04934..4f978d3c36b 100644 --- a/modules/openapi-generator/src/main/resources/JavaJaxRS/spec/headerParams.mustache +++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/spec/headerParams.mustache @@ -1 +1 @@ -{{#isHeaderParam}}@HeaderParam("{{baseName}}"){{#useBeanValidation}}{{>beanValidationHeaderParams}}{{/useBeanValidation}} {{#defaultValue}} @DefaultValue("{{{defaultValue}}}"){{/defaultValue}} {{#useSwaggerAnnotations}}{{#description}} @ApiParam("{{description}}"){{/description}}{{/useSwaggerAnnotations}} {{{dataType}}} {{paramName}}{{/isHeaderParam}} \ No newline at end of file +{{#isHeaderParam}}@HeaderParam("{{baseName}}"){{#useBeanValidation}}{{>beanValidationHeaderParams}}{{/useBeanValidation}} {{#defaultValue}} @DefaultValue("{{{.}}}"){{/defaultValue}} {{#useSwaggerAnnotations}}{{#description}} @ApiParam("{{.}}"){{/description}}{{/useSwaggerAnnotations}} {{{dataType}}} {{paramName}}{{/isHeaderParam}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/spec/libraries/helidon/README.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/spec/libraries/helidon/README.mustache index 1f328b17165..d7982e6e6a6 100644 --- a/modules/openapi-generator/src/main/resources/JavaJaxRS/spec/libraries/helidon/README.mustache +++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/spec/libraries/helidon/README.mustache @@ -5,7 +5,7 @@ This server was generated by the [OpenAPI Generator](https://openapi-generator.t [OpenAPI-Spec](https://openapis.org), you can easily generate a server stub. This is an example of building a OpenAPI-enabled JAX-RS server. -This example uses the [JAX-RS](https://jax-rs-spec.java.net/) framework and +This example uses the [JAX-RS](https://jax-rs-spec.java.net/) framework and the [Eclipse-MicroProfile-OpenAPI](https://github.com/eclipse/microprofile-open-api) addition. The pom file is configured to use [Helidon](https://helidon.io/) as application server. diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/spec/libraries/openliberty/MANIFEST.MF.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/spec/libraries/openliberty/MANIFEST.MF.mustache index e3c07ab38a4..65b9fe16a69 100644 --- a/modules/openapi-generator/src/main/resources/JavaJaxRS/spec/libraries/openliberty/MANIFEST.MF.mustache +++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/spec/libraries/openliberty/MANIFEST.MF.mustache @@ -1,2 +1,2 @@ Manifest-Version: 1.0 -Class-Path: +Class-Path: diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/spec/libraries/openliberty/README.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/spec/libraries/openliberty/README.mustache index f3389b0ef03..21a76d82710 100644 --- a/modules/openapi-generator/src/main/resources/JavaJaxRS/spec/libraries/openliberty/README.mustache +++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/spec/libraries/openliberty/README.mustache @@ -5,7 +5,7 @@ This server was generated by the [OpenAPI Generator](https://openapi-generator.t [OpenAPI-Spec](https://openapis.org), you can easily generate a server stub. This is an example of building a OpenAPI-enabled JAX-RS server. -This example uses the [JAX-RS](https://jax-rs-spec.java.net/) framework and +This example uses the [JAX-RS](https://jax-rs-spec.java.net/) framework and the [Eclipse-MicroProfile-OpenAPI](https://github.com/eclipse/microprofile-open-api) addition. The pom file is configured to use [Open Liberty](https://openliberty.io/) as application server. diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/spec/libraries/openliberty/server.xml.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/spec/libraries/openliberty/server.xml.mustache index 176088c512d..d765cfbdc77 100644 --- a/modules/openapi-generator/src/main/resources/JavaJaxRS/spec/libraries/openliberty/server.xml.mustache +++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/spec/libraries/openliberty/server.xml.mustache @@ -10,10 +10,10 @@ - + - + \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/spec/libraries/quarkus/README.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/spec/libraries/quarkus/README.mustache index 90433afce82..6c5ef2f11dd 100644 --- a/modules/openapi-generator/src/main/resources/JavaJaxRS/spec/libraries/quarkus/README.mustache +++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/spec/libraries/quarkus/README.mustache @@ -5,7 +5,7 @@ This server was generated by the [OpenAPI Generator](https://openapi-generator.t [OpenAPI-Spec](https://openapis.org), you can easily generate a server stub. This is an example of building a OpenAPI-enabled JAX-RS server. -This example uses the [JAX-RS](https://jax-rs-spec.java.net/) framework and +This example uses the [JAX-RS](https://jax-rs-spec.java.net/) framework and the [Eclipse-MicroProfile-OpenAPI](https://github.com/eclipse/microprofile-open-api) addition. The pom file is configured to use [Quarkus](https://quarkus.io/) as application server. diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/spec/libraries/thorntail/README.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/spec/libraries/thorntail/README.mustache index 64d4830d4b8..66e31f3b0c7 100644 --- a/modules/openapi-generator/src/main/resources/JavaJaxRS/spec/libraries/thorntail/README.mustache +++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/spec/libraries/thorntail/README.mustache @@ -5,7 +5,7 @@ This server was generated by the [OpenAPI Generator](https://openapi-generator.t [OpenAPI-Spec](https://openapis.org), you can easily generate a server stub. This is an example of building a OpenAPI-enabled JAX-RS server. -This example uses the [JAX-RS](https://jax-rs-spec.java.net/) framework and +This example uses the [JAX-RS](https://jax-rs-spec.java.net/) framework and the [Eclipse-MicroProfile-OpenAPI](https://github.com/eclipse/microprofile-open-api) addition. The pom file is configured to use [Thorntail](https://thorntail.io) as application server. diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/spec/pathParams.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/spec/pathParams.mustache index 5c3d731f838..922e107830c 100644 --- a/modules/openapi-generator/src/main/resources/JavaJaxRS/spec/pathParams.mustache +++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/spec/pathParams.mustache @@ -1 +1 @@ -{{#isPathParam}}@PathParam("{{baseName}}"){{#useBeanValidation}}{{>beanValidationPathParams}}{{/useBeanValidation}}{{#useSwaggerAnnotations}}{{#description}} @ApiParam("{{description}}"){{/description}}{{/useSwaggerAnnotations}} {{{dataType}}} {{paramName}}{{/isPathParam}} \ No newline at end of file +{{#isPathParam}}@PathParam("{{baseName}}"){{#useBeanValidation}}{{>beanValidationPathParams}}{{/useBeanValidation}}{{#useSwaggerAnnotations}}{{#description}} @ApiParam("{{.}}"){{/description}}{{/useSwaggerAnnotations}} {{{dataType}}} {{paramName}}{{/isPathParam}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/spec/pojo.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/spec/pojo.mustache index 90430584ba7..5e008a5de88 100644 --- a/modules/openapi-generator/src/main/resources/JavaJaxRS/spec/pojo.mustache +++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/spec/pojo.mustache @@ -7,26 +7,26 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; {{#discriminator}}{{>typeInfoAnnotation}}{{/discriminator}}{{#description}}/** - * {{description}} + * {{.}} **/{{/description}} -{{#useSwaggerAnnotations}}{{#description}}@ApiModel(description = "{{{description}}}"){{/description}}{{/useSwaggerAnnotations}} -{{>generatedAnnotation}}{{>additionalModelTypeAnnotations}}public class {{classname}} {{#parent}}extends {{{parent}}}{{/parent}} {{#serializableModel}}implements Serializable{{/serializableModel}} { +{{#useSwaggerAnnotations}}{{#description}}@ApiModel(description = "{{{.}}}"){{/description}}{{/useSwaggerAnnotations}} +{{>generatedAnnotation}}{{>additionalModelTypeAnnotations}}public class {{classname}} {{#parent}}extends {{{.}}}{{/parent}} {{#serializableModel}}implements Serializable{{/serializableModel}} { {{#vars}}{{#isEnum}}{{^isContainer}} {{>enumClass}}{{/isContainer}}{{#isContainer}}{{#mostInnerItems}} - + {{>enumClass}}{{/mostInnerItems}}{{/isContainer}}{{/isEnum}} private {{#useBeanValidation}}@Valid {{/useBeanValidation}}{{{datatypeWithEnum}}} {{name}}{{#defaultValue}} = {{{.}}}{{/defaultValue}};{{/vars}} {{#vars}}/** {{#description}} - * {{description}} + * {{.}} {{/description}} {{#minimum}} - * minimum: {{minimum}} + * minimum: {{.}} {{/minimum}} {{#maximum}} - * maximum: {{maximum}} + * maximum: {{.}} {{/maximum}} **/ public {{classname}} {{name}}({{{datatypeWithEnum}}} {{name}}) { @@ -41,7 +41,7 @@ import com.fasterxml.jackson.annotation.JsonValue; }{{/generateBuilders}} {{#vendorExtensions.x-extra-annotation}}{{{vendorExtensions.x-extra-annotation}}}{{/vendorExtensions.x-extra-annotation}}{{#useSwaggerAnnotations}} - @ApiModelProperty({{#example}}example = "{{{example}}}", {{/example}}{{#required}}required = {{required}}, {{/required}}value = "{{{description}}}"){{/useSwaggerAnnotations}} + @ApiModelProperty({{#example}}example = "{{{.}}}", {{/example}}{{#required}}required = {{required}}, {{/required}}value = "{{{description}}}"){{/useSwaggerAnnotations}} @JsonProperty("{{baseName}}") {{#useBeanValidation}}{{>beanValidation}}{{/useBeanValidation}} public {{{datatypeWithEnum}}} {{getter}}() { return {{name}}; @@ -143,13 +143,13 @@ import com.fasterxml.jackson.annotation.JsonValue; {{#vars}} /** {{#description}} - * {{description}} + * {{.}} {{/description}} {{#minimum}} - * minimum: {{minimum}} + * minimum: {{.}} {{/minimum}} {{#maximum}} - * maximum: {{maximum}} + * maximum: {{.}} {{/maximum}} **/ public Builder {{name}}({{{datatypeWithEnum}}} {{name}}) { diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/spec/queryParams.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/spec/queryParams.mustache index 198098046c0..31ea97fd350 100644 --- a/modules/openapi-generator/src/main/resources/JavaJaxRS/spec/queryParams.mustache +++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/spec/queryParams.mustache @@ -1 +1 @@ -{{#isQueryParam}}@QueryParam("{{baseName}}"){{#useBeanValidation}}{{>beanValidationQueryParams}}{{/useBeanValidation}}{{^isContainer}}{{#defaultValue}} @DefaultValue("{{{defaultValue}}}"){{/defaultValue}}{{/isContainer}} {{#useSwaggerAnnotations}}{{#description}} @ApiParam("{{description}}"){{/description}}{{/useSwaggerAnnotations}} {{{dataType}}} {{paramName}}{{/isQueryParam}} \ No newline at end of file +{{#isQueryParam}}@QueryParam("{{baseName}}"){{#useBeanValidation}}{{>beanValidationQueryParams}}{{/useBeanValidation}}{{^isContainer}}{{#defaultValue}} @DefaultValue("{{{.}}}"){{/defaultValue}}{{/isContainer}} {{#useSwaggerAnnotations}}{{#description}} @ApiParam("{{.}}"){{/description}}{{/useSwaggerAnnotations}} {{{dataType}}} {{paramName}}{{/isQueryParam}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/JavaPlayFramework/beanValidation.mustache b/modules/openapi-generator/src/main/resources/JavaPlayFramework/beanValidation.mustache index 978069fbeec..2e510dc091b 100644 --- a/modules/openapi-generator/src/main/resources/JavaPlayFramework/beanValidation.mustache +++ b/modules/openapi-generator/src/main/resources/JavaPlayFramework/beanValidation.mustache @@ -2,7 +2,7 @@ @NotNull {{/required}} {{#pattern}} -@Pattern(regexp="{{{pattern}}}") +@Pattern(regexp="{{{.}}}") {{/pattern}} {{#minLength}} {{#maxLength}} @@ -16,7 +16,7 @@ {{/minLength}} {{^minLength}} {{#maxLength}} -@Size(max={{maxLength}}) +@Size(max={{.}}) {{/maxLength}} {{/minLength}} {{#minItems}} @@ -31,24 +31,24 @@ {{/minItems}} {{^minItems}} {{#maxItems}} -@Size(max={{maxItems}}) +@Size(max={{.}}) {{/maxItems}} {{/minItems}} {{! check for integer / number=decimal type}} {{#isInteger}} {{#minimum}} -@Min({{minimum}}) +@Min({{.}}) {{/minimum}} {{#maximum}} -@Max({{maximum}}) +@Max({{.}}) {{/maximum}} {{/isInteger}} {{^isInteger}} {{#minimum}} -@DecimalMin("{{minimum}}") +@DecimalMin("{{.}}") {{/minimum}} {{#maximum}} -@DecimalMax("{{maximum}}") +@DecimalMax("{{.}}") {{/maximum}} {{/isInteger}} {{^isPrimitiveType}} diff --git a/modules/openapi-generator/src/main/resources/JavaPlayFramework/beanValidationCore.mustache b/modules/openapi-generator/src/main/resources/JavaPlayFramework/beanValidationCore.mustache index cf3c47f906e..56f6eb83669 100644 --- a/modules/openapi-generator/src/main/resources/JavaPlayFramework/beanValidationCore.mustache +++ b/modules/openapi-generator/src/main/resources/JavaPlayFramework/beanValidationCore.mustache @@ -1 +1 @@ -{{#pattern}}{{^isByteArray}} @Pattern(regexp="{{{pattern}}}"){{/isByteArray}}{{/pattern}}{{#minLength}}{{#maxLength}} @Size(min={{minLength}},max={{maxLength}}){{/maxLength}}{{/minLength}}{{#minLength}}{{^maxLength}} @Size(min={{minLength}}){{/maxLength}}{{/minLength}}{{^minLength}}{{#maxLength}} @Size(max={{maxLength}}){{/maxLength}}{{/minLength}}{{#minItems}}{{#maxItems}} @Size(min={{minItems}},max={{maxItems}}){{/maxItems}}{{/minItems}}{{#minItems}}{{^maxItems}} @Size(min={{minItems}}){{/maxItems}}{{/minItems}}{{^minItems}}{{#maxItems}} @Size(max={{maxItems}}){{/maxItems}}{{/minItems}}{{#minimum}} @Min({{minimum}}){{/minimum}}{{#maximum}} @Max({{maximum}}){{/maximum}} \ No newline at end of file +{{#pattern}}{{^isByteArray}} @Pattern(regexp="{{{pattern}}}"){{/isByteArray}}{{/pattern}}{{#minLength}}{{#maxLength}} @Size(min={{minLength}},max={{maxLength}}){{/maxLength}}{{/minLength}}{{#minLength}}{{^maxLength}} @Size(min={{minLength}}){{/maxLength}}{{/minLength}}{{^minLength}}{{#maxLength}} @Size(max={{.}}){{/maxLength}}{{/minLength}}{{#minItems}}{{#maxItems}} @Size(min={{minItems}},max={{maxItems}}){{/maxItems}}{{/minItems}}{{#minItems}}{{^maxItems}} @Size(min={{minItems}}){{/maxItems}}{{/minItems}}{{^minItems}}{{#maxItems}} @Size(max={{.}}){{/maxItems}}{{/minItems}}{{#minimum}} @Min({{.}}){{/minimum}}{{#maximum}} @Max({{.}}){{/maximum}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/JavaPlayFramework/conversionBegin.mustache b/modules/openapi-generator/src/main/resources/JavaPlayFramework/conversionBegin.mustache index 19954287202..a8239f5868c 100644 --- a/modules/openapi-generator/src/main/resources/JavaPlayFramework/conversionBegin.mustache +++ b/modules/openapi-generator/src/main/resources/JavaPlayFramework/conversionBegin.mustache @@ -1 +1 @@ -{{#isBoolean}}Boolean.valueOf({{/isBoolean}}{{#isInteger}}Integer.parseInt({{/isInteger}}{{#isDouble}}Double.parseDouble({{/isDouble}}{{#isLong}}Long.parseLong({{/isLong}}{{#isFloat}}Float.parseFloat({{/isFloat}}{{#isUuid}}UUID.fromString({{/isUuid}}{{#isDateTime}}OffsetDateTime.parse({{/isDateTime}}{{#isDate}}LocalDate.parse({{/isDate}}{{#isByteArray}}{{/isByteArray}}{{#isNumber}}new BigDecimal({{/isNumber}} \ No newline at end of file +{{#isBoolean}}Boolean.valueOf({{/isBoolean}}{{#isInteger}}Integer.parseInt({{/isInteger}}{{#isDouble}}Double.parseDouble({{/isDouble}}{{#isLong}}Long.parseLong({{/isLong}}{{#isFloat}}Float.parseFloat({{/isFloat}}{{#isUuid}}UUID.fromString({{/isUuid}}{{#isDateTime}}OffsetDateTime.parse({{/isDateTime}}{{#isDate}}LocalDate.parse({{/isDate}}{{#isNumber}}new BigDecimal({{/isNumber}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/JavaPlayFramework/enumClass.mustache b/modules/openapi-generator/src/main/resources/JavaPlayFramework/enumClass.mustache index 0e53213ed49..6afccd29a23 100644 --- a/modules/openapi-generator/src/main/resources/JavaPlayFramework/enumClass.mustache +++ b/modules/openapi-generator/src/main/resources/JavaPlayFramework/enumClass.mustache @@ -1,7 +1,7 @@ /** - * {{^description}}Gets or Sets {{{name}}}{{/description}}{{#description}}{{{description}}}{{/description}} + * {{^description}}Gets or Sets {{{name}}}{{/description}}{{{description}}} */ - {{>additionalEnumTypeAnnotations}}public enum {{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}} { + {{>additionalEnumTypeAnnotations}}public enum {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}} { {{#gson}} {{#allowableValues}} {{#enumVars}} @@ -22,7 +22,7 @@ private final {{{dataType}}} value; - {{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}({{{dataType}}} value) { + {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}({{{dataType}}} value) { this.value = value; } @@ -33,8 +33,8 @@ } @JsonCreator - public static {{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} fromValue({{{dataType}}} value) { - for ({{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} b : {{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}}.values()) { + public static {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} fromValue({{{dataType}}} value) { + for ({{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} b : {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}}.values()) { if (b.value.equals(value)) { return b; } diff --git a/modules/openapi-generator/src/main/resources/JavaPlayFramework/enumOuterClass.mustache b/modules/openapi-generator/src/main/resources/JavaPlayFramework/enumOuterClass.mustache index 29e50e1b428..9ffcc2ddcac 100644 --- a/modules/openapi-generator/src/main/resources/JavaPlayFramework/enumOuterClass.mustache +++ b/modules/openapi-generator/src/main/resources/JavaPlayFramework/enumOuterClass.mustache @@ -3,9 +3,9 @@ import com.fasterxml.jackson.annotation.JsonCreator; {{/jackson}} /** - * {{^description}}Gets or Sets {{{name}}}{{/description}}{{#description}}{{{description}}}{{/description}} + * {{^description}}Gets or Sets {{{name}}}{{/description}}{{{description}}} */ -{{>additionalEnumTypeAnnotations}}public enum {{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} { +{{>additionalEnumTypeAnnotations}}public enum {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} { {{#gson}} {{#allowableValues}}{{#enumVars}} @SerializedName({{#isInteger}}"{{/isInteger}}{{#isDouble}}"{{/isDouble}}{{#isLong}}"{{/isLong}}{{#isFloat}}"{{/isFloat}}{{{value}}}{{#isInteger}}"{{/isInteger}}{{#isDouble}}"{{/isDouble}}{{#isLong}}"{{/isLong}}{{#isFloat}}"{{/isFloat}}) @@ -20,7 +20,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; private final {{{dataType}}} value; - {{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}}({{{dataType}}} value) { + {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}}({{{dataType}}} value) { this.value = value; } @@ -31,8 +31,8 @@ import com.fasterxml.jackson.annotation.JsonCreator; } @JsonCreator - public static {{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} fromValue({{{dataType}}} value) { - for ({{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} b : {{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}}.values()) { + public static {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} fromValue({{{dataType}}} value) { + for ({{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} b : {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}}.values()) { if (b.value.equals(value)) { return b; } diff --git a/modules/openapi-generator/src/main/resources/JavaPlayFramework/itemConversionBegin.mustache b/modules/openapi-generator/src/main/resources/JavaPlayFramework/itemConversionBegin.mustache index 42b024ec340..83ec7d22210 100644 --- a/modules/openapi-generator/src/main/resources/JavaPlayFramework/itemConversionBegin.mustache +++ b/modules/openapi-generator/src/main/resources/JavaPlayFramework/itemConversionBegin.mustache @@ -1 +1 @@ -{{#items.isBoolean}}Boolean.valueOf({{/items.isBoolean}}{{#items.isInteger}}Integer.parseInt({{/items.isInteger}}{{#items.isDouble}}Double.parseDouble({{/items.isDouble}}{{#items.isLong}}Long.parseLong({{/items.isLong}}{{#items.isFloat}}Float.parseFloat({{/items.isFloat}}{{#items.isUuid}}UUID.fromString({{/items.isUuid}}{{#items.isDateTime}}OffsetDateTime.parse({{/items.isDateTime}}{{#items.isDate}}LocalDate.parse({{/items.isDate}}{{#isByteArray}}{{/isByteArray}}{{#isNumber}}new BigDecimal({{/isNumber}} \ No newline at end of file +{{#items.isBoolean}}Boolean.valueOf({{/items.isBoolean}}{{#items.isInteger}}Integer.parseInt({{/items.isInteger}}{{#items.isDouble}}Double.parseDouble({{/items.isDouble}}{{#items.isLong}}Long.parseLong({{/items.isLong}}{{#items.isFloat}}Float.parseFloat({{/items.isFloat}}{{#items.isUuid}}UUID.fromString({{/items.isUuid}}{{#items.isDateTime}}OffsetDateTime.parse({{/items.isDateTime}}{{#items.isDate}}LocalDate.parse({{/items.isDate}}{{#isNumber}}new BigDecimal({{/isNumber}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/JavaPlayFramework/pojo.mustache b/modules/openapi-generator/src/main/resources/JavaPlayFramework/pojo.mustache index d25b2b8be69..f96ed1ee9a4 100644 --- a/modules/openapi-generator/src/main/resources/JavaPlayFramework/pojo.mustache +++ b/modules/openapi-generator/src/main/resources/JavaPlayFramework/pojo.mustache @@ -3,11 +3,11 @@ import java.util.Objects; import javax.validation.constraints.*; {{/useBeanValidation}} /** - * {{#description}}{{.}}{{/description}}{{^description}}{{classname}}{{/description}} + * {{description}}{{^description}}{{classname}}{{/description}} */ {{>additionalModelTypeAnnotations}}{{>generatedAnnotation}} @SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) -public class {{classname}} {{#parent}}extends {{{parent}}}{{/parent}} {{#serializableModel}}implements Serializable{{/serializableModel}} { +public class {{classname}} {{#parent}}extends {{{.}}}{{/parent}} {{#serializableModel}}implements Serializable{{/serializableModel}} { {{#vars}} {{#isEnum}} {{^isContainer}} @@ -15,7 +15,7 @@ public class {{classname}} {{#parent}}extends {{{parent}}}{{/parent}} {{#seriali {{/isContainer}} {{#isContainer}} {{#mostInnerItems}} -{{>enumClass}} +{{>enumClass}} {{/mostInnerItems}} {{/isContainer}} {{/isEnum}} @@ -71,16 +71,16 @@ public class {{classname}} {{#parent}}extends {{{parent}}}{{/parent}} {{#seriali /** {{#description}} - * {{{description}}} + * {{{.}}} {{/description}} {{^description}} * Get {{name}} {{/description}} {{#minimum}} - * minimum: {{minimum}} + * minimum: {{.}} {{/minimum}} {{#maximum}} - * maximum: {{maximum}} + * maximum: {{.}} {{/maximum}} * @return {{name}} **/ diff --git a/modules/openapi-generator/src/main/resources/JavaSpring/api.mustache b/modules/openapi-generator/src/main/resources/JavaSpring/api.mustache index 5a9522ffcfd..ecf4ad39ba6 100644 --- a/modules/openapi-generator/src/main/resources/JavaSpring/api.mustache +++ b/modules/openapi-generator/src/main/resources/JavaSpring/api.mustache @@ -102,14 +102,14 @@ public interface {{classname}} { {{#virtualService}} @ApiVirtual {{/virtualService}} - @ApiOperation(value = "{{{summary}}}", nickname = "{{{operationId}}}", notes = "{{{notes}}}"{{#returnBaseType}}, response = {{{returnBaseType}}}.class{{/returnBaseType}}{{#returnContainer}}, responseContainer = "{{{returnContainer}}}"{{/returnContainer}}{{#hasAuthMethods}}, authorizations = { + @ApiOperation(value = "{{{summary}}}", nickname = "{{{operationId}}}", notes = "{{{notes}}}"{{#returnBaseType}}, response = {{{.}}}.class{{/returnBaseType}}{{#returnContainer}}, responseContainer = "{{{.}}}"{{/returnContainer}}{{#hasAuthMethods}}, authorizations = { {{#authMethods}}{{#isOAuth}}@Authorization(value = "{{name}}", scopes = { {{#scopes}}@AuthorizationScope(scope = "{{scope}}", description = "{{description}}"){{^-last}}, {{/-last}}{{/scopes}} }){{^-last}},{{/-last}}{{/isOAuth}} {{^isOAuth}}@Authorization(value = "{{name}}"){{^-last}},{{/-last}} {{/isOAuth}}{{/authMethods}} }{{/hasAuthMethods}}, tags={ {{#vendorExtensions.x-tags}}"{{tag}}",{{/vendorExtensions.x-tags}} }) @ApiResponses(value = { {{#responses}} - @ApiResponse(code = {{{code}}}, message = "{{{message}}}"{{#baseType}}, response = {{{baseType}}}.class{{/baseType}}{{#containerType}}, responseContainer = "{{{containerType}}}"{{/containerType}}){{^-last}},{{/-last}}{{/responses}} }) + @ApiResponse(code = {{{code}}}, message = "{{{message}}}"{{#baseType}}, response = {{{.}}}.class{{/baseType}}{{#containerType}}, responseContainer = "{{{.}}}"{{/containerType}}){{^-last}},{{/-last}}{{/responses}} }) {{#implicitHeaders}} @ApiImplicitParams({ {{#headerParams}} diff --git a/modules/openapi-generator/src/main/resources/JavaSpring/beanValidationCore.mustache b/modules/openapi-generator/src/main/resources/JavaSpring/beanValidationCore.mustache index cc394980f78..c7331c0cfe5 100644 --- a/modules/openapi-generator/src/main/resources/JavaSpring/beanValidationCore.mustache +++ b/modules/openapi-generator/src/main/resources/JavaSpring/beanValidationCore.mustache @@ -4,21 +4,21 @@ minLength && maxLength set minLength set, maxLength not }}{{#minLength}}{{^maxLength}}@Size(min={{minLength}}) {{/maxLength}}{{/minLength}}{{! minLength not set, maxLength set -}}{{^minLength}}{{#maxLength}}@Size(max={{maxLength}}) {{/maxLength}}{{/minLength}}{{! +}}{{^minLength}}{{#maxLength}}@Size(max={{.}}) {{/maxLength}}{{/minLength}}{{! @Size: minItems && maxItems set }}{{#minItems}}{{#maxItems}}@Size(min={{minItems}},max={{maxItems}}) {{/maxItems}}{{/minItems}}{{! @Size: minItems set, maxItems not }}{{#minItems}}{{^maxItems}}@Size(min={{minItems}}) {{/maxItems}}{{/minItems}}{{! @Size: minItems not set && maxItems set -}}{{^minItems}}{{#maxItems}}@Size(max={{maxItems}}) {{/maxItems}}{{/minItems}}{{! +}}{{^minItems}}{{#maxItems}}@Size(max={{.}}) {{/maxItems}}{{/minItems}}{{! @Email: useBeanValidation set && isEmail && java8 set }}{{#useBeanValidation}}{{#isEmail}}{{#java8}}@javax.validation.constraints.Email{{/java8}}{{/isEmail}}{{/useBeanValidation}}{{! @Email: performBeanValidation set && isEmail && not java8 set }}{{#performBeanValidation}}{{#isEmail}}{{^java8}}@org.hibernate.validator.constraints.Email{{/java8}}{{/isEmail}}{{/performBeanValidation}}{{! check for integer or long / all others=decimal type with @Decimal* isInteger set -}}{{#isInteger}}{{#minimum}}@Min({{minimum}}){{/minimum}}{{#maximum}} @Max({{maximum}}) {{/maximum}}{{/isInteger}}{{! +}}{{#isInteger}}{{#minimum}}@Min({{.}}){{/minimum}}{{#maximum}} @Max({{.}}) {{/maximum}}{{/isInteger}}{{! isLong set -}}{{#isLong}}{{#minimum}}@Min({{minimum}}L){{/minimum}}{{#maximum}} @Max({{maximum}}L) {{/maximum}}{{/isLong}}{{! +}}{{#isLong}}{{#minimum}}@Min({{.}}L){{/minimum}}{{#maximum}} @Max({{.}}L) {{/maximum}}{{/isLong}}{{! Not Integer, not Long => we have a decimal value! }}{{^isInteger}}{{^isLong}}{{#minimum}}@DecimalMin({{#exclusiveMinimum}}value={{/exclusiveMinimum}}"{{minimum}}"{{#exclusiveMinimum}},inclusive=false{{/exclusiveMinimum}}){{/minimum}}{{#maximum}} @DecimalMax({{#exclusiveMaximum}}value={{/exclusiveMaximum}}"{{maximum}}"{{#exclusiveMaximum}},inclusive=false{{/exclusiveMaximum}}) {{/maximum}}{{/isLong}}{{/isInteger}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/JavaSpring/bodyParams.mustache b/modules/openapi-generator/src/main/resources/JavaSpring/bodyParams.mustache index 83780c73ae3..a7352af1809 100644 --- a/modules/openapi-generator/src/main/resources/JavaSpring/bodyParams.mustache +++ b/modules/openapi-generator/src/main/resources/JavaSpring/bodyParams.mustache @@ -1 +1 @@ -{{#isBodyParam}}@ApiParam(value = "{{{description}}}" {{#required}},required=true{{/required}} {{^isContainer}}{{#allowableValues}}, allowableValues="{{{allowableValues}}}"{{/allowableValues}}{{#defaultValue}}, defaultValue="{{{defaultValue}}}"{{/defaultValue}}{{/isContainer}}) {{#useBeanValidation}}@Valid{{/useBeanValidation}} @RequestBody{{^required}}(required = false){{/required}} {{^reactive}}{{{dataType}}}{{/reactive}}{{#reactive}}{{^isArray}}Mono<{{{dataType}}}>{{/isArray}}{{#isArray}}Flux<{{{baseType}}}>{{/isArray}}{{/reactive}} {{paramName}}{{/isBodyParam}} \ No newline at end of file +{{#isBodyParam}}@ApiParam(value = "{{{description}}}" {{#required}},required=true{{/required}} {{^isContainer}}{{#allowableValues}}, allowableValues="{{{.}}}"{{/allowableValues}}{{#defaultValue}}, defaultValue="{{{.}}}"{{/defaultValue}}{{/isContainer}}) {{#useBeanValidation}}@Valid{{/useBeanValidation}} @RequestBody{{^required}}(required = false){{/required}} {{^reactive}}{{{dataType}}}{{/reactive}}{{#reactive}}{{^isArray}}Mono<{{{dataType}}}>{{/isArray}}{{#isArray}}Flux<{{{baseType}}}>{{/isArray}}{{/reactive}} {{paramName}}{{/isBodyParam}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/JavaSpring/cookieParams.mustache b/modules/openapi-generator/src/main/resources/JavaSpring/cookieParams.mustache index e21bd9ff4bf..93759b0f312 100644 --- a/modules/openapi-generator/src/main/resources/JavaSpring/cookieParams.mustache +++ b/modules/openapi-generator/src/main/resources/JavaSpring/cookieParams.mustache @@ -1 +1 @@ -{{#isCookieParam}}{{#useBeanValidation}}{{>beanValidationQueryParams}}{{/useBeanValidation}}@ApiParam(value = "{{{description}}}"{{#required}},required=true{{/required}}{{#allowableValues}}, allowableValues = "{{#enumVars}}{{#lambdaEscapeDoubleQuote}}{{{value}}}{{/lambdaEscapeDoubleQuote}}{{^-last}}, {{/-last}}{{#-last}}{{/-last}}{{/enumVars}}"{{/allowableValues}}{{^isContainer}}{{#defaultValue}}, defaultValue="{{{defaultValue}}}"{{/defaultValue}}{{/isContainer}}) @CookieValue("{{baseName}}") {{>optionalDataType}} {{paramName}}{{/isCookieParam}} \ No newline at end of file +{{#isCookieParam}}{{#useBeanValidation}}{{>beanValidationQueryParams}}{{/useBeanValidation}}@ApiParam(value = "{{{description}}}"{{#required}},required=true{{/required}}{{#allowableValues}}, allowableValues = "{{#enumVars}}{{#lambdaEscapeDoubleQuote}}{{{value}}}{{/lambdaEscapeDoubleQuote}}{{^-last}}, {{/-last}}{{#-last}}{{/-last}}{{/enumVars}}"{{/allowableValues}}{{^isContainer}}{{#defaultValue}}, defaultValue="{{{.}}}"{{/defaultValue}}{{/isContainer}}) @CookieValue("{{baseName}}") {{>optionalDataType}} {{paramName}}{{/isCookieParam}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/JavaSpring/enumClass.mustache b/modules/openapi-generator/src/main/resources/JavaSpring/enumClass.mustache index 35b2bba8f62..59fa30eca3e 100644 --- a/modules/openapi-generator/src/main/resources/JavaSpring/enumClass.mustache +++ b/modules/openapi-generator/src/main/resources/JavaSpring/enumClass.mustache @@ -1,7 +1,7 @@ /** - * {{^description}}Gets or Sets {{{name}}}{{/description}}{{#description}}{{{description}}}{{/description}} + * {{^description}}Gets or Sets {{{name}}}{{/description}}{{{description}}} */ - {{>additionalEnumTypeAnnotations}}public enum {{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}} { + {{>additionalEnumTypeAnnotations}}public enum {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}} { {{#gson}} {{#allowableValues}} {{#enumVars}} @@ -22,7 +22,7 @@ private {{{dataType}}} value; - {{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}({{{dataType}}} value) { + {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}({{{dataType}}} value) { this.value = value; } @@ -39,8 +39,8 @@ } @JsonCreator - public static {{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} fromValue({{{dataType}}} value) { - for ({{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} b : {{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}}.values()) { + public static {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} fromValue({{{dataType}}} value) { + for ({{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} b : {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}}.values()) { if (b.value.equals(value)) { return b; } diff --git a/modules/openapi-generator/src/main/resources/JavaSpring/enumOuterClass.mustache b/modules/openapi-generator/src/main/resources/JavaSpring/enumOuterClass.mustache index 334bfb6640b..387e4c30c86 100644 --- a/modules/openapi-generator/src/main/resources/JavaSpring/enumOuterClass.mustache +++ b/modules/openapi-generator/src/main/resources/JavaSpring/enumOuterClass.mustache @@ -3,9 +3,9 @@ import com.fasterxml.jackson.annotation.JsonCreator; {{/jackson}} /** - * {{^description}}Gets or Sets {{{name}}}{{/description}}{{#description}}{{{description}}}{{/description}} + * {{^description}}Gets or Sets {{{name}}}{{/description}}{{{description}}} */ -{{>additionalEnumTypeAnnotations}}public enum {{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} { +{{>additionalEnumTypeAnnotations}}public enum {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} { {{#gson}} {{#allowableValues}}{{#enumVars}} @SerializedName({{#isInteger}}"{{/isInteger}}{{#isDouble}}"{{/isDouble}}{{#isLong}}"{{/isLong}}{{#isFloat}}"{{/isFloat}}{{{value}}}{{#isInteger}}"{{/isInteger}}{{#isDouble}}"{{/isDouble}}{{#isLong}}"{{/isLong}}{{#isFloat}}"{{/isFloat}}) @@ -20,7 +20,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; private {{{dataType}}} value; - {{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}}({{{dataType}}} value) { + {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}}({{{dataType}}} value) { this.value = value; } @@ -37,8 +37,8 @@ import com.fasterxml.jackson.annotation.JsonCreator; } @JsonCreator - public static {{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} fromValue({{{dataType}}} value) { - for ({{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} b : {{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}}.values()) { + public static {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} fromValue({{{dataType}}} value) { + for ({{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} b : {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}}.values()) { if (b.value.equals(value)) { return b; } diff --git a/modules/openapi-generator/src/main/resources/JavaSpring/formParams.mustache b/modules/openapi-generator/src/main/resources/JavaSpring/formParams.mustache index f3291733ee4..051c24cdf6c 100644 --- a/modules/openapi-generator/src/main/resources/JavaSpring/formParams.mustache +++ b/modules/openapi-generator/src/main/resources/JavaSpring/formParams.mustache @@ -1 +1 @@ -{{#isFormParam}}{{^isFile}}@ApiParam(value = "{{{description}}}"{{#required}}, required=true{{/required}}{{#allowableValues}}, allowableValues="{{#values}}{{{.}}}{{^-last}}, {{/-last}}{{#-last}}{{/-last}}{{/values}}"{{/allowableValues}}{{^isContainer}}{{#defaultValue}}, defaultValue="{{{defaultValue}}}"{{/defaultValue}}{{/isContainer}}) {{#useBeanValidation}}@Valid{{/useBeanValidation}} @RequestPart(value = "{{baseName}}"{{#required}}, required = true{{/required}}{{^required}}, required = false{{/required}}) {{{dataType}}} {{paramName}}{{/isFile}}{{#isFile}}@ApiParam(value = "{{{description}}}") {{#useBeanValidation}}@Valid{{/useBeanValidation}} @RequestPart(value = "{{baseName}}"{{#required}}, required = true{{/required}}{{^required}}, required = false{{/required}}) {{#isArray}}List<{{/isArray}}{{#reactive}}Flux{{/reactive}}{{^reactive}}MultipartFile{{/reactive}}{{#isArray}}>{{/isArray}} {{baseName}}{{/isFile}}{{/isFormParam}} \ No newline at end of file +{{#isFormParam}}{{^isFile}}@ApiParam(value = "{{{description}}}"{{#required}}, required=true{{/required}}{{#allowableValues}}, allowableValues="{{#values}}{{{.}}}{{^-last}}, {{/-last}}{{#-last}}{{/-last}}{{/values}}"{{/allowableValues}}{{^isContainer}}{{#defaultValue}}, defaultValue="{{{.}}}"{{/defaultValue}}{{/isContainer}}) {{#useBeanValidation}}@Valid{{/useBeanValidation}} @RequestPart(value = "{{baseName}}"{{#required}}, required = true{{/required}}{{^required}}, required = false{{/required}}) {{{dataType}}} {{paramName}}{{/isFile}}{{#isFile}}@ApiParam(value = "{{{description}}}") {{#useBeanValidation}}@Valid{{/useBeanValidation}} @RequestPart(value = "{{baseName}}"{{#required}}, required = true{{/required}}{{^required}}, required = false{{/required}}) {{#isArray}}List<{{/isArray}}{{#reactive}}Flux{{/reactive}}{{^reactive}}MultipartFile{{/reactive}}{{#isArray}}>{{/isArray}} {{baseName}}{{/isFile}}{{/isFormParam}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/JavaSpring/headerParams.mustache b/modules/openapi-generator/src/main/resources/JavaSpring/headerParams.mustache index 2e2d907f583..6de7ead1060 100644 --- a/modules/openapi-generator/src/main/resources/JavaSpring/headerParams.mustache +++ b/modules/openapi-generator/src/main/resources/JavaSpring/headerParams.mustache @@ -1 +1 @@ -{{#isHeaderParam}}@ApiParam(value = "{{{description}}}" {{#required}},required=true{{/required}}{{#allowableValues}}, allowableValues="{{#values}}{{{.}}}{{^-last}}, {{/-last}}{{#-last}}{{/-last}}{{/values}}"{{/allowableValues}}{{^isContainer}}{{#defaultValue}}, defaultValue="{{{defaultValue}}}"{{/defaultValue}}{{/isContainer}}) @RequestHeader(value="{{baseName}}", required={{#required}}true{{/required}}{{^required}}false{{/required}}) {{>optionalDataType}} {{paramName}}{{/isHeaderParam}} \ No newline at end of file +{{#isHeaderParam}}@ApiParam(value = "{{{description}}}" {{#required}},required=true{{/required}}{{#allowableValues}}, allowableValues="{{#values}}{{{.}}}{{^-last}}, {{/-last}}{{#-last}}{{/-last}}{{/values}}"{{/allowableValues}}{{^isContainer}}{{#defaultValue}}, defaultValue="{{{.}}}"{{/defaultValue}}{{/isContainer}}) @RequestHeader(value="{{baseName}}", required={{#required}}true{{/required}}{{^required}}false{{/required}}) {{>optionalDataType}} {{paramName}}{{/isHeaderParam}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-boot/README.mustache b/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-boot/README.mustache index c89e7cf6385..196292339da 100644 --- a/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-boot/README.mustache +++ b/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-boot/README.mustache @@ -1,9 +1,9 @@ {{^interfaceOnly}}# OpenAPI generated server -Spring Boot Server +Spring Boot Server -## Overview +## Overview This server was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using the [OpenAPI-Spec](https://openapis.org), you can easily generate a server stub. This is an example of building a OpenAPI-enabled server in Java using the SpringBoot framework. @@ -15,7 +15,7 @@ The underlying library integrating OpenAPI to SpringBoot is [springfox](https:// Start your server as a simple java application {{^reactive}} -You can view the api documentation in swagger-ui by pointing to +You can view the api documentation in swagger-ui by pointing to http://localhost:{{serverPort}}/ {{/reactive}} @@ -52,9 +52,9 @@ public interface PetClient extends PetApi { ## Virtualan : -You can view Virtualan UI by pointing to +You can view Virtualan UI by pointing to http://localhost:8080//virtualan-ui.html -How to use guide available in the Virtualan wiki +How to use guide available in the Virtualan wiki https://github.com/virtualansoftware/virtualan/wiki {{/virtualService}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-cloud/formParams.mustache b/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-cloud/formParams.mustache index 0eb66fdee5a..1be37a65d96 100644 --- a/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-cloud/formParams.mustache +++ b/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-cloud/formParams.mustache @@ -1 +1 @@ -{{#isFormParam}}{{^isFile}}@ApiParam(value = "{{{description}}}"{{#required}}, required=true{{/required}} {{#allowableValues}}, allowableValues="{{{allowableValues}}}"{{/allowableValues}}{{^isContainer}}{{#defaultValue}}, defaultValue="{{{defaultValue}}}"{{/defaultValue}}{{/isContainer}}) @RequestParam(value="{{baseName}}"{{#required}}, required=true{{/required}}{{^required}}, required=false{{/required}}) {{{dataType}}} {{paramName}}{{/isFile}}{{#isFile}}@ApiParam(value = "{{{description}}}") @RequestParam("{{baseName}}") {{#isArray}}List<{{/isArray}}{{#reactive}}Flux{{/reactive}}{{^reactive}}MultipartFile{{/reactive}}{{#isArray}}>{{/isArray}} {{paramName}}{{/isFile}}{{/isFormParam}} \ No newline at end of file +{{#isFormParam}}{{^isFile}}@ApiParam(value = "{{{description}}}"{{#required}}, required=true{{/required}} {{#allowableValues}}, allowableValues="{{{.}}}"{{/allowableValues}}{{^isContainer}}{{#defaultValue}}, defaultValue="{{{.}}}"{{/defaultValue}}{{/isContainer}}) @RequestParam(value="{{baseName}}"{{#required}}, required=true{{/required}}{{^required}}, required=false{{/required}}) {{{dataType}}} {{paramName}}{{/isFile}}{{#isFile}}@ApiParam(value = "{{{description}}}") @RequestParam("{{baseName}}") {{#isArray}}List<{{/isArray}}{{#reactive}}Flux{{/reactive}}{{^reactive}}MultipartFile{{/reactive}}{{#isArray}}>{{/isArray}} {{paramName}}{{/isFile}}{{/isFormParam}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-mvc/README.mustache b/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-mvc/README.mustache index d28df1b43b4..efc3e8921a6 100644 --- a/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-mvc/README.mustache +++ b/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-mvc/README.mustache @@ -11,4 +11,4 @@ The underlying library integrating OpenAPI to Spring-MVC is [springfox](https:// {{/useSpringfox}} You can view the server in swagger-ui by pointing to -http://localhost:{{serverPort}}{{^contextPath}}/{{/contextPath}}{{#contextPath}}{{contextPath}}{{/contextPath}}/ \ No newline at end of file +http://localhost:{{serverPort}}{{contextPath}}{{^contextPath}}/{{/contextPath}}/ \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-mvc/pom.mustache b/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-mvc/pom.mustache index fbda18ab83c..e7ca6777fca 100644 --- a/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-mvc/pom.mustache +++ b/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-mvc/pom.mustache @@ -38,7 +38,7 @@ ${jetty-version} - {{^contextPath}}/{{/contextPath}}{{#contextPath}}{{contextPath}}{{/contextPath}} + {{contextPath}}{{^contextPath}}/{{/contextPath}} target/${project.artifactId}-${project.version} 8079 diff --git a/modules/openapi-generator/src/main/resources/JavaSpring/pathParams.mustache b/modules/openapi-generator/src/main/resources/JavaSpring/pathParams.mustache index 44cc98fff1c..af17f0c4d96 100644 --- a/modules/openapi-generator/src/main/resources/JavaSpring/pathParams.mustache +++ b/modules/openapi-generator/src/main/resources/JavaSpring/pathParams.mustache @@ -1 +1 @@ -{{#isPathParam}}{{#useBeanValidation}}{{>beanValidationPathParams}}{{/useBeanValidation}}@ApiParam(value = "{{{description}}}"{{#required}},required=true{{/required}}{{#allowableValues}}, allowableValues = "{{#enumVars}}{{#lambdaEscapeDoubleQuote}}{{{value}}}{{/lambdaEscapeDoubleQuote}}{{^-last}}, {{/-last}}{{#-last}}{{/-last}}{{/enumVars}}"{{/allowableValues}}{{^isContainer}}{{#defaultValue}}, defaultValue="{{{defaultValue}}}"{{/defaultValue}}{{/isContainer}}) @PathVariable("{{baseName}}") {{>optionalDataType}} {{paramName}}{{/isPathParam}} \ No newline at end of file +{{#isPathParam}}{{#useBeanValidation}}{{>beanValidationPathParams}}{{/useBeanValidation}}@ApiParam(value = "{{{description}}}"{{#required}},required=true{{/required}}{{#allowableValues}}, allowableValues = "{{#enumVars}}{{#lambdaEscapeDoubleQuote}}{{{value}}}{{/lambdaEscapeDoubleQuote}}{{^-last}}, {{/-last}}{{#-last}}{{/-last}}{{/enumVars}}"{{/allowableValues}}{{^isContainer}}{{#defaultValue}}, defaultValue="{{{.}}}"{{/defaultValue}}{{/isContainer}}) @PathVariable("{{baseName}}") {{>optionalDataType}} {{paramName}}{{/isPathParam}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/JavaSpring/pojo.mustache b/modules/openapi-generator/src/main/resources/JavaSpring/pojo.mustache index de2f292341e..df0b98bfaf7 100644 --- a/modules/openapi-generator/src/main/resources/JavaSpring/pojo.mustache +++ b/modules/openapi-generator/src/main/resources/JavaSpring/pojo.mustache @@ -1,9 +1,9 @@ /** - * {{#description}}{{.}}{{/description}}{{^description}}{{classname}}{{/description}} + * {{description}}{{^description}}{{classname}}{{/description}} */{{#description}} -@ApiModel(description = "{{{description}}}"){{/description}} +@ApiModel(description = "{{{.}}}"){{/description}} {{>generatedAnnotation}}{{#discriminator}}{{>typeInfoAnnotation}}{{/discriminator}}{{>xmlAnnotation}}{{>additionalModelTypeAnnotations}} -public class {{classname}} {{#parent}}extends {{{parent}}}{{/parent}}{{^parent}}{{#hateoas}}extends RepresentationModel<{{classname}}> {{/hateoas}}{{/parent}} {{#serializableModel}}implements Serializable{{/serializableModel}} { +public class {{classname}} {{#parent}}extends {{{.}}}{{/parent}}{{^parent}}{{#hateoas}}extends RepresentationModel<{{classname}}> {{/hateoas}}{{/parent}} {{#serializableModel}}implements Serializable{{/serializableModel}} { {{#serializableModel}} private static final long serialVersionUID = 1L; @@ -14,14 +14,14 @@ public class {{classname}} {{#parent}}extends {{{parent}}}{{/parent}}{{^parent}} {{>enumClass}} {{/isContainer}} {{#isContainer}} - {{#mostInnerItems}} + {{#mostInnerItems}} {{>enumClass}} {{/mostInnerItems}} {{/isContainer}} {{/isEnum}} {{#jackson}} @JsonProperty("{{baseName}}"){{#withXml}} - @JacksonXmlProperty({{#isXmlAttribute}}isAttribute = true, {{/isXmlAttribute}}{{#xmlNamespace}}namespace="{{xmlNamespace}}", {{/xmlNamespace}}localName = "{{#xmlName}}{{xmlName}}{{/xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}"){{/withXml}} + @JacksonXmlProperty({{#isXmlAttribute}}isAttribute = true, {{/isXmlAttribute}}{{#xmlNamespace}}namespace="{{.}}", {{/xmlNamespace}}localName = "{{xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}"){{/withXml}} {{/jackson}} {{#gson}} @SerializedName("{{baseName}}") @@ -96,23 +96,23 @@ public class {{classname}} {{#parent}}extends {{{parent}}}{{/parent}}{{^parent}} /** {{#description}} - * {{{description}}} + * {{{.}}} {{/description}} {{^description}} * Get {{name}} {{/description}} {{#minimum}} - * minimum: {{minimum}} + * minimum: {{.}} {{/minimum}} {{#maximum}} - * maximum: {{maximum}} + * maximum: {{.}} {{/maximum}} * @return {{name}} */ {{#vendorExtensions.x-extra-annotation}} {{{vendorExtensions.x-extra-annotation}}} {{/vendorExtensions.x-extra-annotation}} - @ApiModelProperty({{#example}}example = "{{{example}}}", {{/example}}{{#required}}required = {{required}}, {{/required}}{{#isReadOnly}}readOnly = {{{isReadOnly}}}, {{/isReadOnly}}value = "{{{description}}}") + @ApiModelProperty({{#example}}example = "{{{.}}}", {{/example}}{{#required}}required = {{required}}, {{/required}}{{#isReadOnly}}readOnly = {{{isReadOnly}}}, {{/isReadOnly}}value = "{{{description}}}") {{#useBeanValidation}}{{>beanValidation}}{{/useBeanValidation}} public {{>nullableDataType}} {{getter}}() { return {{name}}; } diff --git a/modules/openapi-generator/src/main/resources/JavaSpring/queryParams.mustache b/modules/openapi-generator/src/main/resources/JavaSpring/queryParams.mustache index fc630e6361e..3d61a40f058 100644 --- a/modules/openapi-generator/src/main/resources/JavaSpring/queryParams.mustache +++ b/modules/openapi-generator/src/main/resources/JavaSpring/queryParams.mustache @@ -1 +1 @@ -{{#isQueryParam}}{{#useBeanValidation}}{{>beanValidationQueryParams}}{{/useBeanValidation}}@ApiParam(value = "{{{description}}}"{{#required}}, required = true{{/required}}{{#allowableValues}}, allowableValues = "{{#values}}{{{.}}}{{^-last}}, {{/-last}}{{#-last}}{{/-last}}{{/values}}"{{/allowableValues}}{{^isContainer}}{{#defaultValue}}, defaultValue = "{{{defaultValue}}}"{{/defaultValue}}{{/isContainer}}) {{#useBeanValidation}}@Valid{{/useBeanValidation}}{{^isModel}} @RequestParam(value = {{#isMap}}""{{/isMap}}{{^isMap}}"{{baseName}}"{{/isMap}}{{#required}}, required = true{{/required}}{{^required}}, required = false{{/required}}{{^isContainer}}{{#defaultValue}}, defaultValue="{{{defaultValue}}}"{{/defaultValue}}{{/isContainer}}){{/isModel}}{{#isDate}} @org.springframework.format.annotation.DateTimeFormat(iso = org.springframework.format.annotation.DateTimeFormat.ISO.DATE){{/isDate}}{{#isDateTime}} @org.springframework.format.annotation.DateTimeFormat(iso = org.springframework.format.annotation.DateTimeFormat.ISO.DATE_TIME){{/isDateTime}} {{>optionalDataType}} {{paramName}}{{/isQueryParam}} \ No newline at end of file +{{#isQueryParam}}{{#useBeanValidation}}{{>beanValidationQueryParams}}{{/useBeanValidation}}@ApiParam(value = "{{{description}}}"{{#required}}, required = true{{/required}}{{#allowableValues}}, allowableValues = "{{#values}}{{{.}}}{{^-last}}, {{/-last}}{{#-last}}{{/-last}}{{/values}}"{{/allowableValues}}{{^isContainer}}{{#defaultValue}}, defaultValue = "{{{.}}}"{{/defaultValue}}{{/isContainer}}) {{#useBeanValidation}}@Valid{{/useBeanValidation}}{{^isModel}} @RequestParam(value = {{#isMap}}""{{/isMap}}{{^isMap}}"{{baseName}}"{{/isMap}}{{#required}}, required = true{{/required}}{{^required}}, required = false{{/required}}{{^isContainer}}{{#defaultValue}}, defaultValue="{{{.}}}"{{/defaultValue}}{{/isContainer}}){{/isModel}}{{#isDate}} @org.springframework.format.annotation.DateTimeFormat(iso = org.springframework.format.annotation.DateTimeFormat.ISO.DATE){{/isDate}}{{#isDateTime}} @org.springframework.format.annotation.DateTimeFormat(iso = org.springframework.format.annotation.DateTimeFormat.ISO.DATE_TIME){{/isDateTime}} {{>optionalDataType}} {{paramName}}{{/isQueryParam}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/JavaSpring/xmlAnnotation.mustache b/modules/openapi-generator/src/main/resources/JavaSpring/xmlAnnotation.mustache index fd81a4cf5d8..70e2626635f 100644 --- a/modules/openapi-generator/src/main/resources/JavaSpring/xmlAnnotation.mustache +++ b/modules/openapi-generator/src/main/resources/JavaSpring/xmlAnnotation.mustache @@ -1,6 +1,6 @@ {{#withXml}} {{#jackson}} -@JacksonXmlRootElement({{#xmlNamespace}}namespace="{{xmlNamespace}}", {{/xmlNamespace}}localName = "{{#xmlName}}{{xmlName}}{{/xmlName}}{{^xmlName}}{{classname}}{{/xmlName}}") +@JacksonXmlRootElement({{#xmlNamespace}}namespace="{{.}}", {{/xmlNamespace}}localName = "{{xmlName}}{{^xmlName}}{{classname}}{{/xmlName}}") {{/jackson}} -@XmlRootElement({{#xmlNamespace}}namespace="{{xmlNamespace}}", {{/xmlNamespace}}name = "{{#xmlName}}{{xmlName}}{{/xmlName}}{{^xmlName}}{{classname}}{{/xmlName}}") +@XmlRootElement({{#xmlNamespace}}namespace="{{.}}", {{/xmlNamespace}}name = "{{xmlName}}{{^xmlName}}{{classname}}{{/xmlName}}") @XmlAccessorType(XmlAccessType.FIELD){{/withXml}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/JavaVertXServer/AsyncMethod.mustache b/modules/openapi-generator/src/main/resources/JavaVertXServer/AsyncMethod.mustache index 13725c9212e..4f790cf0f56 100644 --- a/modules/openapi-generator/src/main/resources/JavaVertXServer/AsyncMethod.mustache +++ b/modules/openapi-generator/src/main/resources/JavaVertXServer/AsyncMethod.mustache @@ -1 +1 @@ - void {{operationId}}({{#allParams}}{{{dataType}}} {{paramName}}{{^-last}}, {{/-last}}{{#-last}}, {{/-last}}{{/allParams}}Handler> handler); \ No newline at end of file + void {{operationId}}({{#allParams}}{{{dataType}}} {{paramName}}{{^-last}}, {{/-last}}{{#-last}}, {{/-last}}{{/allParams}}Handler> handler); \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/JavaVertXServer/MainApiException.mustache b/modules/openapi-generator/src/main/resources/JavaVertXServer/MainApiException.mustache index 2e2b887a117..27cf89ab06a 100644 --- a/modules/openapi-generator/src/main/resources/JavaVertXServer/MainApiException.mustache +++ b/modules/openapi-generator/src/main/resources/JavaVertXServer/MainApiException.mustache @@ -17,6 +17,6 @@ public class MainApiException extends Exception { public String getStatusMessage() { return statusMessage; } - - public static final MainApiException INTERNAL_SERVER_ERROR = new MainApiException(500, "Internal Server Error"); + + public static final MainApiException INTERNAL_SERVER_ERROR = new MainApiException(500, "Internal Server Error"); } \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/JavaVertXServer/MainApiVerticle.mustache b/modules/openapi-generator/src/main/resources/JavaVertXServer/MainApiVerticle.mustache index 034d83b8f21..594d423d40b 100644 --- a/modules/openapi-generator/src/main/resources/JavaVertXServer/MainApiVerticle.mustache +++ b/modules/openapi-generator/src/main/resources/JavaVertXServer/MainApiVerticle.mustache @@ -50,7 +50,7 @@ public class MainApiVerticle extends AbstractVerticle { deployVerticles(startFuture); vertx.createHttpServer() - .requestHandler(swaggerRouter::accept) + .requestHandler(swaggerRouter::accept) .listen(serverPort, h -> { if (h.succeeded()) { startFuture.complete(); @@ -61,9 +61,9 @@ public class MainApiVerticle extends AbstractVerticle { } else { startFuture.fail(readFile.cause()); } - }); + }); } - + public void deployVerticles(Future startFuture) { {{#apiInfo}}{{#apis}} vertx.deployVerticle("{{apiPackage}}.{{classname}}Verticle", res -> { diff --git a/modules/openapi-generator/src/main/resources/JavaVertXServer/RxMethod.mustache b/modules/openapi-generator/src/main/resources/JavaVertXServer/RxMethod.mustache index fd183f08805..5361709387f 100644 --- a/modules/openapi-generator/src/main/resources/JavaVertXServer/RxMethod.mustache +++ b/modules/openapi-generator/src/main/resources/JavaVertXServer/RxMethod.mustache @@ -1 +1 @@ - public {{#returnType}}Single<{{{returnType}}}>{{/returnType}}{{^returnType}}Completable{{/returnType}} {{operationId}}({{#allParams}}{{{dataType}}} {{paramName}}{{^-last}},{{/-last}}{{/allParams}}); \ No newline at end of file + public {{#returnType}}Single<{{{.}}}>{{/returnType}}{{^returnType}}Completable{{/returnType}} {{operationId}}({{#allParams}}{{{dataType}}} {{paramName}}{{^-last}},{{/-last}}{{/allParams}}); \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/JavaVertXServer/api.mustache b/modules/openapi-generator/src/main/resources/JavaVertXServer/api.mustache index 920bbd92ea0..183d23c28eb 100644 --- a/modules/openapi-generator/src/main/resources/JavaVertXServer/api.mustache +++ b/modules/openapi-generator/src/main/resources/JavaVertXServer/api.mustache @@ -25,7 +25,7 @@ public interface {{classname}} { {{^rxInterface}} {{>AsyncMethod}} {{/rxInterface}} - + {{/operation}} {{/operations}} } diff --git a/modules/openapi-generator/src/main/resources/JavaVertXServer/apiException.mustache b/modules/openapi-generator/src/main/resources/JavaVertXServer/apiException.mustache index f3b495dfb4c..5678721bd86 100644 --- a/modules/openapi-generator/src/main/resources/JavaVertXServer/apiException.mustache +++ b/modules/openapi-generator/src/main/resources/JavaVertXServer/apiException.mustache @@ -7,7 +7,7 @@ public final class {{classname}}Exception extends MainApiException { public {{classname}}Exception(int statusCode, String statusMessage) { super(statusCode, statusMessage); } - + {{#operations}}{{#operation}}{{#responses}}{{^isDefault}}public static final {{classname}}Exception {{baseName}}_{{{operationId}}}_{{{code}}}_Exception = new {{classname}}Exception({{{code}}}, "{{{message}}}"); {{/isDefault}}{{/responses}}{{/operation}}{{/operations}} diff --git a/modules/openapi-generator/src/main/resources/JavaVertXServer/apiVerticle.mustache b/modules/openapi-generator/src/main/resources/JavaVertXServer/apiVerticle.mustache index 84a896245fb..297495efb23 100644 --- a/modules/openapi-generator/src/main/resources/JavaVertXServer/apiVerticle.mustache +++ b/modules/openapi-generator/src/main/resources/JavaVertXServer/apiVerticle.mustache @@ -16,7 +16,7 @@ import java.util.Map; public class {{classname}}Verticle extends AbstractVerticle { static final Logger LOGGER = LoggerFactory.getLogger({{classname}}Verticle.class); - + {{#operations}}{{#operation}}{{#vendorExtensions}}static final String {{x-serviceid-varname}} = "{{x-serviceid}}"; {{/vendorExtensions}}{{/operation}}{{/operations}} final {{classname}} service; @@ -52,7 +52,7 @@ public class {{classname}}Verticle extends AbstractVerticle { Json.mapper.getTypeFactory().constructCollectionType(List.class, {{{baseType}}}.class)); {{/required}} {{^required}} - {{{dataType}}} {{paramName}} = ({{paramName}}Param == null) ? {{#defaultValue}}{{{defaultValue}}}{{/defaultValue}}{{^defaultValue}}null{{/defaultValue}} : Json.mapper.readValue({{paramName}}Param.encode(), + {{{dataType}}} {{paramName}} = ({{paramName}}Param == null) ? {{{defaultValue}}}{{^defaultValue}}null{{/defaultValue}} : Json.mapper.readValue({{paramName}}Param.encode(), Json.mapper.getTypeFactory().constructCollectionType(List.class, {{{baseType}}}.class)); {{/required}} {{/isArray}} @@ -81,7 +81,7 @@ public class {{classname}}Verticle extends AbstractVerticle { {{{dataType}}} {{paramName}} = Json.mapper.readValue({{paramName}}Param, {{{dataType}}}.class); {{/required}} {{^required}} - {{{dataType}}} {{paramName}} = ({{paramName}}Param == null) ? {{#defaultValue}}{{{defaultValue}}}{{/defaultValue}}{{^defaultValue}}null{{/defaultValue}} : Json.mapper.readValue({{paramName}}Param, {{{dataType}}}.class); + {{{dataType}}} {{paramName}} = ({{paramName}}Param == null) ? {{{defaultValue}}}{{^defaultValue}}null{{/defaultValue}} : Json.mapper.readValue({{paramName}}Param, {{{dataType}}}.class); {{/required}} {{/isString}} {{/isPrimitiveType}} @@ -109,7 +109,7 @@ public class {{classname}}Verticle extends AbstractVerticle { }); {{/operation}}{{/operations}} } - + private void manageError(Message message, Throwable cause, String serviceName) { int code = MainApiException.INTERNAL_SERVER_ERROR.getStatusCode(); String statusMessage = MainApiException.INTERNAL_SERVER_ERROR.getStatusMessage(); @@ -117,12 +117,12 @@ public class {{classname}}Verticle extends AbstractVerticle { code = ((MainApiException)cause).getStatusCode(); statusMessage = ((MainApiException)cause).getStatusMessage(); } else { - logUnexpectedError(serviceName, cause); + logUnexpectedError(serviceName, cause); } - + message.fail(code, statusMessage); } - + private void logUnexpectedError(String serviceName, Throwable cause) { LOGGER.error("Unexpected error in "+ serviceName, cause); } diff --git a/modules/openapi-generator/src/main/resources/JavaVertXServer/enumOuterClass.mustache b/modules/openapi-generator/src/main/resources/JavaVertXServer/enumOuterClass.mustache index 58748fd18b2..0db4c738079 100644 --- a/modules/openapi-generator/src/main/resources/JavaVertXServer/enumOuterClass.mustache +++ b/modules/openapi-generator/src/main/resources/JavaVertXServer/enumOuterClass.mustache @@ -2,16 +2,16 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; /** - * {{^description}}Gets or Sets {{{name}}}{{/description}}{{#description}}{{description}}{{/description}} + * {{description}}{{^description}}Gets or Sets {{{name}}}{{/description}} */ -{{>additionalEnumTypeAnnotations}}public enum {{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} { +{{>additionalEnumTypeAnnotations}}public enum {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} { {{#allowableValues}}{{#enumVars}} {{{name}}}({{{value}}}){{^-last}}, {{/-last}}{{#-last}};{{/-last}}{{/enumVars}}{{/allowableValues}} private {{{dataType}}} value; - {{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}}({{{dataType}}} value) { + {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}}({{{dataType}}} value) { this.value = value; } @@ -25,8 +25,8 @@ import com.fasterxml.jackson.annotation.JsonValue; return String.valueOf(value); } - public static {{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} fromValue({{{dataType}}} value) { - for ({{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} b : {{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}}.values()) { + public static {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} fromValue({{{dataType}}} value) { + for ({{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} b : {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}}.values()) { if (b.value.equals(value)) { return b; } diff --git a/modules/openapi-generator/src/main/resources/JavaVertXServer/model.mustache b/modules/openapi-generator/src/main/resources/JavaVertXServer/model.mustache index 46f9f77357d..816b64ebc52 100644 --- a/modules/openapi-generator/src/main/resources/JavaVertXServer/model.mustache +++ b/modules/openapi-generator/src/main/resources/JavaVertXServer/model.mustache @@ -6,7 +6,7 @@ import java.util.Objects; {{#serializableModel}}import java.io.Serializable; {{/serializableModel}}{{#models}}{{#model}}{{#description}} /** - * {{description}} + * {{.}} **/ {{/description}}{{^description}} {{/description}}{{#isEnum}}{{>enumOuterClass}}{{/isEnum}}{{^isEnum}}{{>pojo}}{{/isEnum}}{{/model}}{{/models}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/JavaVertXServer/pojo.mustache b/modules/openapi-generator/src/main/resources/JavaVertXServer/pojo.mustache index a2d809a9e7f..cbcff066b1b 100644 --- a/modules/openapi-generator/src/main/resources/JavaVertXServer/pojo.mustache +++ b/modules/openapi-generator/src/main/resources/JavaVertXServer/pojo.mustache @@ -1,5 +1,5 @@ {{>additionalModelTypeAnnotations}}@JsonInclude(JsonInclude.Include.NON_NULL) -public class {{classname}} {{#parent}}extends {{{parent}}}{{/parent}} {{#serializableModel}}implements Serializable{{/serializableModel}} { +public class {{classname}} {{#parent}}extends {{{.}}}{{/parent}} {{#serializableModel}}implements Serializable{{/serializableModel}} { {{#vars}}{{#isEnum}}{{^isContainer}} {{>enumClass}}{{/isContainer}}{{#isContainer}}{{#mostInnerItems}} diff --git a/modules/openapi-generator/src/main/resources/JavaVertXServer/pom.mustache b/modules/openapi-generator/src/main/resources/JavaVertXServer/pom.mustache index d12dcba44b1..3fdedc85a2a 100644 --- a/modules/openapi-generator/src/main/resources/JavaVertXServer/pom.mustache +++ b/modules/openapi-generator/src/main/resources/JavaVertXServer/pom.mustache @@ -1,14 +1,14 @@ 4.0.0 - + {{groupId}} {{artifactId}} {{artifactVersion}} jar - + {{appName}} - + UTF-8 1.8 diff --git a/modules/openapi-generator/src/main/resources/JavaVertXWebServer/enumOuterClass.mustache b/modules/openapi-generator/src/main/resources/JavaVertXWebServer/enumOuterClass.mustache index a7b818b228f..8d64ba3eb88 100644 --- a/modules/openapi-generator/src/main/resources/JavaVertXWebServer/enumOuterClass.mustache +++ b/modules/openapi-generator/src/main/resources/JavaVertXWebServer/enumOuterClass.mustache @@ -2,16 +2,16 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; /** - * {{^description}}Gets or Sets {{{name}}}{{/description}}{{#description}}{{description}}{{/description}} + * {{description}}{{^description}}Gets or Sets {{{name}}}{{/description}} */ -{{>additionalEnumTypeAnnotations}}public enum {{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} { +{{>additionalEnumTypeAnnotations}}public enum {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} { {{#allowableValues}}{{#enumVars}} {{{name}}}({{{value}}}){{^-last}}, {{/-last}}{{#-last}};{{/-last}}{{/enumVars}}{{/allowableValues}} private {{{dataType}}} value; - {{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}}({{{dataType}}} value) { + {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}}({{{dataType}}} value) { this.value = value; } @@ -25,8 +25,8 @@ import com.fasterxml.jackson.annotation.JsonValue; return String.valueOf(value); } - public static {{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} fromValue({{{dataType}}} value) { - for ({{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} b : {{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}}.values()) { + public static {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} fromValue({{{dataType}}} value) { + for ({{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} b : {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}}.values()) { if (b.value.equals(value)) { return b; } diff --git a/modules/openapi-generator/src/main/resources/JavaVertXWebServer/model.mustache b/modules/openapi-generator/src/main/resources/JavaVertXWebServer/model.mustache index 46f9f77357d..816b64ebc52 100644 --- a/modules/openapi-generator/src/main/resources/JavaVertXWebServer/model.mustache +++ b/modules/openapi-generator/src/main/resources/JavaVertXWebServer/model.mustache @@ -6,7 +6,7 @@ import java.util.Objects; {{#serializableModel}}import java.io.Serializable; {{/serializableModel}}{{#models}}{{#model}}{{#description}} /** - * {{description}} + * {{.}} **/ {{/description}}{{^description}} {{/description}}{{#isEnum}}{{>enumOuterClass}}{{/isEnum}}{{^isEnum}}{{>pojo}}{{/isEnum}}{{/model}}{{/models}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/JavaVertXWebServer/pojo.mustache b/modules/openapi-generator/src/main/resources/JavaVertXWebServer/pojo.mustache index a2d809a9e7f..cbcff066b1b 100644 --- a/modules/openapi-generator/src/main/resources/JavaVertXWebServer/pojo.mustache +++ b/modules/openapi-generator/src/main/resources/JavaVertXWebServer/pojo.mustache @@ -1,5 +1,5 @@ {{>additionalModelTypeAnnotations}}@JsonInclude(JsonInclude.Include.NON_NULL) -public class {{classname}} {{#parent}}extends {{{parent}}}{{/parent}} {{#serializableModel}}implements Serializable{{/serializableModel}} { +public class {{classname}} {{#parent}}extends {{{.}}}{{/parent}} {{#serializableModel}}implements Serializable{{/serializableModel}} { {{#vars}}{{#isEnum}}{{^isContainer}} {{>enumClass}}{{/isContainer}}{{#isContainer}}{{#mostInnerItems}} diff --git a/modules/openapi-generator/src/main/resources/JavaVertXWebServer/supportFiles/ApiResponse.mustache b/modules/openapi-generator/src/main/resources/JavaVertXWebServer/supportFiles/ApiResponse.mustache index f1a435bdcc8..4554dd577ae 100644 --- a/modules/openapi-generator/src/main/resources/JavaVertXWebServer/supportFiles/ApiResponse.mustache +++ b/modules/openapi-generator/src/main/resources/JavaVertXWebServer/supportFiles/ApiResponse.mustache @@ -33,5 +33,3 @@ public class ApiResponse { return statusCode; } } - - diff --git a/modules/openapi-generator/src/main/resources/Javascript-Apollo/ApiClient.mustache b/modules/openapi-generator/src/main/resources/Javascript-Apollo/ApiClient.mustache index 445e1cef2b8..8914ecf5e44 100644 --- a/modules/openapi-generator/src/main/resources/Javascript-Apollo/ApiClient.mustache +++ b/modules/openapi-generator/src/main/resources/Javascript-Apollo/ApiClient.mustache @@ -3,20 +3,20 @@ import RESTDataSource from 'apollo-datasource-rest'; {{#emitJSDoc}}/** -* @module {{#invokerPackage}}{{invokerPackage}}/{{/invokerPackage}}ApiClient +* @module {{#invokerPackage}}{{.}}/{{/invokerPackage}}ApiClient * @version {{projectVersion}} */ /** * Manages low level client-server communications, parameter marshalling, etc. There should not be any need for an * application to use this class directly - the *Api and model classes provide the public API for the service. -* @alias module:{{#invokerPackage}}{{invokerPackage}}/{{/invokerPackage}}ApiClient +* @alias module:{{#invokerPackage}}{{.}}/{{/invokerPackage}}ApiClient * @class */{{/emitJSDoc}} export default class ApiClient extends RESTDataSource { constructor() { super() - + {{#emitJSDoc}}/** * The authentication methods to be included for all API calls. * @type {Array.} @@ -187,7 +187,7 @@ export default class ApiClient extends RESTDataSource { this.applyAuthOptions(fetchOptions, authNames); var body = null; - + if (bodyParam !== null && bodyParam !== undefined) { body = bodyParam; } else if (formParams !== null && formParams !== undefined) { diff --git a/modules/openapi-generator/src/main/resources/Javascript-Apollo/README.mustache b/modules/openapi-generator/src/main/resources/Javascript-Apollo/README.mustache index dd4a6721a2d..0ac4e62d2f5 100644 --- a/modules/openapi-generator/src/main/resources/Javascript-Apollo/README.mustache +++ b/modules/openapi-generator/src/main/resources/Javascript-Apollo/README.mustache @@ -2,7 +2,7 @@ {{moduleName}} - JavaScript client for {{projectName}} {{#appDescriptionWithNewLines}} -{{{appDescriptionWithNewLines}}} +{{{.}}} {{/appDescriptionWithNewLines}} This SDK is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: @@ -64,11 +64,11 @@ npm run build #### git -If the library is hosted at a git repository, e.g.https://github.com/{{#gitUserId}}{{.}}{{/gitUserId}}{{^gitUserId}}YOUR_USERNAME{{/gitUserId}}/{{#gitRepoId}}{{.}}{{/gitRepoId}}{{^gitRepoId}}{{projectName}}{{/gitRepoId}} +If the library is hosted at a git repository, e.g.https://github.com/{{gitUserId}}{{^gitUserId}}YOUR_USERNAME{{/gitUserId}}/{{gitRepoId}}{{^gitRepoId}}{{projectName}}{{/gitRepoId}} then install it via: ```shell - npm install {{#gitUserId}}{{.}}{{/gitUserId}}{{^gitUserId}}YOUR_USERNAME{{/gitUserId}}/{{#gitRepoId}}{{.}}{{/gitRepoId}}{{^gitRepoId}}{{projectName}}{{/gitRepoId}} --save + npm install {{gitUserId}}{{^gitUserId}}YOUR_USERNAME{{/gitUserId}}/{{gitRepoId}}{{^gitRepoId}}{{projectName}}{{/gitRepoId}} --save ``` ### For browser @@ -181,7 +181,7 @@ All URIs are relative to *{{basePath}}* Class | Method | HTTP request | Description ------------ | ------------- | ------------- | ------------- -{{#apiInfo}}{{#apis}}{{#operations}}{{#operation}}*{{moduleName}}.{{classname}}* | [**{{operationId}}**]({{apiDocPath}}{{classname}}.md#{{operationId}}) | **{{httpMethod}}** {{path}} | {{#summary}}{{summary}}{{/summary}} +{{#apiInfo}}{{#apis}}{{#operations}}{{#operation}}*{{moduleName}}.{{classname}}* | [**{{operationId}}**]({{apiDocPath}}{{classname}}.md#{{operationId}}) | **{{httpMethod}}** {{path}} | {{summary}} {{/operation}}{{/operations}}{{/apis}}{{/apiInfo}} ## Documentation for Models diff --git a/modules/openapi-generator/src/main/resources/Javascript-Apollo/api_doc.mustache b/modules/openapi-generator/src/main/resources/Javascript-Apollo/api_doc.mustache index ab08ff8495b..0a68747b73d 100644 --- a/modules/openapi-generator/src/main/resources/Javascript-Apollo/api_doc.mustache +++ b/modules/openapi-generator/src/main/resources/Javascript-Apollo/api_doc.mustache @@ -1,12 +1,12 @@ # {{moduleName}}.{{classname}}{{#description}} -{{description}}{{/description}} +{{.}}{{/description}} All URIs are relative to *{{basePath}}* Method | HTTP request | Description ------------- | ------------- | ------------- -{{#operations}}{{#operation}}[**{{operationId}}**]({{classname}}.md#{{operationId}}) | **{{httpMethod}}** {{path}} | {{#summary}}{{summary}}{{/summary}} +{{#operations}}{{#operation}}[**{{operationId}}**]({{classname}}.md#{{operationId}}) | **{{httpMethod}}** {{path}} | {{summary}} {{/operation}}{{/operations}} {{#operations}} @@ -14,11 +14,11 @@ Method | HTTP request | Description ## {{operationId}} -> {{#returnType}}{{returnType}} {{/returnType}}{{operationId}}({{#requiredParams}}{{{paramName}}}{{^-last}}, {{/-last}}{{/requiredParams}}{{#optionalParams}}{{#-last}}{{#hasRequiredParams}}, {{/hasRequiredParams}}opts{{/-last}}{{/optionalParams}}) +> {{#returnType}}{{.}} {{/returnType}}{{operationId}}({{#requiredParams}}{{{paramName}}}{{^-last}}, {{/-last}}{{/requiredParams}}{{#optionalParams}}{{#-last}}{{#hasRequiredParams}}, {{/hasRequiredParams}}opts{{/-last}}{{/optionalParams}}) {{summary}}{{#notes}} -{{notes}}{{/notes}} +{{.}}{{/notes}} ### Example @@ -92,7 +92,7 @@ apiInstance.{{{operationId}}}({{#requiredParams}}{{{paramName}}}{{^-last}}, {{/- {{^allParams}}This endpoint does not need any parameter.{{/allParams}}{{#allParams}}{{#-last}} Name | Type | Description | Notes ------------- | ------------- | ------------- | -------------{{/-last}}{{/allParams}} -{{#allParams}} **{{paramName}}** | {{#isPrimitiveType}}**{{dataType}}**{{/isPrimitiveType}}{{^isPrimitiveType}}{{#isFile}}**{{dataType}}**{{/isFile}}{{^isFile}}[**{{dataType}}**]({{baseType}}.md){{/isFile}}{{/isPrimitiveType}}| {{description}} | {{^required}}[optional] {{/required}}{{#defaultValue}}[default to {{defaultValue}}]{{/defaultValue}} +{{#allParams}} **{{paramName}}** | {{#isPrimitiveType}}**{{dataType}}**{{/isPrimitiveType}}{{^isPrimitiveType}}{{#isFile}}**{{dataType}}**{{/isFile}}{{^isFile}}[**{{dataType}}**]({{baseType}}.md){{/isFile}}{{/isPrimitiveType}}| {{description}} | {{^required}}[optional] {{/required}}{{#defaultValue}}[default to {{.}}]{{/defaultValue}} {{/allParams}} ### Return type diff --git a/modules/openapi-generator/src/main/resources/Javascript-Apollo/api_test.mustache b/modules/openapi-generator/src/main/resources/Javascript-Apollo/api_test.mustache index e56b66d47e3..f04f1bc3cce 100644 --- a/modules/openapi-generator/src/main/resources/Javascript-Apollo/api_test.mustache +++ b/modules/openapi-generator/src/main/resources/Javascript-Apollo/api_test.mustache @@ -1,6 +1,6 @@ {{>licenseInfo}} // CommonJS-like environments that support module.exports, like Node. -factory(require('expect.js'), require(process.cwd()+'/src/{{#invokerPackage}}{{invokerPackage}}/{{/invokerPackage}}index')); +factory(require('expect.js'), require(process.cwd()+'/src/{{#invokerPackage}}{{.}}/{{/invokerPackage}}index')); 'use strict'; diff --git a/modules/openapi-generator/src/main/resources/Javascript-Apollo/git_push.sh.mustache b/modules/openapi-generator/src/main/resources/Javascript-Apollo/git_push.sh.mustache index 8b3f689c912..f0bed5bd841 100644 --- a/modules/openapi-generator/src/main/resources/Javascript-Apollo/git_push.sh.mustache +++ b/modules/openapi-generator/src/main/resources/Javascript-Apollo/git_push.sh.mustache @@ -55,4 +55,3 @@ git pull origin master # Pushes (Forces) the changes in the local repository up to the remote repository echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" git push origin master 2>&1 | grep -v 'To https' - diff --git a/modules/openapi-generator/src/main/resources/Javascript-Apollo/index.mustache b/modules/openapi-generator/src/main/resources/Javascript-Apollo/index.mustache index 36b8a2032d1..56213101a34 100644 --- a/modules/openapi-generator/src/main/resources/Javascript-Apollo/index.mustache +++ b/modules/openapi-generator/src/main/resources/Javascript-Apollo/index.mustache @@ -1,17 +1,17 @@ {{>licenseInfo}} import ApiClient from './ApiClient'; -{{#models}}import {{#model}}{{classFilename}}{{/model}} from './{{#modelPackage}}{{modelPackage}}/{{/modelPackage}}{{importPath}}'; -{{/models}}{{#apiInfo}}{{#apis}}import {{importPath}} from './{{#apiPackage}}{{apiPackage}}/{{/apiPackage}}{{importPath}}'; +{{#models}}import {{#model}}{{classFilename}}{{/model}} from './{{#modelPackage}}{{.}}/{{/modelPackage}}{{importPath}}'; +{{/models}}{{#apiInfo}}{{#apis}}import {{importPath}} from './{{#apiPackage}}{{.}}/{{/apiPackage}}{{importPath}}'; {{/apis}}{{/apiInfo}} {{#emitJSDoc}}/**{{#projectDescription}} -* {{projectDescription}}.
{{/projectDescription}} +* {{.}}.
{{/projectDescription}} * The index module provides access to constructors for all the classes which comprise the public API. *

* An AMD (recommended!) or CommonJS application will generally do something equivalent to the following: *

-* var {{moduleName}} = require('{{#invokerPackage}}{{invokerPackage}}/{{/invokerPackage}}index'); // See note below*.
+* var {{moduleName}} = require('{{#invokerPackage}}{{.}}/{{/invokerPackage}}index'); // See note below*.
 * var xxxSvc = new {{moduleName}}.XxxApi(); // Allocate the API class we're going to use.
 * var yyyModel = new {{moduleName}}.Yyy(); // Construct a model instance.
 * yyyModel.someProperty = 'someValue';
@@ -19,7 +19,7 @@ import ApiClient from './ApiClient';
 * var zzz = xxxSvc.doSomething(yyyModel); // Invoke the service.
 * ...
 * 
-* *NOTE: For a top-level AMD script, use require(['{{#invokerPackage}}{{invokerPackage}}/{{/invokerPackage}}index'], function(){...}) +* *NOTE: For a top-level AMD script, use require(['{{#invokerPackage}}{{.}}/{{/invokerPackage}}index'], function(){...}) * and put the application logic within the callback function. *

*

@@ -33,7 +33,7 @@ import ApiClient from './ApiClient'; * ... * *

-* @module {{#invokerPackage}}{{invokerPackage}}/{{/invokerPackage}}index +* @module {{#invokerPackage}}{{.}}/{{/invokerPackage}}index * @version {{projectVersion}} */{{/emitJSDoc}} export { diff --git a/modules/openapi-generator/src/main/resources/Javascript-Apollo/licenseInfo.mustache b/modules/openapi-generator/src/main/resources/Javascript-Apollo/licenseInfo.mustache index 40cac6d4a3c..2a386a24226 100644 --- a/modules/openapi-generator/src/main/resources/Javascript-Apollo/licenseInfo.mustache +++ b/modules/openapi-generator/src/main/resources/Javascript-Apollo/licenseInfo.mustache @@ -2,8 +2,8 @@ * {{{appName}}} * {{{appDescription}}} * - * {{#version}}The version of the OpenAPI document: {{{version}}}{{/version}} - * {{#infoEmail}}Contact: {{{infoEmail}}}{{/infoEmail}} + * {{#version}}The version of the OpenAPI document: {{{.}}}{{/version}} + * {{#infoEmail}}Contact: {{{.}}}{{/infoEmail}} * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech diff --git a/modules/openapi-generator/src/main/resources/Javascript-Apollo/model_doc.mustache b/modules/openapi-generator/src/main/resources/Javascript-Apollo/model_doc.mustache index 04ab6f949ac..fc21ae6e9f1 100644 --- a/modules/openapi-generator/src/main/resources/Javascript-Apollo/model_doc.mustache +++ b/modules/openapi-generator/src/main/resources/Javascript-Apollo/model_doc.mustache @@ -11,7 +11,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -{{#vars}}**{{name}}** | {{#isPrimitiveType}}**{{dataType}}**{{/isPrimitiveType}}{{^isPrimitiveType}}[**{{dataType}}**]({{complexType}}.md){{/isPrimitiveType}} | {{description}} | {{^required}}[optional] {{/required}}{{#isReadOnly}}[readonly] {{/isReadOnly}}{{#defaultValue}}[default to {{defaultValue}}]{{/defaultValue}} +{{#vars}}**{{name}}** | {{#isPrimitiveType}}**{{dataType}}**{{/isPrimitiveType}}{{^isPrimitiveType}}[**{{dataType}}**]({{complexType}}.md){{/isPrimitiveType}} | {{description}} | {{^required}}[optional] {{/required}}{{#isReadOnly}}[readonly] {{/isReadOnly}}{{#defaultValue}}[default to {{.}}]{{/defaultValue}} {{/vars}} {{#vars}}{{#isEnum}} diff --git a/modules/openapi-generator/src/main/resources/Javascript-Apollo/model_test.mustache b/modules/openapi-generator/src/main/resources/Javascript-Apollo/model_test.mustache index fb89dd97703..05a03a83459 100644 --- a/modules/openapi-generator/src/main/resources/Javascript-Apollo/model_test.mustache +++ b/modules/openapi-generator/src/main/resources/Javascript-Apollo/model_test.mustache @@ -2,10 +2,10 @@ (function(root, factory) { if (typeof define === 'function' && define.amd) { // AMD. - define(['expect.js', process.cwd()+'/src/{{#invokerPackage}}{{invokerPackage}}/{{/invokerPackage}}index'], factory); + define(['expect.js', process.cwd()+'/src/{{#invokerPackage}}{{.}}/{{/invokerPackage}}index'], factory); } else if (typeof module === 'object' && module.exports) { // CommonJS-like environments that support module.exports, like Node. - factory(require('expect.js'), require(process.cwd()+'/src/{{#invokerPackage}}{{invokerPackage}}/{{/invokerPackage}}index')); + factory(require('expect.js'), require(process.cwd()+'/src/{{#invokerPackage}}{{.}}/{{/invokerPackage}}index')); } else { // Browser globals (root is window) factory(root.expect, root.{{moduleName}}); diff --git a/modules/openapi-generator/src/main/resources/Javascript-Apollo/partial_model_generic.mustache b/modules/openapi-generator/src/main/resources/Javascript-Apollo/partial_model_generic.mustache index c16b43ec4d4..bc69d91c342 100644 --- a/modules/openapi-generator/src/main/resources/Javascript-Apollo/partial_model_generic.mustache +++ b/modules/openapi-generator/src/main/resources/Javascript-Apollo/partial_model_generic.mustache @@ -1,7 +1,7 @@ {{#models}}{{#model}}{{#emitJSDoc}}/** * The {{classname}} model module. - * @module {{#invokerPackage}}{{invokerPackage}}/{{/invokerPackage}}{{#modelPackage}}{{modelPackage}}/{{/modelPackage}}{{classname}} + * @module {{#invokerPackage}}{{.}}/{{/invokerPackage}}{{#modelPackage}}{{.}}/{{/modelPackage}}{{classname}} * @version {{projectVersion}} */{{/emitJSDoc}} class {{classname}} {{#parent}}{{^parentModel}}{{#vendorExtensions.x-is-array}}extends Array {{/vendorExtensions.x-is-array}}{{/parentModel}}{{/parent}}{ @@ -9,9 +9,9 @@ class {{classname}} {{#parent}}{{^parentModel}}{{#vendorExtensions.x-is-array}}e {{#emitJSDoc}}/** * @member {{=< >=}}{<&vendorExtensions.x-jsdoc-type>}<={{ }}=> {{baseName}} * @type {{=< >=}}{<&vendorExtensions.x-jsdoc-type>}<={{ }}=>{{#defaultValue}} - * @default {{{defaultValue}}}{{/defaultValue}} + * @default {{{.}}}{{/defaultValue}} */{{/emitJSDoc}} - {{baseName}}{{#defaultValue}} = {{{defaultValue}}}{{/defaultValue}}; + {{baseName}}{{#defaultValue}} = {{{.}}}{{/defaultValue}}; {{/vars}} {{#useInheritance}}{{#interfaceModels}}{{#allVars}}{{#emitJSDoc}}/** @@ -23,11 +23,11 @@ class {{classname}} {{#parent}}{{^parentModel}}{{#vendorExtensions.x-is-array}}e {{#emitJSDoc}}/** * Constructs a new {{classname}}.{{#description}} - * {{description}}{{/description}} - * @alias module:{{#invokerPackage}}{{invokerPackage}}/{{/invokerPackage}}{{#modelPackage}}{{modelPackage}}/{{/modelPackage}}{{classname}}{{#useInheritance}}{{#parent}} - * @extends {{#parentModel}}module:{{#invokerPackage}}{{invokerPackage}}/{{/invokerPackage}}{{#modelPackage}}{{modelPackage}}/{{/modelPackage}}{{classname}}{{/parentModel}}{{^parentModel}}{{#vendorExtensions.x-is-array}}Array{{/vendorExtensions.x-is-array}}{{#vendorExtensions.x-is-map}}Object{{/vendorExtensions.x-is-map}}{{/parentModel}}{{/parent}}{{#interfaces}} - * @implements module:{{#invokerPackage}}{{invokerPackage}}/{{/invokerPackage}}{{#modelPackage}}{{modelPackage}}/{{/modelPackage}}{{.}}{{/interfaces}}{{/useInheritance}}{{#vendorExtensions.x-all-required}} - * @param {{name}} {{=< >=}}{<&vendorExtensions.x-jsdoc-type>}<={{ }}=> {{#description}}{{{description}}}{{/description}}{{/vendorExtensions.x-all-required}} + * {{.}}{{/description}} + * @alias module:{{#invokerPackage}}{{.}}/{{/invokerPackage}}{{#modelPackage}}{{.}}/{{/modelPackage}}{{classname}}{{#useInheritance}}{{#parent}} + * @extends {{#parentModel}}module:{{#invokerPackage}}{{.}}/{{/invokerPackage}}{{#modelPackage}}{{.}}/{{/modelPackage}}{{classname}}{{/parentModel}}{{^parentModel}}{{#vendorExtensions.x-is-array}}Array{{/vendorExtensions.x-is-array}}{{#vendorExtensions.x-is-map}}Object{{/vendorExtensions.x-is-map}}{{/parentModel}}{{/parent}}{{#interfaces}} + * @implements module:{{#invokerPackage}}{{.}}/{{/invokerPackage}}{{#modelPackage}}{{.}}/{{/modelPackage}}{{.}}{{/interfaces}}{{/useInheritance}}{{#vendorExtensions.x-all-required}} + * @param {{name}} {{=< >=}}{<&vendorExtensions.x-jsdoc-type>}<={{ }}=> {{{description}}}{{/vendorExtensions.x-all-required}} */{{/emitJSDoc}} constructor({{#vendorExtensions.x-all-required}}{{name}}{{^-last}}, {{/-last}}{{/vendorExtensions.x-all-required}}) { {{#parent}}{{^parentModel}}{{#vendorExtensions.x-is-array}} super(); diff --git a/modules/openapi-generator/src/main/resources/Javascript-Closure-Angular/api.mustache b/modules/openapi-generator/src/main/resources/Javascript-Closure-Angular/api.mustache index 069668e480c..41a6f09bede 100644 --- a/modules/openapi-generator/src/main/resources/Javascript-Closure-Angular/api.mustache +++ b/modules/openapi-generator/src/main/resources/Javascript-Closure-Angular/api.mustache @@ -4,8 +4,8 @@ * generated.{{#appDescription}} * * {{ appDescription }}{{/appDescription}}{{#version}} - * Version: {{version}}{{/version}}{{#appContact}} - * Contact: {{appContact}}{{/appContact}} + * Version: {{.}}{{/version}}{{#appContact}} + * Contact: {{.}}{{/appContact}} {{^hideGenerationTimestamp}} * Generated at: {{generatedDate}} {{/hideGenerationTimestamp}} @@ -13,7 +13,7 @@ */{{#licenseInfo}} /** * @license {{licenseInfo}}{{#licenseUrl}} - * {{licenseUrl}}{{/licenseUrl}} + * {{.}}{{/licenseUrl}} */ {{/licenseInfo}} @@ -60,7 +60,7 @@ goog.require('{{import}}'); * {{notes}}{{#allParams}} * @param {!{{{dataType}}}{{^required}}={{/required}}} {{^required}}opt_{{/required}}{{paramName}} {{description}}{{/allParams}} * @param {!angular.$http.Config=} opt_extraHttpRequestParams Extra HTTP parameters to send. - * @return {!angular.$q.Promise{{#returnType}}{{/returnType}}} + * @return {!angular.$q.Promise{{#returnType}}{{/returnType}}} */ {{package}}.{{classname}}.prototype.{{nickname}} = function({{#allParams}}{{^required}}opt_{{/required}}{{paramName}}, {{/allParams}}opt_extraHttpRequestParams) { /** @const {string} */ diff --git a/modules/openapi-generator/src/main/resources/Javascript-Closure-Angular/es6/api.mustache b/modules/openapi-generator/src/main/resources/Javascript-Closure-Angular/es6/api.mustache index ffb87706783..17a5c8c446a 100644 --- a/modules/openapi-generator/src/main/resources/Javascript-Closure-Angular/es6/api.mustache +++ b/modules/openapi-generator/src/main/resources/Javascript-Closure-Angular/es6/api.mustache @@ -4,8 +4,8 @@ * generated.{{#appDescription}} * * {{ appDescription }}{{/appDescription}}{{#version}} - * Version: {{version}}{{/version}}{{#appContact}} - * Contact: {{appContact}}{{/appContact}} + * Version: {{.}}{{/version}}{{#appContact}} + * Contact: {{.}}{{/appContact}} {{^hideGenerationTimestamp}} * Generated at: {{generatedDate}} {{/hideGenerationTimestamp}} @@ -13,7 +13,7 @@ */{{#licenseInfo}} /** * @license {{licenseInfo}}{{#licenseUrl}} - * {{licenseUrl}}{{/licenseUrl}} + * {{.}}{{/licenseUrl}} */ {{/licenseInfo}} diff --git a/modules/openapi-generator/src/main/resources/Javascript-Closure-Angular/model.mustache b/modules/openapi-generator/src/main/resources/Javascript-Closure-Angular/model.mustache index 97b9574f04c..ef59e84148f 100644 --- a/modules/openapi-generator/src/main/resources/Javascript-Closure-Angular/model.mustache +++ b/modules/openapi-generator/src/main/resources/Javascript-Closure-Angular/model.mustache @@ -8,7 +8,7 @@ goog.provide('{{package}}.{{name}}'); {{#model}} /** {{#description}} - * {{{description}}} + * {{{.}}} {{/description}} * @record */ @@ -17,7 +17,7 @@ goog.provide('{{package}}.{{name}}'); /** {{#description}} - * {{{description}}} + * {{{.}}} {{/description}} {{! Explicitly force types to be non-nullable using !. This is redundant but valid }} * @type {!{{{dataType}}}} diff --git a/modules/openapi-generator/src/main/resources/Javascript-Flowtyped/api.mustache b/modules/openapi-generator/src/main/resources/Javascript-Flowtyped/api.mustache index ccfed6298ec..94c168b551b 100644 --- a/modules/openapi-generator/src/main/resources/Javascript-Flowtyped/api.mustache +++ b/modules/openapi-generator/src/main/resources/Javascript-Flowtyped/api.mustache @@ -226,13 +226,13 @@ export const {{classname}}FetchParamCreator = function (configuration?: Configur }; export type {{classname}}Type = { {{#operation}} - {{operationId}}({{#allParams}}{{paramName}}{{^required}}?{{/required}}: {{{dataType}}}, {{/allParams}}options?: RequestOptions): Promise<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}Response{{/returnType}}>, + {{operationId}}({{#allParams}}{{paramName}}{{^required}}?{{/required}}: {{{dataType}}}, {{/allParams}}options?: RequestOptions): Promise<{{{returnType}}}{{^returnType}}Response{{/returnType}}>, {{/operation}} } /** * {{classname}} - factory function to inject configuration {{#description}} - * {{{description}}}{{/description}} + * {{{.}}}{{/description}} * @export */ export const {{classname}} = function(configuration?: Configuration, fetch: FetchAPI = portableFetch): {{classname}}Type { @@ -246,7 +246,7 @@ export const {{classname}} = function(configuration?: Configuration, fetch: Fetc {{/summary}} * @throws {RequiredError} */ - {{operationId}}({{#allParams}}{{paramName}}{{^required}}?{{/required}}: {{{dataType}}}, {{/allParams}}options?: RequestOptions = {}): Promise<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}Response{{/returnType}}> { + {{operationId}}({{#allParams}}{{paramName}}{{^required}}?{{/required}}: {{{dataType}}}, {{/allParams}}options?: RequestOptions = {}): Promise<{{{returnType}}}{{^returnType}}Response{{/returnType}}> { const localVarFetchArgs = {{classname}}FetchParamCreator(configuration).{{operationId}}({{#allParams}}{{paramName}}, {{/allParams}}options); return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then((response) => { if (response.status >= 200 && response.status < 300) { diff --git a/modules/openapi-generator/src/main/resources/Javascript-Flowtyped/licenseInfo.mustache b/modules/openapi-generator/src/main/resources/Javascript-Flowtyped/licenseInfo.mustache index 38c3c518887..05f68fbd3f0 100644 --- a/modules/openapi-generator/src/main/resources/Javascript-Flowtyped/licenseInfo.mustache +++ b/modules/openapi-generator/src/main/resources/Javascript-Flowtyped/licenseInfo.mustache @@ -3,10 +3,10 @@ * {{{appDescription}}} * {{#version}} - * The version of the OpenAPI document: {{{version}}} + * The version of the OpenAPI document: {{{.}}} {{/version}} {{#infoEmail}} - * Contact: {{{infoEmail}}} + * Contact: {{{.}}} {{/infoEmail}} * * NOTE: This class is auto generated by OpenAPI-Generator diff --git a/modules/openapi-generator/src/main/resources/Javascript-Flowtyped/modelGeneric.mustache b/modules/openapi-generator/src/main/resources/Javascript-Flowtyped/modelGeneric.mustache index 143ca85238c..1ed248653db 100644 --- a/modules/openapi-generator/src/main/resources/Javascript-Flowtyped/modelGeneric.mustache +++ b/modules/openapi-generator/src/main/resources/Javascript-Flowtyped/modelGeneric.mustache @@ -23,5 +23,4 @@ export type {{classname}} = { */ {{name}}{{^required}}?{{/required}}: {{#isEnum}}{{{datatypeWithEnum}}}{{/isEnum}}{{^isEnum}}{{{datatype}}}{{/isEnum}}; {{/vars}} -}{{#parent}} & {{parent}}{{/parent}} - +}{{#parent}} & {{.}}{{/parent}} diff --git a/modules/openapi-generator/src/main/resources/Javascript/ApiClient.mustache b/modules/openapi-generator/src/main/resources/Javascript/ApiClient.mustache index 49f0c1f17e0..eebfd6bd884 100644 --- a/modules/openapi-generator/src/main/resources/Javascript/ApiClient.mustache +++ b/modules/openapi-generator/src/main/resources/Javascript/ApiClient.mustache @@ -17,7 +17,7 @@ 'use strict'; {{#emitJSDoc}} /** - * @module {{#invokerPackage}}{{invokerPackage}}/{{/invokerPackage}}ApiClient + * @module {{#invokerPackage}}{{.}}/{{/invokerPackage}}ApiClient * @version {{projectVersion}} */ @@ -25,7 +25,7 @@ * Manages low level client-server communications, parameter marshalling, etc. There should not be any need for an * application to use this class directly - the *Api and model classes provide the public API for the service. The * contents of this file should be regarded as internal but are documented for completeness. - * @alias module:{{#invokerPackage}}{{invokerPackage}}/{{/invokerPackage}}ApiClient + * @alias module:{{#invokerPackage}}{{.}}/{{/invokerPackage}}ApiClient * @class */ {{/emitJSDoc}} var exports = function() { @@ -296,7 +296,7 @@ /** * Builds a string representation of an array-type actual parameter, according to the given collection format. * @param {Array} param An array parameter. - * @param {module:{{#invokerPackage}}{{invokerPackage}}/{{/invokerPackage}}ApiClient.CollectionFormatEnum} collectionFormat The array element separator strategy. + * @param {module:{{#invokerPackage}}{{.}}/{{/invokerPackage}}ApiClient.CollectionFormatEnum} collectionFormat The array element separator strategy. * @returns {String|Array} A string representation of the supplied collection, using the specified delimiter. Returns * param as is if collectionFormat is multi. */ @@ -397,7 +397,7 @@ {{#emitJSDoc}}{{^usePromises}} /** * Callback function to receive the result of the operation. - * @callback module:{{#invokerPackage}}{{invokerPackage}}/{{/invokerPackage}}ApiClient~callApiCallback + * @callback module:{{#invokerPackage}}{{.}}/{{/invokerPackage}}ApiClient~callApiCallback * @param {String} error Error message, if any. * @param data The data returned by the service call. * @param {String} response The complete HTTP response. @@ -418,7 +418,7 @@ * @param {Array.} accepts An array of acceptable response MIME types. * @param {(String|Array|ObjectFunction)} returnType The required type to return; can be a string for simple types or the * constructor for a complex type.{{^usePromises}} - * @param {module:{{#invokerPackage}}{{invokerPackage}}/{{/invokerPackage}}ApiClient~callApiCallback} callback The callback function.{{/usePromises}} + * @param {module:{{#invokerPackage}}{{.}}/{{/invokerPackage}}ApiClient~callApiCallback} callback The callback function.{{/usePromises}} * @returns {{#usePromises}}{Promise} A {@link https://www.promisejs.org/|Promise} object{{/usePromises}}{{^usePromises}}{Object} The SuperAgent request object{{/usePromises}}. */ {{/emitJSDoc}} exports.prototype.callApi = function callApi(path, httpMethod, pathParams, @@ -734,7 +734,7 @@ {{#emitJSDoc}} /** * The default API client implementation. - * @type {module:{{#invokerPackage}}{{invokerPackage}}/{{/invokerPackage}}ApiClient} + * @type {module:{{#invokerPackage}}{{.}}/{{/invokerPackage}}ApiClient} */ {{/emitJSDoc}} exports.instance = new exports(); diff --git a/modules/openapi-generator/src/main/resources/Javascript/README.mustache b/modules/openapi-generator/src/main/resources/Javascript/README.mustache index fccb79dce5b..fbf461bdde4 100644 --- a/modules/openapi-generator/src/main/resources/Javascript/README.mustache +++ b/modules/openapi-generator/src/main/resources/Javascript/README.mustache @@ -2,7 +2,7 @@ {{moduleName}} - JavaScript client for {{projectName}} {{#appDescriptionWithNewLines}} -{{{appDescriptionWithNewLines}}} +{{{.}}} {{/appDescriptionWithNewLines}} This SDK is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: @@ -54,11 +54,11 @@ You should now be able to `require('{{{projectName}}}')` in javascript files fro ### git -If the library is hosted at a git repository, e.g. https://github.com/{{#gitUserId}}{{.}}{{/gitUserId}}{{^gitUserId}}YOUR_USERNAME{{/gitUserId}}/{{#gitRepoId}}{{.}}{{/gitRepoId}}{{^gitRepoId}}{{projectName}}{{/gitRepoId}} +If the library is hosted at a git repository, e.g. https://github.com/{{gitUserId}}{{^gitUserId}}YOUR_USERNAME{{/gitUserId}}/{{gitRepoId}}{{^gitRepoId}}{{projectName}}{{/gitRepoId}} then install it via: ```shell - npm install {{#gitUserId}}{{.}}{{/gitUserId}}{{^gitUserId}}YOUR_USERNAME{{/gitUserId}}/{{#gitRepoId}}{{.}}{{/gitRepoId}}{{^gitRepoId}}{{projectName}}{{/gitRepoId}} --save + npm install {{gitUserId}}{{^gitUserId}}YOUR_USERNAME{{/gitUserId}}/{{gitRepoId}}{{^gitRepoId}}{{projectName}}{{/gitRepoId}} --save ``` ### For browser @@ -167,7 +167,7 @@ All URIs are relative to *{{basePath}}* Class | Method | HTTP request | Description ------------ | ------------- | ------------- | ------------- -{{#apiInfo}}{{#apis}}{{#operations}}{{#operation}}*{{moduleName}}.{{classname}}* | [**{{operationId}}**]({{apiDocPath}}{{classname}}.md#{{operationId}}) | **{{httpMethod}}** {{path}} | {{#summary}}{{summary}}{{/summary}} +{{#apiInfo}}{{#apis}}{{#operations}}{{#operation}}*{{moduleName}}.{{classname}}* | [**{{operationId}}**]({{apiDocPath}}{{classname}}.md#{{operationId}}) | **{{httpMethod}}** {{path}} | {{summary}} {{/operation}}{{/operations}}{{/apis}}{{/apiInfo}} ## Documentation for Models diff --git a/modules/openapi-generator/src/main/resources/Javascript/api_doc.mustache b/modules/openapi-generator/src/main/resources/Javascript/api_doc.mustache index b934e0042d1..05a9d1e042c 100644 --- a/modules/openapi-generator/src/main/resources/Javascript/api_doc.mustache +++ b/modules/openapi-generator/src/main/resources/Javascript/api_doc.mustache @@ -1,12 +1,12 @@ # {{moduleName}}.{{classname}}{{#description}} -{{description}}{{/description}} +{{.}}{{/description}} All URIs are relative to *{{basePath}}* Method | HTTP request | Description ------------- | ------------- | ------------- -{{#operations}}{{#operation}}[**{{operationId}}**]({{classname}}.md#{{operationId}}) | **{{httpMethod}}** {{path}} | {{#summary}}{{summary}}{{/summary}} +{{#operations}}{{#operation}}[**{{operationId}}**]({{classname}}.md#{{operationId}}) | **{{httpMethod}}** {{path}} | {{summary}} {{/operation}}{{/operations}} {{#operations}} @@ -14,11 +14,11 @@ Method | HTTP request | Description ## {{operationId}} -> {{#returnType}}{{returnType}} {{/returnType}}{{operationId}}({{#requiredParams}}{{{paramName}}}{{^-last}}, {{/-last}}{{/requiredParams}}{{#optionalParams}}{{#-last}}{{#hasRequiredParams}}, {{/hasRequiredParams}}opts{{/-last}}{{/optionalParams}}) +> {{#returnType}}{{.}} {{/returnType}}{{operationId}}({{#requiredParams}}{{{paramName}}}{{^-last}}, {{/-last}}{{/requiredParams}}{{#optionalParams}}{{#-last}}{{#hasRequiredParams}}, {{/hasRequiredParams}}opts{{/-last}}{{/optionalParams}}) {{summary}}{{#notes}} -{{notes}}{{/notes}} +{{.}}{{/notes}} ### Example @@ -94,7 +94,7 @@ apiInstance.{{{operationId}}}({{#requiredParams}}{{{paramName}}}{{^-last}}, {{/- Name | Type | Description | Notes ------------- | ------------- | ------------- | -------------{{/-last}}{{/allParams}} -{{#allParams}} **{{paramName}}** | {{#isPrimitiveType}}**{{dataType}}**{{/isPrimitiveType}}{{^isPrimitiveType}}{{#isFile}}**{{dataType}}**{{/isFile}}{{^isFile}}[**{{dataType}}**]({{baseType}}.md){{/isFile}}{{/isPrimitiveType}}| {{description}} | {{^required}}[optional] {{/required}}{{#defaultValue}}[default to {{defaultValue}}]{{/defaultValue}} +{{#allParams}} **{{paramName}}** | {{#isPrimitiveType}}**{{dataType}}**{{/isPrimitiveType}}{{^isPrimitiveType}}{{#isFile}}**{{dataType}}**{{/isFile}}{{^isFile}}[**{{dataType}}**]({{baseType}}.md){{/isFile}}{{/isPrimitiveType}}| {{description}} | {{^required}}[optional] {{/required}}{{#defaultValue}}[default to {{.}}]{{/defaultValue}} {{/allParams}} ### Return type diff --git a/modules/openapi-generator/src/main/resources/Javascript/api_test.mustache b/modules/openapi-generator/src/main/resources/Javascript/api_test.mustache index 1107702d3fa..398e3041a71 100644 --- a/modules/openapi-generator/src/main/resources/Javascript/api_test.mustache +++ b/modules/openapi-generator/src/main/resources/Javascript/api_test.mustache @@ -2,10 +2,10 @@ (function(root, factory) { if (typeof define === 'function' && define.amd) { // AMD. - define(['expect.js', process.cwd()+'/src/{{#invokerPackage}}{{invokerPackage}}/{{/invokerPackage}}index'], factory); + define(['expect.js', process.cwd()+'/src/{{#invokerPackage}}{{.}}/{{/invokerPackage}}index'], factory); } else if (typeof module === 'object' && module.exports) { // CommonJS-like environments that support module.exports, like Node. - factory(require('expect.js'), require(process.cwd()+'/src/{{#invokerPackage}}{{invokerPackage}}/{{/invokerPackage}}index')); + factory(require('expect.js'), require(process.cwd()+'/src/{{#invokerPackage}}{{.}}/{{/invokerPackage}}index')); } else { // Browser globals (root is window) factory(root.expect, root.{{moduleName}}); diff --git a/modules/openapi-generator/src/main/resources/Javascript/es6/ApiClient.mustache b/modules/openapi-generator/src/main/resources/Javascript/es6/ApiClient.mustache index 35325e5276d..de2134ade06 100644 --- a/modules/openapi-generator/src/main/resources/Javascript/es6/ApiClient.mustache +++ b/modules/openapi-generator/src/main/resources/Javascript/es6/ApiClient.mustache @@ -4,7 +4,7 @@ import superagent from "superagent"; import querystring from "querystring"; {{#emitJSDoc}}/** -* @module {{#invokerPackage}}{{invokerPackage}}/{{/invokerPackage}}ApiClient +* @module {{#invokerPackage}}{{.}}/{{/invokerPackage}}ApiClient * @version {{projectVersion}} */ @@ -12,7 +12,7 @@ import querystring from "querystring"; * Manages low level client-server communications, parameter marshalling, etc. There should not be any need for an * application to use this class directly - the *Api and model classes provide the public API for the service. The * contents of this file should be regarded as internal but are documented for completeness. -* @alias module:{{#invokerPackage}}{{invokerPackage}}/{{/invokerPackage}}ApiClient +* @alias module:{{#invokerPackage}}{{.}}/{{/invokerPackage}}ApiClient * @class */{{/emitJSDoc}} class ApiClient { @@ -53,7 +53,7 @@ class ApiClient { * @default {} */{{/emitJSDoc}} this.defaultHeaders = { - 'User-Agent': '{{#httpUserAgent}}{{{.}}}{{/httpUserAgent}}{{^httpUserAgent}}OpenAPI-Generator/{{projectVersion}}/Javascript{{/httpUserAgent}}' + 'User-Agent': '{{{httpUserAgent}}}{{^httpUserAgent}}OpenAPI-Generator/{{projectVersion}}/Javascript{{/httpUserAgent}}' }; /** @@ -264,7 +264,7 @@ class ApiClient { {{#emitJSDoc}}/** * Builds a string representation of an array-type actual parameter, according to the given collection format. * @param {Array} param An array parameter. - * @param {module:{{#invokerPackage}}{{invokerPackage}}/{{/invokerPackage}}ApiClient.CollectionFormatEnum} collectionFormat The array element separator strategy. + * @param {module:{{#invokerPackage}}{{.}}/{{/invokerPackage}}ApiClient.CollectionFormatEnum} collectionFormat The array element separator strategy. * @returns {String|Array} A string representation of the supplied collection, using the specified delimiter. Returns * param as is if collectionFormat is multi. */{{/emitJSDoc}} @@ -375,7 +375,7 @@ class ApiClient { {{^usePromises}} /** * Callback function to receive the result of the operation. - * @callback module:{{#invokerPackage}}{{invokerPackage}}/{{/invokerPackage}}ApiClient~callApiCallback + * @callback module:{{#invokerPackage}}{{.}}/{{/invokerPackage}}ApiClient~callApiCallback * @param {String} error Error message, if any. * @param data The data returned by the service call. * @param {String} response The complete HTTP response. @@ -400,7 +400,7 @@ class ApiClient { * constructor for a complex type. * @param {String} apiBasePath base path defined in the operation/path level to override the default one {{^usePromises}} - * @param {module:{{#invokerPackage}}{{invokerPackage}}/{{/invokerPackage}}ApiClient~callApiCallback} callback The callback function. + * @param {module:{{#invokerPackage}}{{.}}/{{/invokerPackage}}ApiClient~callApiCallback} callback The callback function. {{/usePromises}} * @returns {{#usePromises}}{Promise} A {@link https://www.promisejs.org/|Promise} object{{/usePromises}}{{^usePromises}}{Object} The SuperAgent request object{{/usePromises}}. */ @@ -755,7 +755,7 @@ ApiClient.CollectionFormatEnum = { {{#emitJSDoc}}/** * The default API client implementation. -* @type {module:{{#invokerPackage}}{{invokerPackage}}/{{/invokerPackage}}ApiClient} +* @type {module:{{#invokerPackage}}{{.}}/{{/invokerPackage}}ApiClient} */{{/emitJSDoc}} ApiClient.instance = new ApiClient(); export default ApiClient; diff --git a/modules/openapi-generator/src/main/resources/Javascript/es6/README.mustache b/modules/openapi-generator/src/main/resources/Javascript/es6/README.mustache index dd4a6721a2d..0ac4e62d2f5 100644 --- a/modules/openapi-generator/src/main/resources/Javascript/es6/README.mustache +++ b/modules/openapi-generator/src/main/resources/Javascript/es6/README.mustache @@ -2,7 +2,7 @@ {{moduleName}} - JavaScript client for {{projectName}} {{#appDescriptionWithNewLines}} -{{{appDescriptionWithNewLines}}} +{{{.}}} {{/appDescriptionWithNewLines}} This SDK is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: @@ -64,11 +64,11 @@ npm run build #### git -If the library is hosted at a git repository, e.g.https://github.com/{{#gitUserId}}{{.}}{{/gitUserId}}{{^gitUserId}}YOUR_USERNAME{{/gitUserId}}/{{#gitRepoId}}{{.}}{{/gitRepoId}}{{^gitRepoId}}{{projectName}}{{/gitRepoId}} +If the library is hosted at a git repository, e.g.https://github.com/{{gitUserId}}{{^gitUserId}}YOUR_USERNAME{{/gitUserId}}/{{gitRepoId}}{{^gitRepoId}}{{projectName}}{{/gitRepoId}} then install it via: ```shell - npm install {{#gitUserId}}{{.}}{{/gitUserId}}{{^gitUserId}}YOUR_USERNAME{{/gitUserId}}/{{#gitRepoId}}{{.}}{{/gitRepoId}}{{^gitRepoId}}{{projectName}}{{/gitRepoId}} --save + npm install {{gitUserId}}{{^gitUserId}}YOUR_USERNAME{{/gitUserId}}/{{gitRepoId}}{{^gitRepoId}}{{projectName}}{{/gitRepoId}} --save ``` ### For browser @@ -181,7 +181,7 @@ All URIs are relative to *{{basePath}}* Class | Method | HTTP request | Description ------------ | ------------- | ------------- | ------------- -{{#apiInfo}}{{#apis}}{{#operations}}{{#operation}}*{{moduleName}}.{{classname}}* | [**{{operationId}}**]({{apiDocPath}}{{classname}}.md#{{operationId}}) | **{{httpMethod}}** {{path}} | {{#summary}}{{summary}}{{/summary}} +{{#apiInfo}}{{#apis}}{{#operations}}{{#operation}}*{{moduleName}}.{{classname}}* | [**{{operationId}}**]({{apiDocPath}}{{classname}}.md#{{operationId}}) | **{{httpMethod}}** {{path}} | {{summary}} {{/operation}}{{/operations}}{{/apis}}{{/apiInfo}} ## Documentation for Models diff --git a/modules/openapi-generator/src/main/resources/Javascript/es6/api_doc.mustache b/modules/openapi-generator/src/main/resources/Javascript/es6/api_doc.mustache index ab08ff8495b..0a68747b73d 100644 --- a/modules/openapi-generator/src/main/resources/Javascript/es6/api_doc.mustache +++ b/modules/openapi-generator/src/main/resources/Javascript/es6/api_doc.mustache @@ -1,12 +1,12 @@ # {{moduleName}}.{{classname}}{{#description}} -{{description}}{{/description}} +{{.}}{{/description}} All URIs are relative to *{{basePath}}* Method | HTTP request | Description ------------- | ------------- | ------------- -{{#operations}}{{#operation}}[**{{operationId}}**]({{classname}}.md#{{operationId}}) | **{{httpMethod}}** {{path}} | {{#summary}}{{summary}}{{/summary}} +{{#operations}}{{#operation}}[**{{operationId}}**]({{classname}}.md#{{operationId}}) | **{{httpMethod}}** {{path}} | {{summary}} {{/operation}}{{/operations}} {{#operations}} @@ -14,11 +14,11 @@ Method | HTTP request | Description ## {{operationId}} -> {{#returnType}}{{returnType}} {{/returnType}}{{operationId}}({{#requiredParams}}{{{paramName}}}{{^-last}}, {{/-last}}{{/requiredParams}}{{#optionalParams}}{{#-last}}{{#hasRequiredParams}}, {{/hasRequiredParams}}opts{{/-last}}{{/optionalParams}}) +> {{#returnType}}{{.}} {{/returnType}}{{operationId}}({{#requiredParams}}{{{paramName}}}{{^-last}}, {{/-last}}{{/requiredParams}}{{#optionalParams}}{{#-last}}{{#hasRequiredParams}}, {{/hasRequiredParams}}opts{{/-last}}{{/optionalParams}}) {{summary}}{{#notes}} -{{notes}}{{/notes}} +{{.}}{{/notes}} ### Example @@ -92,7 +92,7 @@ apiInstance.{{{operationId}}}({{#requiredParams}}{{{paramName}}}{{^-last}}, {{/- {{^allParams}}This endpoint does not need any parameter.{{/allParams}}{{#allParams}}{{#-last}} Name | Type | Description | Notes ------------- | ------------- | ------------- | -------------{{/-last}}{{/allParams}} -{{#allParams}} **{{paramName}}** | {{#isPrimitiveType}}**{{dataType}}**{{/isPrimitiveType}}{{^isPrimitiveType}}{{#isFile}}**{{dataType}}**{{/isFile}}{{^isFile}}[**{{dataType}}**]({{baseType}}.md){{/isFile}}{{/isPrimitiveType}}| {{description}} | {{^required}}[optional] {{/required}}{{#defaultValue}}[default to {{defaultValue}}]{{/defaultValue}} +{{#allParams}} **{{paramName}}** | {{#isPrimitiveType}}**{{dataType}}**{{/isPrimitiveType}}{{^isPrimitiveType}}{{#isFile}}**{{dataType}}**{{/isFile}}{{^isFile}}[**{{dataType}}**]({{baseType}}.md){{/isFile}}{{/isPrimitiveType}}| {{description}} | {{^required}}[optional] {{/required}}{{#defaultValue}}[default to {{.}}]{{/defaultValue}} {{/allParams}} ### Return type diff --git a/modules/openapi-generator/src/main/resources/Javascript/es6/api_test.mustache b/modules/openapi-generator/src/main/resources/Javascript/es6/api_test.mustache index 1107702d3fa..398e3041a71 100644 --- a/modules/openapi-generator/src/main/resources/Javascript/es6/api_test.mustache +++ b/modules/openapi-generator/src/main/resources/Javascript/es6/api_test.mustache @@ -2,10 +2,10 @@ (function(root, factory) { if (typeof define === 'function' && define.amd) { // AMD. - define(['expect.js', process.cwd()+'/src/{{#invokerPackage}}{{invokerPackage}}/{{/invokerPackage}}index'], factory); + define(['expect.js', process.cwd()+'/src/{{#invokerPackage}}{{.}}/{{/invokerPackage}}index'], factory); } else if (typeof module === 'object' && module.exports) { // CommonJS-like environments that support module.exports, like Node. - factory(require('expect.js'), require(process.cwd()+'/src/{{#invokerPackage}}{{invokerPackage}}/{{/invokerPackage}}index')); + factory(require('expect.js'), require(process.cwd()+'/src/{{#invokerPackage}}{{.}}/{{/invokerPackage}}index')); } else { // Browser globals (root is window) factory(root.expect, root.{{moduleName}}); diff --git a/modules/openapi-generator/src/main/resources/Javascript/es6/git_push.sh.mustache b/modules/openapi-generator/src/main/resources/Javascript/es6/git_push.sh.mustache index 8b3f689c912..f0bed5bd841 100644 --- a/modules/openapi-generator/src/main/resources/Javascript/es6/git_push.sh.mustache +++ b/modules/openapi-generator/src/main/resources/Javascript/es6/git_push.sh.mustache @@ -55,4 +55,3 @@ git pull origin master # Pushes (Forces) the changes in the local repository up to the remote repository echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" git push origin master 2>&1 | grep -v 'To https' - diff --git a/modules/openapi-generator/src/main/resources/Javascript/es6/index.mustache b/modules/openapi-generator/src/main/resources/Javascript/es6/index.mustache index 36b8a2032d1..56213101a34 100644 --- a/modules/openapi-generator/src/main/resources/Javascript/es6/index.mustache +++ b/modules/openapi-generator/src/main/resources/Javascript/es6/index.mustache @@ -1,17 +1,17 @@ {{>licenseInfo}} import ApiClient from './ApiClient'; -{{#models}}import {{#model}}{{classFilename}}{{/model}} from './{{#modelPackage}}{{modelPackage}}/{{/modelPackage}}{{importPath}}'; -{{/models}}{{#apiInfo}}{{#apis}}import {{importPath}} from './{{#apiPackage}}{{apiPackage}}/{{/apiPackage}}{{importPath}}'; +{{#models}}import {{#model}}{{classFilename}}{{/model}} from './{{#modelPackage}}{{.}}/{{/modelPackage}}{{importPath}}'; +{{/models}}{{#apiInfo}}{{#apis}}import {{importPath}} from './{{#apiPackage}}{{.}}/{{/apiPackage}}{{importPath}}'; {{/apis}}{{/apiInfo}} {{#emitJSDoc}}/**{{#projectDescription}} -* {{projectDescription}}.
{{/projectDescription}} +* {{.}}.
{{/projectDescription}} * The index module provides access to constructors for all the classes which comprise the public API. *

* An AMD (recommended!) or CommonJS application will generally do something equivalent to the following: *

-* var {{moduleName}} = require('{{#invokerPackage}}{{invokerPackage}}/{{/invokerPackage}}index'); // See note below*.
+* var {{moduleName}} = require('{{#invokerPackage}}{{.}}/{{/invokerPackage}}index'); // See note below*.
 * var xxxSvc = new {{moduleName}}.XxxApi(); // Allocate the API class we're going to use.
 * var yyyModel = new {{moduleName}}.Yyy(); // Construct a model instance.
 * yyyModel.someProperty = 'someValue';
@@ -19,7 +19,7 @@ import ApiClient from './ApiClient';
 * var zzz = xxxSvc.doSomething(yyyModel); // Invoke the service.
 * ...
 * 
-* *NOTE: For a top-level AMD script, use require(['{{#invokerPackage}}{{invokerPackage}}/{{/invokerPackage}}index'], function(){...}) +* *NOTE: For a top-level AMD script, use require(['{{#invokerPackage}}{{.}}/{{/invokerPackage}}index'], function(){...}) * and put the application logic within the callback function. *

*

@@ -33,7 +33,7 @@ import ApiClient from './ApiClient'; * ... * *

-* @module {{#invokerPackage}}{{invokerPackage}}/{{/invokerPackage}}index +* @module {{#invokerPackage}}{{.}}/{{/invokerPackage}}index * @version {{projectVersion}} */{{/emitJSDoc}} export { diff --git a/modules/openapi-generator/src/main/resources/Javascript/es6/licenseInfo.mustache b/modules/openapi-generator/src/main/resources/Javascript/es6/licenseInfo.mustache index 40cac6d4a3c..2a386a24226 100644 --- a/modules/openapi-generator/src/main/resources/Javascript/es6/licenseInfo.mustache +++ b/modules/openapi-generator/src/main/resources/Javascript/es6/licenseInfo.mustache @@ -2,8 +2,8 @@ * {{{appName}}} * {{{appDescription}}} * - * {{#version}}The version of the OpenAPI document: {{{version}}}{{/version}} - * {{#infoEmail}}Contact: {{{infoEmail}}}{{/infoEmail}} + * {{#version}}The version of the OpenAPI document: {{{.}}}{{/version}} + * {{#infoEmail}}Contact: {{{.}}}{{/infoEmail}} * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech diff --git a/modules/openapi-generator/src/main/resources/Javascript/es6/model_doc.mustache b/modules/openapi-generator/src/main/resources/Javascript/es6/model_doc.mustache index 04ab6f949ac..fc21ae6e9f1 100644 --- a/modules/openapi-generator/src/main/resources/Javascript/es6/model_doc.mustache +++ b/modules/openapi-generator/src/main/resources/Javascript/es6/model_doc.mustache @@ -11,7 +11,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -{{#vars}}**{{name}}** | {{#isPrimitiveType}}**{{dataType}}**{{/isPrimitiveType}}{{^isPrimitiveType}}[**{{dataType}}**]({{complexType}}.md){{/isPrimitiveType}} | {{description}} | {{^required}}[optional] {{/required}}{{#isReadOnly}}[readonly] {{/isReadOnly}}{{#defaultValue}}[default to {{defaultValue}}]{{/defaultValue}} +{{#vars}}**{{name}}** | {{#isPrimitiveType}}**{{dataType}}**{{/isPrimitiveType}}{{^isPrimitiveType}}[**{{dataType}}**]({{complexType}}.md){{/isPrimitiveType}} | {{description}} | {{^required}}[optional] {{/required}}{{#isReadOnly}}[readonly] {{/isReadOnly}}{{#defaultValue}}[default to {{.}}]{{/defaultValue}} {{/vars}} {{#vars}}{{#isEnum}} diff --git a/modules/openapi-generator/src/main/resources/Javascript/es6/model_test.mustache b/modules/openapi-generator/src/main/resources/Javascript/es6/model_test.mustache index 8769cfeb870..ec7842a6722 100644 --- a/modules/openapi-generator/src/main/resources/Javascript/es6/model_test.mustache +++ b/modules/openapi-generator/src/main/resources/Javascript/es6/model_test.mustache @@ -2,10 +2,10 @@ (function(root, factory) { if (typeof define === 'function' && define.amd) { // AMD. - define(['expect.js', process.cwd()+'/src/{{#invokerPackage}}{{invokerPackage}}/{{/invokerPackage}}index'], factory); + define(['expect.js', process.cwd()+'/src/{{#invokerPackage}}{{.}}/{{/invokerPackage}}index'], factory); } else if (typeof module === 'object' && module.exports) { // CommonJS-like environments that support module.exports, like Node. - factory(require('expect.js'), require(process.cwd()+'/src/{{#invokerPackage}}{{invokerPackage}}/{{/invokerPackage}}index')); + factory(require('expect.js'), require(process.cwd()+'/src/{{#invokerPackage}}{{.}}/{{/invokerPackage}}index')); } else { // Browser globals (root is window) factory(root.expect, root.{{moduleName}}); diff --git a/modules/openapi-generator/src/main/resources/Javascript/es6/package.mustache b/modules/openapi-generator/src/main/resources/Javascript/es6/package.mustache index c59eff4b033..06b3a11c266 100644 --- a/modules/openapi-generator/src/main/resources/Javascript/es6/package.mustache +++ b/modules/openapi-generator/src/main/resources/Javascript/es6/package.mustache @@ -3,7 +3,7 @@ "version": "{{{projectVersion}}}", "description": "{{{projectDescription}}}", "license": "{{licenseName}}", - "main": "dist{{#invokerPackage}}/{{invokerPackage}}{{/invokerPackage}}/index.js", + "main": "dist{{#invokerPackage}}/{{.}}{{/invokerPackage}}/index.js", "scripts": { "build": "babel src -d dist", "prepare": "npm run build", diff --git a/modules/openapi-generator/src/main/resources/Javascript/es6/partial_model_generic.mustache b/modules/openapi-generator/src/main/resources/Javascript/es6/partial_model_generic.mustache index cc82b99becb..c367e4b8201 100644 --- a/modules/openapi-generator/src/main/resources/Javascript/es6/partial_model_generic.mustache +++ b/modules/openapi-generator/src/main/resources/Javascript/es6/partial_model_generic.mustache @@ -1,17 +1,17 @@ {{#models}}{{#model}}{{#emitJSDoc}}/** * The {{classname}} model module. - * @module {{#invokerPackage}}{{invokerPackage}}/{{/invokerPackage}}{{#modelPackage}}{{modelPackage}}/{{/modelPackage}}{{classname}} + * @module {{#invokerPackage}}{{.}}/{{/invokerPackage}}{{#modelPackage}}{{.}}/{{/modelPackage}}{{classname}} * @version {{projectVersion}} */{{/emitJSDoc}} class {{classname}} {{#parent}}{{^parentModel}}{{#vendorExtensions.x-is-array}}extends Array {{/vendorExtensions.x-is-array}}{{/parentModel}}{{/parent}}{ {{#emitJSDoc}}/** * Constructs a new {{classname}}.{{#description}} - * {{description}}{{/description}} - * @alias module:{{#invokerPackage}}{{invokerPackage}}/{{/invokerPackage}}{{#modelPackage}}{{modelPackage}}/{{/modelPackage}}{{classname}}{{#useInheritance}}{{#parent}} - * @extends {{#parentModel}}module:{{#invokerPackage}}{{invokerPackage}}/{{/invokerPackage}}{{#modelPackage}}{{modelPackage}}/{{/modelPackage}}{{classname}}{{/parentModel}}{{^parentModel}}{{#vendorExtensions.x-is-array}}Array{{/vendorExtensions.x-is-array}}{{#vendorExtensions.x-is-map}}Object{{/vendorExtensions.x-is-map}}{{/parentModel}}{{/parent}}{{#interfaces}} - * @implements module:{{#invokerPackage}}{{invokerPackage}}/{{/invokerPackage}}{{#modelPackage}}{{modelPackage}}/{{/modelPackage}}{{.}}{{/interfaces}}{{/useInheritance}}{{#vendorExtensions.x-all-required}} - * @param {{name}} {{=< >=}}{<&vendorExtensions.x-jsdoc-type>}<={{ }}=> {{#description}}{{{description}}}{{/description}}{{/vendorExtensions.x-all-required}} + * {{.}}{{/description}} + * @alias module:{{#invokerPackage}}{{.}}/{{/invokerPackage}}{{#modelPackage}}{{.}}/{{/modelPackage}}{{classname}}{{#useInheritance}}{{#parent}} + * @extends {{#parentModel}}module:{{#invokerPackage}}{{.}}/{{/invokerPackage}}{{#modelPackage}}{{.}}/{{/modelPackage}}{{classname}}{{/parentModel}}{{^parentModel}}{{#vendorExtensions.x-is-array}}Array{{/vendorExtensions.x-is-array}}{{#vendorExtensions.x-is-map}}Object{{/vendorExtensions.x-is-map}}{{/parentModel}}{{/parent}}{{#interfaces}} + * @implements module:{{#invokerPackage}}{{.}}/{{/invokerPackage}}{{#modelPackage}}{{.}}/{{/modelPackage}}{{.}}{{/interfaces}}{{/useInheritance}}{{#vendorExtensions.x-all-required}} + * @param {{name}} {{=< >=}}{<&vendorExtensions.x-jsdoc-type>}<={{ }}=> {{{description}}}{{/vendorExtensions.x-all-required}} */{{/emitJSDoc}} constructor({{#vendorExtensions.x-all-required}}{{name}}{{^-last}}, {{/-last}}{{/vendorExtensions.x-all-required}}) { {{#parent}}{{^parentModel}}{{#vendorExtensions.x-is-array}} super(); @@ -55,9 +55,9 @@ class {{classname}} {{#parent}}{{^parentModel}}{{#vendorExtensions.x-is-array}}e } {{#emitModelMethods}}{{#vars}}{{#emitJSDoc}}/**{{#description}} - * Returns {{{description}}}{{/description}}{{#minimum}} - * minimum: {{minimum}}{{/minimum}}{{#maximum}} - * maximum: {{maximum}}{{/maximum}} + * Returns {{{.}}}{{/description}}{{#minimum}} + * minimum: {{.}}{{/minimum}}{{#maximum}} + * maximum: {{.}}{{/maximum}} * @return {{=< >=}}{<&vendorExtensions.x-jsdoc-type>}<={{ }}=> */{{/emitJSDoc}} {{getter}}() { @@ -65,8 +65,8 @@ class {{classname}} {{#parent}}{{^parentModel}}{{#vendorExtensions.x-is-array}}e } {{#emitJSDoc}}/**{{#description}} - * Sets {{{description}}}{{/description}} - * @param {{=< >=}}{<&vendorExtensions.x-jsdoc-type>}<={{ }}=> {{name}}{{#description}} {{{description}}}{{/description}} + * Sets {{{.}}}{{/description}} + * @param {{=< >=}}{<&vendorExtensions.x-jsdoc-type>}<={{ }}=> {{name}}{{#description}} {{{.}}}{{/description}} */{{/emitJSDoc}} {{setter}}({{name}}) { this['{{baseName}}'] = {{name}}; @@ -75,21 +75,21 @@ class {{classname}} {{#parent}}{{^parentModel}}{{#vendorExtensions.x-is-array}}e } {{#vars}}{{#emitJSDoc}}/**{{#description}} - * {{{description}}}{{/description}} + * {{{.}}}{{/description}} * @member {{=< >=}}{<&vendorExtensions.x-jsdoc-type>}<={{ }}=> {{baseName}}{{#defaultValue}} - * @default {{{defaultValue}}}{{/defaultValue}} + * @default {{{.}}}{{/defaultValue}} */{{/emitJSDoc}} -{{classname}}.prototype['{{baseName}}'] = {{#defaultValue}}{{{defaultValue}}}{{/defaultValue}}{{^defaultValue}}undefined{{/defaultValue}}; +{{classname}}.prototype['{{baseName}}'] = {{{defaultValue}}}{{^defaultValue}}undefined{{/defaultValue}}; {{/vars}} {{#useInheritance}}{{#interfaceModels}}// Implement {{classname}} interface: {{#allVars}}{{#emitJSDoc}}/**{{#description}} - * {{{description}}}{{/description}} + * {{{.}}}{{/description}} * @member {{=< >=}}{<&vendorExtensions.x-jsdoc-type>}<={{ }}=> {{baseName}}{{#defaultValue}} - * @default {{{defaultValue}}}{{/defaultValue}} + * @default {{{.}}}{{/defaultValue}} */{{/emitJSDoc}} -{{classname}}.prototype['{{baseName}}'] = {{#defaultValue}}{{{defaultValue}}}{{/defaultValue}}{{^defaultValue}}undefined{{/defaultValue}}; +{{classname}}.prototype['{{baseName}}'] = {{{defaultValue}}}{{^defaultValue}}undefined{{/defaultValue}}; {{/allVars}}{{/interfaceModels}}{{/useInheritance}} {{#vars}}{{#isEnum}}{{^isContainer}} diff --git a/modules/openapi-generator/src/main/resources/Javascript/git_push.sh.mustache b/modules/openapi-generator/src/main/resources/Javascript/git_push.sh.mustache index 8b3f689c912..f0bed5bd841 100755 --- a/modules/openapi-generator/src/main/resources/Javascript/git_push.sh.mustache +++ b/modules/openapi-generator/src/main/resources/Javascript/git_push.sh.mustache @@ -55,4 +55,3 @@ git pull origin master # Pushes (Forces) the changes in the local repository up to the remote repository echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" git push origin master 2>&1 | grep -v 'To https' - diff --git a/modules/openapi-generator/src/main/resources/Javascript/index.mustache b/modules/openapi-generator/src/main/resources/Javascript/index.mustache index d6ca3cff704..1286f772bf9 100644 --- a/modules/openapi-generator/src/main/resources/Javascript/index.mustache +++ b/modules/openapi-generator/src/main/resources/Javascript/index.mustache @@ -2,21 +2,21 @@ (function(factory) { if (typeof define === 'function' && define.amd) { // AMD. Register as an anonymous module. - define(['{{#invokerPackage}}{{invokerPackage}}/{{/invokerPackage}}ApiClient'{{#models}}, '{{#invokerPackage}}{{invokerPackage}}/{{/invokerPackage}}{{#modelPackage}}{{modelPackage}}/{{/modelPackage}}{{importPath}}'{{/models}}{{#apiInfo}}{{#apis}}, '{{#invokerPackage}}{{invokerPackage}}/{{/invokerPackage}}{{#apiPackage}}{{apiPackage}}/{{/apiPackage}}{{importPath}}'{{/apis}}{{/apiInfo}}], factory); + define(['{{#invokerPackage}}{{.}}/{{/invokerPackage}}ApiClient'{{#models}}, '{{#invokerPackage}}{{.}}/{{/invokerPackage}}{{#modelPackage}}{{.}}/{{/modelPackage}}{{importPath}}'{{/models}}{{#apiInfo}}{{#apis}}, '{{#invokerPackage}}{{.}}/{{/invokerPackage}}{{#apiPackage}}{{.}}/{{/apiPackage}}{{importPath}}'{{/apis}}{{/apiInfo}}], factory); } else if (typeof module === 'object' && module.exports) { // CommonJS-like environments that support module.exports, like Node. - module.exports = factory(require('./ApiClient'){{#models}}, require('./{{#modelPackage}}{{modelPackage}}/{{/modelPackage}}{{importPath}}'){{/models}}{{#apiInfo}}{{#apis}}, require('./{{#apiPackage}}{{apiPackage}}/{{/apiPackage}}{{importPath}}'){{/apis}}{{/apiInfo}}); + module.exports = factory(require('./ApiClient'){{#models}}, require('./{{#modelPackage}}{{.}}/{{/modelPackage}}{{importPath}}'){{/models}}{{#apiInfo}}{{#apis}}, require('./{{#apiPackage}}{{.}}/{{/apiPackage}}{{importPath}}'){{/apis}}{{/apiInfo}}); } }(function(ApiClient{{#models}}{{#model}}, {{classFilename}}{{/model}}{{/models}}{{#apiInfo}}{{#apis}}, {{importPath}}{{/apis}}{{/apiInfo}}) { 'use strict'; {{#emitJSDoc}} /**{{#projectDescription}} - * {{projectDescription}}.
{{/projectDescription}} + * {{.}}.
{{/projectDescription}} * The index module provides access to constructors for all the classes which comprise the public API. *

* An AMD (recommended!) or CommonJS application will generally do something equivalent to the following: *

-   * var {{moduleName}} = require('{{#invokerPackage}}{{invokerPackage}}/{{/invokerPackage}}index'); // See note below*.
+   * var {{moduleName}} = require('{{#invokerPackage}}{{.}}/{{/invokerPackage}}index'); // See note below*.
    * var xxxSvc = new {{moduleName}}.XxxApi(); // Allocate the API class we're going to use.
    * var yyyModel = new {{moduleName}}.Yyy(); // Construct a model instance.
    * yyyModel.someProperty = 'someValue';
@@ -24,7 +24,7 @@
    * var zzz = xxxSvc.doSomething(yyyModel); // Invoke the service.
    * ...
    * 
- * *NOTE: For a top-level AMD script, use require(['{{#invokerPackage}}{{invokerPackage}}/{{/invokerPackage}}index'], function(){...}) + * *NOTE: For a top-level AMD script, use require(['{{#invokerPackage}}{{.}}/{{/invokerPackage}}index'], function(){...}) * and put the application logic within the callback function. *

*

@@ -38,7 +38,7 @@ * ... * *

- * @module {{#invokerPackage}}{{invokerPackage}}/{{/invokerPackage}}index + * @module {{#invokerPackage}}{{.}}/{{/invokerPackage}}index * @version {{projectVersion}} */{{/emitJSDoc}} {{=< >=}} var exports = {<#emitJSDoc> diff --git a/modules/openapi-generator/src/main/resources/Javascript/licenseInfo.mustache b/modules/openapi-generator/src/main/resources/Javascript/licenseInfo.mustache index 4a27ba7c5cd..571d22d4a65 100644 --- a/modules/openapi-generator/src/main/resources/Javascript/licenseInfo.mustache +++ b/modules/openapi-generator/src/main/resources/Javascript/licenseInfo.mustache @@ -3,10 +3,10 @@ * {{{appDescription}}} * {{#version}} - * The version of the OpenAPI document: {{{version}}} + * The version of the OpenAPI document: {{{.}}} {{/version}} {{#infoEmail}} - * Contact: {{{infoEmail}}} + * Contact: {{{.}}} {{/infoEmail}} * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/modules/openapi-generator/src/main/resources/Javascript/model.mustache b/modules/openapi-generator/src/main/resources/Javascript/model.mustache index 95f2b2df81d..2621ddcba65 100644 --- a/modules/openapi-generator/src/main/resources/Javascript/model.mustache +++ b/modules/openapi-generator/src/main/resources/Javascript/model.mustache @@ -2,7 +2,7 @@ (function(root, factory) { if (typeof define === 'function' && define.amd) { // AMD. Register as an anonymous module. - define(['{{#invokerPackage}}{{invokerPackage}}/{{/invokerPackage}}ApiClient'{{#imports}}, '{{#invokerPackage}}{{invokerPackage}}/{{/invokerPackage}}{{#modelPackage}}{{modelPackage}}/{{/modelPackage}}{{import}}'{{/imports}}], factory); + define(['{{#invokerPackage}}{{.}}/{{/invokerPackage}}ApiClient'{{#imports}}, '{{#invokerPackage}}{{.}}/{{/invokerPackage}}{{#modelPackage}}{{.}}/{{/modelPackage}}{{import}}'{{/imports}}], factory); } else if (typeof module === 'object' && module.exports) { // CommonJS-like environments that support module.exports, like Node. module.exports = factory(require('../ApiClient'){{#imports}}, require('./{{import}}'){{/imports}}); diff --git a/modules/openapi-generator/src/main/resources/Javascript/model_doc.mustache b/modules/openapi-generator/src/main/resources/Javascript/model_doc.mustache index 04ab6f949ac..fc21ae6e9f1 100644 --- a/modules/openapi-generator/src/main/resources/Javascript/model_doc.mustache +++ b/modules/openapi-generator/src/main/resources/Javascript/model_doc.mustache @@ -11,7 +11,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -{{#vars}}**{{name}}** | {{#isPrimitiveType}}**{{dataType}}**{{/isPrimitiveType}}{{^isPrimitiveType}}[**{{dataType}}**]({{complexType}}.md){{/isPrimitiveType}} | {{description}} | {{^required}}[optional] {{/required}}{{#isReadOnly}}[readonly] {{/isReadOnly}}{{#defaultValue}}[default to {{defaultValue}}]{{/defaultValue}} +{{#vars}}**{{name}}** | {{#isPrimitiveType}}**{{dataType}}**{{/isPrimitiveType}}{{^isPrimitiveType}}[**{{dataType}}**]({{complexType}}.md){{/isPrimitiveType}} | {{description}} | {{^required}}[optional] {{/required}}{{#isReadOnly}}[readonly] {{/isReadOnly}}{{#defaultValue}}[default to {{.}}]{{/defaultValue}} {{/vars}} {{#vars}}{{#isEnum}} diff --git a/modules/openapi-generator/src/main/resources/Javascript/model_test.mustache b/modules/openapi-generator/src/main/resources/Javascript/model_test.mustache index 0680e194f15..53071a6ce09 100644 --- a/modules/openapi-generator/src/main/resources/Javascript/model_test.mustache +++ b/modules/openapi-generator/src/main/resources/Javascript/model_test.mustache @@ -2,10 +2,10 @@ (function(root, factory) { if (typeof define === 'function' && define.amd) { // AMD. - define(['expect.js', process.cwd()+'/src/{{#invokerPackage}}{{invokerPackage}}/{{/invokerPackage}}index'], factory); + define(['expect.js', process.cwd()+'/src/{{#invokerPackage}}{{.}}/{{/invokerPackage}}index'], factory); } else if (typeof module === 'object' && module.exports) { // CommonJS-like environments that support module.exports, like Node. - factory(require('expect.js'), require(process.cwd()+'/src/{{#invokerPackage}}{{invokerPackage}}/{{/invokerPackage}}index')); + factory(require('expect.js'), require(process.cwd()+'/src/{{#invokerPackage}}{{.}}/{{/invokerPackage}}index')); } else { // Browser globals (root is window) factory(root.expect, root.{{moduleName}}); diff --git a/modules/openapi-generator/src/main/resources/Javascript/package.mustache b/modules/openapi-generator/src/main/resources/Javascript/package.mustache index 2fe23d57d74..50f02589eff 100644 --- a/modules/openapi-generator/src/main/resources/Javascript/package.mustache +++ b/modules/openapi-generator/src/main/resources/Javascript/package.mustache @@ -3,7 +3,7 @@ "version": "{{{projectVersion}}}", "description": "{{{projectDescription}}}", "license": "{{licenseName}}", - "main": "{{sourceFolder}}{{#invokerPackage}}/{{invokerPackage}}{{/invokerPackage}}/index.js", + "main": "{{sourceFolder}}{{#invokerPackage}}/{{.}}{{/invokerPackage}}/index.js", "scripts": { "test": "mocha --recursive" }, diff --git a/modules/openapi-generator/src/main/resources/Javascript/partial_model_generic.mustache b/modules/openapi-generator/src/main/resources/Javascript/partial_model_generic.mustache index e6fcc62c9e3..6da2a98af9d 100644 --- a/modules/openapi-generator/src/main/resources/Javascript/partial_model_generic.mustache +++ b/modules/openapi-generator/src/main/resources/Javascript/partial_model_generic.mustache @@ -2,18 +2,18 @@ {{#emitJSDoc}} /** * The {{classname}} model module. - * @module {{#invokerPackage}}{{invokerPackage}}/{{/invokerPackage}}{{#modelPackage}}{{modelPackage}}/{{/modelPackage}}{{classname}} + * @module {{#invokerPackage}}{{.}}/{{/invokerPackage}}{{#modelPackage}}{{.}}/{{/modelPackage}}{{classname}} * @version {{projectVersion}} */ /** * Constructs a new {{classname}}.{{#description}} - * {{description}}{{/description}} - * @alias module:{{#invokerPackage}}{{invokerPackage}}/{{/invokerPackage}}{{#modelPackage}}{{modelPackage}}/{{/modelPackage}}{{classname}} + * {{.}}{{/description}} + * @alias module:{{#invokerPackage}}{{.}}/{{/invokerPackage}}{{#modelPackage}}{{.}}/{{/modelPackage}}{{classname}} * @class{{#useInheritance}}{{#parent}} - * @extends {{#parentModel}}module:{{#invokerPackage}}{{invokerPackage}}/{{/invokerPackage}}{{#modelPackage}}{{modelPackage}}/{{/modelPackage}}{{classname}}{{/parentModel}}{{^parentModel}}{{#vendorExtensions.x-is-array}}Array{{/vendorExtensions.x-is-array}}{{#vendorExtensions.x-is-map}}Object{{/vendorExtensions.x-is-map}}{{/parentModel}}{{/parent}}{{#interfaces}} - * @implements module:{{#invokerPackage}}{{invokerPackage}}/{{/invokerPackage}}{{#modelPackage}}{{modelPackage}}/{{/modelPackage}}{{.}}{{/interfaces}}{{/useInheritance}}{{#vendorExtensions.x-all-required}} - * @param {{name}} {{=< >=}}{<&vendorExtensions.x-jsdoc-type>}<={{ }}=> {{#description}}{{{description}}}{{/description}}{{/vendorExtensions.x-all-required}} + * @extends {{#parentModel}}module:{{#invokerPackage}}{{.}}/{{/invokerPackage}}{{#modelPackage}}{{.}}/{{/modelPackage}}{{classname}}{{/parentModel}}{{^parentModel}}{{#vendorExtensions.x-is-array}}Array{{/vendorExtensions.x-is-array}}{{#vendorExtensions.x-is-map}}Object{{/vendorExtensions.x-is-map}}{{/parentModel}}{{/parent}}{{#interfaces}} + * @implements module:{{#invokerPackage}}{{.}}/{{/invokerPackage}}{{#modelPackage}}{{.}}/{{/modelPackage}}{{.}}{{/interfaces}}{{/useInheritance}}{{#vendorExtensions.x-all-required}} + * @param {{name}} {{=< >=}}{<&vendorExtensions.x-jsdoc-type>}<={{ }}=> {{{description}}}{{/vendorExtensions.x-all-required}} */ {{/emitJSDoc}} var exports = function({{#vendorExtensions.x-all-required}}{{name}}{{^-last}}, {{/-last}}{{/vendorExtensions.x-all-required}}) { @@ -97,29 +97,29 @@ {{#vars}} {{#emitJSDoc}} /**{{#description}} - * {{{description}}}{{/description}} + * {{{.}}}{{/description}} * @member {{=< >=}}{<&vendorExtensions.x-jsdoc-type>}<={{ }}=> {{baseName}}{{#defaultValue}} - * @default {{{defaultValue}}}{{/defaultValue}} + * @default {{{.}}}{{/defaultValue}} */ {{/emitJSDoc}} - exports.prototype['{{baseName}}'] = {{#defaultValue}}{{{defaultValue}}}{{/defaultValue}}{{^defaultValue}}undefined{{/defaultValue}}; + exports.prototype['{{baseName}}'] = {{{defaultValue}}}{{^defaultValue}}undefined{{/defaultValue}}; {{/vars}}{{#useInheritance}}{{#interfaceModels}} // Implement {{classname}} interface:{{#allVars}} {{#emitJSDoc}} /**{{#description}} - * {{{description}}}{{/description}} + * {{{.}}}{{/description}} * @member {{=< >=}}{<&vendorExtensions.x-jsdoc-type>}<={{ }}=> {{baseName}}{{#defaultValue}} - * @default {{{defaultValue}}}{{/defaultValue}} + * @default {{{.}}}{{/defaultValue}} */ {{/emitJSDoc}} -exports.prototype['{{baseName}}'] = {{#defaultValue}}{{{defaultValue}}}{{/defaultValue}}{{^defaultValue}}undefined{{/defaultValue}}; +exports.prototype['{{baseName}}'] = {{{defaultValue}}}{{^defaultValue}}undefined{{/defaultValue}}; {{/allVars}}{{/interfaceModels}}{{/useInheritance}} {{#emitModelMethods}}{{#vars}} {{#emitJSDoc}} /**{{#description}} - * Returns {{{description}}}{{/description}}{{#minimum}} - * minimum: {{minimum}}{{/minimum}}{{#maximum}} - * maximum: {{maximum}}{{/maximum}} + * Returns {{{.}}}{{/description}}{{#minimum}} + * minimum: {{.}}{{/minimum}}{{#maximum}} + * maximum: {{.}}{{/maximum}} * @return {{=< >=}}{<&vendorExtensions.x-jsdoc-type>}<={{ }}=> */ {{/emitJSDoc}} @@ -129,8 +129,8 @@ exports.prototype['{{baseName}}'] = {{#defaultValue}}{{{defaultValue}}}{{/defaul {{#emitJSDoc}} /**{{#description}} - * Sets {{{description}}}{{/description}} - * @param {{=< >=}}{<&vendorExtensions.x-jsdoc-type>}<={{ }}=> {{name}}{{#description}} {{{description}}}{{/description}} + * Sets {{{.}}}{{/description}} + * @param {{=< >=}}{<&vendorExtensions.x-jsdoc-type>}<={{ }}=> {{name}}{{#description}} {{{.}}}{{/description}} */ {{/emitJSDoc}} exports.prototype.{{setter}} = function({{name}}) { diff --git a/modules/openapi-generator/src/main/resources/android/README.mustache b/modules/openapi-generator/src/main/resources/android/README.mustache index 0f0ef9d155e..d61a46e981d 100644 --- a/modules/openapi-generator/src/main/resources/android/README.mustache +++ b/modules/openapi-generator/src/main/resources/android/README.mustache @@ -68,7 +68,7 @@ public class {{{classname}}}Example { {{{dataType}}} {{{paramName}}} = {{{example}}}; // {{{dataType}}} | {{{description}}} {{/allParams}} try { - {{#returnType}}{{{returnType}}} result = {{/returnType}}apiInstance.{{{operationId}}}({{#allParams}}{{{paramName}}}{{^-last}}, {{/-last}}{{/allParams}});{{#returnType}} + {{#returnType}}{{{.}}} result = {{/returnType}}apiInstance.{{{operationId}}}({{#allParams}}{{{paramName}}}{{^-last}}, {{/-last}}{{/allParams}});{{#returnType}} System.out.println(result);{{/returnType}} } catch (ApiException e) { System.err.println("Exception when calling {{{classname}}}#{{{operationId}}}"); @@ -85,7 +85,7 @@ All URIs are relative to *{{basePath}}* Class | Method | HTTP request | Description ------------ | ------------- | ------------- | ------------- -{{#apiInfo}}{{#apis}}{{#operations}}{{#operation}}*{{classname}}* | [**{{operationId}}**]({{apiDocPath}}{{classname}}.md#{{operationId}}) | **{{httpMethod}}** {{path}} | {{#summary}}{{summary}}{{/summary}} +{{#apiInfo}}{{#apis}}{{#operations}}{{#operation}}*{{classname}}* | [**{{operationId}}**]({{apiDocPath}}{{classname}}.md#{{operationId}}) | **{{httpMethod}}** {{path}} | {{summary}} {{/operation}}{{/operations}}{{/apis}}{{/apiInfo}} ## Documentation for Models diff --git a/modules/openapi-generator/src/main/resources/android/api.mustache b/modules/openapi-generator/src/main/resources/android/api.mustache index 188c52253c6..6a82dd69f09 100644 --- a/modules/openapi-generator/src/main/resources/android/api.mustache +++ b/modules/openapi-generator/src/main/resources/android/api.mustache @@ -46,9 +46,9 @@ public class {{classname}} { * {{summary}} * {{notes}} {{#allParams}} * @param {{paramName}} {{description}} -{{/allParams}} * @return {{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}void{{/returnType}} +{{/allParams}} * @return {{{returnType}}}{{^returnType}}void{{/returnType}} */ - public {{#returnType}}{{{returnType}}} {{/returnType}}{{^returnType}}void {{/returnType}} {{nickname}} ({{#allParams}}{{{dataType}}} {{paramName}}{{^-last}}, {{/-last}}{{/allParams}}) throws ApiException { + public {{#returnType}}{{{.}}} {{/returnType}}{{^returnType}}void {{/returnType}} {{nickname}} ({{#allParams}}{{{dataType}}} {{paramName}}{{^-last}}, {{/-last}}{{/allParams}}) throws ApiException { Object localVarPostBody = {{#bodyParam}}{{paramName}}{{/bodyParam}}{{^bodyParam}}null{{/bodyParam}}; {{#allParams}} {{#required}} @@ -70,7 +70,7 @@ public class {{classname}} { Map localVarFormParams = new HashMap(); {{#queryParams}} - localVarQueryParams.addAll(ApiInvoker.parameterToPairs("{{#collectionFormat}}{{{collectionFormat}}}{{/collectionFormat}}", "{{baseName}}", {{paramName}})); + localVarQueryParams.addAll(ApiInvoker.parameterToPairs("{{{collectionFormat}}}", "{{baseName}}", {{paramName}})); {{/queryParams}} {{#headerParams}} diff --git a/modules/openapi-generator/src/main/resources/android/apiInvoker.mustache b/modules/openapi-generator/src/main/resources/android/apiInvoker.mustache index e77cc60b8ca..ffa99306de8 100644 --- a/modules/openapi-generator/src/main/resources/android/apiInvoker.mustache +++ b/modules/openapi-generator/src/main/resources/android/apiInvoker.mustache @@ -84,7 +84,7 @@ public class ApiInvoker { DATE_FORMAT.setTimeZone(TimeZone.getTimeZone("UTC")); // Set default User-Agent. - setUserAgent("{{#httpUserAgent}}{{{.}}}{{/httpUserAgent}}{{^httpUserAgent}}OpenAPI-Generator/{{{artifactVersion}}}/android{{/httpUserAgent}}"); + setUserAgent("{{{httpUserAgent}}}{{^httpUserAgent}}OpenAPI-Generator/{{{artifactVersion}}}/android{{/httpUserAgent}}"); } public static void setUserAgent(String userAgent) { diff --git a/modules/openapi-generator/src/main/resources/android/api_doc.mustache b/modules/openapi-generator/src/main/resources/android/api_doc.mustache index d7ea617e2fb..be7bb2701cb 100644 --- a/modules/openapi-generator/src/main/resources/android/api_doc.mustache +++ b/modules/openapi-generator/src/main/resources/android/api_doc.mustache @@ -1,12 +1,12 @@ # {{classname}}{{#description}} -{{description}}{{/description}} +{{.}}{{/description}} All URIs are relative to *{{basePath}}* Method | HTTP request | Description ------------- | ------------- | ------------- -{{#operations}}{{#operation}}[**{{operationId}}**]({{classname}}.md#{{operationId}}) | **{{httpMethod}}** {{path}} | {{#summary}}{{summary}}{{/summary}} +{{#operations}}{{#operation}}[**{{operationId}}**]({{classname}}.md#{{operationId}}) | **{{httpMethod}}** {{path}} | {{summary}} {{/operation}}{{/operations}} {{#operations}} @@ -14,11 +14,11 @@ Method | HTTP request | Description ## {{operationId}} -> {{#returnType}}{{returnType}} {{/returnType}}{{operationId}}({{#allParams}}{{{paramName}}}{{^-last}}, {{/-last}}{{/allParams}}) +> {{#returnType}}{{.}} {{/returnType}}{{operationId}}({{#allParams}}{{{paramName}}}{{^-last}}, {{/-last}}{{/allParams}}) {{summary}}{{#notes}} -{{notes}}{{/notes}} +{{.}}{{/notes}} ### Example @@ -31,7 +31,7 @@ Method | HTTP request | Description {{{dataType}}} {{{paramName}}} = {{{example}}}; // {{{dataType}}} | {{{description}}} {{/allParams}} try { - {{#returnType}}{{{returnType}}} result = {{/returnType}}apiInstance.{{{operationId}}}({{#allParams}}{{{paramName}}}{{^-last}}, {{/-last}}{{/allParams}});{{#returnType}} + {{#returnType}}{{{.}}} result = {{/returnType}}apiInstance.{{{operationId}}}({{#allParams}}{{{paramName}}}{{^-last}}, {{/-last}}{{/allParams}});{{#returnType}} System.out.println(result);{{/returnType}} } catch (ApiException e) { System.err.println("Exception when calling {{{classname}}}#{{{operationId}}}"); @@ -44,7 +44,7 @@ try { {{^allParams}}This endpoint does not need any parameter.{{/allParams}}{{#allParams}}{{#-last}} Name | Type | Description | Notes ------------- | ------------- | ------------- | -------------{{/-last}}{{/allParams}} -{{#allParams}} **{{paramName}}** | {{#isPrimitiveType}}**{{dataType}}**{{/isPrimitiveType}}{{^isPrimitiveType}}{{#isFile}}**{{dataType}}**{{/isFile}}{{^isFile}}[**{{dataType}}**]({{baseType}}.md){{/isFile}}{{/isPrimitiveType}}| {{description}} |{{^required}} [optional]{{/required}}{{#defaultValue}} [default to {{defaultValue}}]{{/defaultValue}}{{#allowableValues}} [enum: {{#values}}{{{.}}}{{^-last}}, {{/-last}}{{/values}}]{{/allowableValues}} +{{#allParams}} **{{paramName}}** | {{#isPrimitiveType}}**{{dataType}}**{{/isPrimitiveType}}{{^isPrimitiveType}}{{#isFile}}**{{dataType}}**{{/isFile}}{{^isFile}}[**{{dataType}}**]({{baseType}}.md){{/isFile}}{{/isPrimitiveType}}| {{description}} |{{^required}} [optional]{{/required}}{{#defaultValue}} [default to {{.}}]{{/defaultValue}}{{#allowableValues}} [enum: {{#values}}{{{.}}}{{^-last}}, {{/-last}}{{/values}}]{{/allowableValues}} {{/allParams}} ### Return type diff --git a/modules/openapi-generator/src/main/resources/android/build.mustache b/modules/openapi-generator/src/main/resources/android/build.mustache index 4d465c7b9a8..1a5ba2185ea 100644 --- a/modules/openapi-generator/src/main/resources/android/build.mustache +++ b/modules/openapi-generator/src/main/resources/android/build.mustache @@ -10,7 +10,7 @@ buildscript { } dependencies { {{#androidGradleVersion}} - classpath 'com.android.tools.build:gradle:{{{androidGradleVersion}}}' + classpath 'com.android.tools.build:gradle:{{{.}}}' {{/androidGradleVersion}} {{^androidGradleVersion}} classpath 'com.android.tools.build:gradle:2.3.+' @@ -35,13 +35,13 @@ apply plugin: 'com.github.dcendents.android-maven' android { {{#androidSdkVersion}} - compileSdkVersion {{{androidSdkVersion}}} + compileSdkVersion {{{.}}} {{/androidSdkVersion}} {{^androidSdkVersion}} compileSdkVersion 25 {{/androidSdkVersion}} {{#androidBuildToolsVersion}} - buildToolsVersion '{{{androidBuildToolsVersion}}}' + buildToolsVersion '{{{.}}}' {{/androidBuildToolsVersion}} {{^androidBuildToolsVersion}} buildToolsVersion '25.0.2' @@ -50,7 +50,7 @@ android { defaultConfig { minSdkVersion 14 {{#androidSdkVersion}} - targetSdkVersion {{{androidSdkVersion}}} + targetSdkVersion {{{.}}} {{/androidSdkVersion}} {{^androidSdkVersion}} targetSdkVersion 25 diff --git a/modules/openapi-generator/src/main/resources/android/git_push.sh.mustache b/modules/openapi-generator/src/main/resources/android/git_push.sh.mustache index 8b3f689c912..f0bed5bd841 100755 --- a/modules/openapi-generator/src/main/resources/android/git_push.sh.mustache +++ b/modules/openapi-generator/src/main/resources/android/git_push.sh.mustache @@ -55,4 +55,3 @@ git pull origin master # Pushes (Forces) the changes in the local repository up to the remote repository echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" git push origin master 2>&1 | grep -v 'To https' - diff --git a/modules/openapi-generator/src/main/resources/android/libraries/volley/api.mustache b/modules/openapi-generator/src/main/resources/android/libraries/volley/api.mustache index fdae8995f1f..51f5cd840b4 100644 --- a/modules/openapi-generator/src/main/resources/android/libraries/volley/api.mustache +++ b/modules/openapi-generator/src/main/resources/android/libraries/volley/api.mustache @@ -53,9 +53,9 @@ public class {{classname}} { * {{summary}} * {{notes}} {{#allParams}} * @param {{paramName}} {{description}} -{{/allParams}} * @return {{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}void{{/returnType}} +{{/allParams}} * @return {{{returnType}}}{{^returnType}}void{{/returnType}} */ - public {{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}void{{/returnType}} {{nickname}} ({{#allParams}}{{{dataType}}} {{paramName}}{{^-last}}, {{/-last}}{{/allParams}}) throws TimeoutException, ExecutionException, InterruptedException, ApiException { + public {{{returnType}}}{{^returnType}}void{{/returnType}} {{nickname}} ({{#allParams}}{{{dataType}}} {{paramName}}{{^-last}}, {{/-last}}{{/allParams}}) throws TimeoutException, ExecutionException, InterruptedException, ApiException { Object postBody = {{#bodyParam}}{{paramName}}{{/bodyParam}}{{^bodyParam}}null{{/bodyParam}}; {{#allParams}} {{#required}} @@ -77,7 +77,7 @@ public class {{classname}} { // form params Map formParams = new HashMap(); {{#queryParams}} - queryParams.addAll(ApiInvoker.parameterToPairs("{{#collectionFormat}}{{{collectionFormat}}}{{/collectionFormat}}", "{{baseName}}", {{paramName}})); + queryParams.addAll(ApiInvoker.parameterToPairs("{{{collectionFormat}}}", "{{baseName}}", {{paramName}})); {{/queryParams}} {{#headerParams}} headerParams.put("{{baseName}}", ApiInvoker.parameterToString({{paramName}})); @@ -146,7 +146,7 @@ public class {{classname}} { * {{notes}} {{#allParams}} * @param {{paramName}} {{description}}{{/allParams}} */ - public void {{nickname}} ({{#allParams}}{{{dataType}}} {{paramName}}{{^-last}}, {{/-last}}{{#-last}}, {{/-last}}{{/allParams}}final Response.Listener<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}String{{/returnType}}> responseListener, final Response.ErrorListener errorListener) { + public void {{nickname}} ({{#allParams}}{{{dataType}}} {{paramName}}{{^-last}}, {{/-last}}{{#-last}}, {{/-last}}{{/allParams}}final Response.Listener<{{{returnType}}}{{^returnType}}String{{/returnType}}> responseListener, final Response.ErrorListener errorListener) { Object postBody = {{#bodyParam}}{{paramName}}{{/bodyParam}}{{^bodyParam}}null{{/bodyParam}}; {{#allParams}} @@ -170,7 +170,7 @@ public class {{classname}} { Map formParams = new HashMap(); {{#queryParams}} - queryParams.addAll(ApiInvoker.parameterToPairs("{{#collectionFormat}}{{{collectionFormat}}}{{/collectionFormat}}", "{{baseName}}", {{paramName}})); + queryParams.addAll(ApiInvoker.parameterToPairs("{{{collectionFormat}}}", "{{baseName}}", {{paramName}})); {{/queryParams}} {{#headerParams}} diff --git a/modules/openapi-generator/src/main/resources/android/libraries/volley/apiInvoker.mustache b/modules/openapi-generator/src/main/resources/android/libraries/volley/apiInvoker.mustache index defb844693e..db0fcd2e629 100644 --- a/modules/openapi-generator/src/main/resources/android/libraries/volley/apiInvoker.mustache +++ b/modules/openapi-generator/src/main/resources/android/libraries/volley/apiInvoker.mustache @@ -188,7 +188,7 @@ public class ApiInvoker { public static void initializeInstance(Cache cache, Network network, int threadPoolSize, ResponseDelivery delivery, int connectionTimeout) { INSTANCE = new ApiInvoker(cache, network, threadPoolSize, delivery, connectionTimeout); - setUserAgent("{{#httpUserAgent}}{{{.}}}{{/httpUserAgent}}{{^httpUserAgent}}OpenAPI-Generator/{{{artifactVersion}}}/android{{/httpUserAgent}}"); + setUserAgent("{{{httpUserAgent}}}{{^httpUserAgent}}OpenAPI-Generator/{{{artifactVersion}}}/android{{/httpUserAgent}}"); // Setup authentications (key: authentication name, value: authentication). INSTANCE.authentications = new HashMap(); diff --git a/modules/openapi-generator/src/main/resources/android/libraries/volley/git_push.sh.mustache b/modules/openapi-generator/src/main/resources/android/libraries/volley/git_push.sh.mustache index 8b3f689c912..f0bed5bd841 100644 --- a/modules/openapi-generator/src/main/resources/android/libraries/volley/git_push.sh.mustache +++ b/modules/openapi-generator/src/main/resources/android/libraries/volley/git_push.sh.mustache @@ -55,4 +55,3 @@ git pull origin master # Pushes (Forces) the changes in the local repository up to the remote repository echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" git push origin master 2>&1 | grep -v 'To https' - diff --git a/modules/openapi-generator/src/main/resources/android/libraries/volley/model.mustache b/modules/openapi-generator/src/main/resources/android/libraries/volley/model.mustache index 110c218e45a..5778c739af0 100644 --- a/modules/openapi-generator/src/main/resources/android/libraries/volley/model.mustache +++ b/modules/openapi-generator/src/main/resources/android/libraries/volley/model.mustache @@ -13,11 +13,11 @@ import java.io.Serializable; {{#model}} {{#description}} /** - * {{description}} + * {{.}} **/ {{/description}} @ApiModel(description = "{{{description}}}") -public class {{classname}} {{#parent}}extends {{{parent}}} {{/parent}}{{#serializableModel}}implements Serializable {{/serializableModel}}{ +public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#serializableModel}}implements Serializable {{/serializableModel}}{ {{#vars}}{{#isEnum}} public enum {{datatypeWithEnum}} { {{#allowableValues}}{{#values}} {{.}}, {{/values}}{{/allowableValues}} @@ -29,9 +29,9 @@ public class {{classname}} {{#parent}}extends {{{parent}}} {{/parent}}{{#seriali {{#vars}} /**{{#description}} - * {{{description}}}{{/description}}{{#minimum}} - * minimum: {{minimum}}{{/minimum}}{{#maximum}} - * maximum: {{maximum}}{{/maximum}} + * {{{.}}}{{/description}}{{#minimum}} + * minimum: {{.}}{{/minimum}}{{#maximum}} + * maximum: {{.}}{{/maximum}} **/ @ApiModelProperty({{#required}}required = {{required}}, {{/required}}value = "{{{description}}}") public {{{datatypeWithEnum}}} {{getter}}() { diff --git a/modules/openapi-generator/src/main/resources/android/licenseInfo.mustache b/modules/openapi-generator/src/main/resources/android/licenseInfo.mustache index 9866f297a4d..be193d0c4fe 100644 --- a/modules/openapi-generator/src/main/resources/android/licenseInfo.mustache +++ b/modules/openapi-generator/src/main/resources/android/licenseInfo.mustache @@ -2,8 +2,8 @@ * {{{appName}}} * {{{appDescription}}} * - * {{#version}}The version of the OpenAPI document: {{{version}}}{{/version}} - * {{#infoEmail}}Contact: {{{infoEmail}}}{{/infoEmail}} + * {{#version}}The version of the OpenAPI document: {{{.}}}{{/version}} + * {{#infoEmail}}Contact: {{{.}}}{{/infoEmail}} * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech diff --git a/modules/openapi-generator/src/main/resources/android/model.mustache b/modules/openapi-generator/src/main/resources/android/model.mustache index 498409cfb23..35949bc5981 100644 --- a/modules/openapi-generator/src/main/resources/android/model.mustache +++ b/modules/openapi-generator/src/main/resources/android/model.mustache @@ -9,10 +9,10 @@ import com.google.gson.annotations.SerializedName; {{#model}}{{#description}} /** - * {{description}} + * {{.}} **/{{/description}} @ApiModel(description = "{{{description}}}") -public class {{classname}} {{#parent}}extends {{{parent}}}{{/parent}} { +public class {{classname}} {{#parent}}extends {{{.}}}{{/parent}} { {{#vars}}{{#isEnum}} public enum {{datatypeWithEnum}} { {{#allowableValues}}{{#values}} {{.}}, {{/values}}{{/allowableValues}} @@ -24,9 +24,9 @@ public class {{classname}} {{#parent}}extends {{{parent}}}{{/parent}} { {{#vars}} /**{{#description}} - * {{{description}}}{{/description}}{{#minimum}} - * minimum: {{minimum}}{{/minimum}}{{#maximum}} - * maximum: {{maximum}}{{/maximum}} + * {{{.}}}{{/description}}{{#minimum}} + * minimum: {{.}}{{/minimum}}{{#maximum}} + * maximum: {{.}}{{/maximum}} **/ @ApiModelProperty({{#required}}required = {{required}}, {{/required}}value = "{{{description}}}") public {{{datatypeWithEnum}}} {{getter}}() { diff --git a/modules/openapi-generator/src/main/resources/apex/README_ant.mustache b/modules/openapi-generator/src/main/resources/apex/README_ant.mustache index b41000afa5f..a51ef6a1239 100644 --- a/modules/openapi-generator/src/main/resources/apex/README_ant.mustache +++ b/modules/openapi-generator/src/main/resources/apex/README_ant.mustache @@ -2,7 +2,7 @@ {{#appDescription}} -{{{appDescription}}} +{{{.}}} {{/appDescription}} ## Requirements @@ -52,7 +52,7 @@ For more information, see params = new Map{ try { // cross your fingers - {{#returnType}}{{{returnType}}} result = {{/returnType}}api.{{{operationId}}}({{#hasParams}}params{{/hasParams}}); + {{#returnType}}{{{.}}} result = {{/returnType}}api.{{{operationId}}}({{#hasParams}}params{{/hasParams}}); {{#returnType}} System.debug(result); {{/returnType}} @@ -146,7 +146,7 @@ All URIs are relative to *{{basePath}}* Class | Method | HTTP request | Description ------------ | ------------- | ------------- | ------------- -{{#apiInfo}}{{#apis}}{{#operations}}{{#operation}}*{{classname}}* | [**{{operationId}}**]({{apiDocPath}}{{classname}}.md#{{operationId}}) | **{{httpMethod}}** {{path}} | {{#summary}}{{summary}}{{/summary}} +{{#apiInfo}}{{#apis}}{{#operations}}{{#operation}}*{{classname}}* | [**{{operationId}}**]({{apiDocPath}}{{classname}}.md#{{operationId}}) | **{{httpMethod}}** {{path}} | {{summary}} {{/operation}}{{/operations}}{{/apis}}{{/apiInfo}} ## Documentation for Models diff --git a/modules/openapi-generator/src/main/resources/apex/README_sfdx.mustache b/modules/openapi-generator/src/main/resources/apex/README_sfdx.mustache index 4058dbc786b..27e446e928e 100644 --- a/modules/openapi-generator/src/main/resources/apex/README_sfdx.mustache +++ b/modules/openapi-generator/src/main/resources/apex/README_sfdx.mustache @@ -2,7 +2,7 @@ {{#appDescription}} -{{{appDescription}}} +{{{.}}} {{/appDescription}} ## Requirements @@ -63,7 +63,7 @@ Map params = new Map{ try { // cross your fingers - {{#returnType}}{{{returnType}}} result = {{/returnType}}api.{{{operationId}}}({{#hasParams}}params{{/hasParams}}); + {{#returnType}}{{{.}}} result = {{/returnType}}api.{{{operationId}}}({{#hasParams}}params{{/hasParams}}); {{#returnType}} System.debug(result); {{/returnType}} @@ -78,7 +78,7 @@ All URIs are relative to *{{basePath}}* Class | Method | HTTP request | Description ------------ | ------------- | ------------- | ------------- -{{#apiInfo}}{{#apis}}{{#operations}}{{#operation}}*{{classname}}* | [**{{operationId}}**]({{apiDocPath}}{{classname}}.md#{{operationId}}) | **{{httpMethod}}** {{path}} | {{#summary}}{{summary}}{{/summary}} +{{#apiInfo}}{{#apis}}{{#operations}}{{#operation}}*{{classname}}* | [**{{operationId}}**]({{apiDocPath}}{{classname}}.md#{{operationId}}) | **{{httpMethod}}** {{path}} | {{summary}} {{/operation}}{{/operations}}{{/apis}}{{/apiInfo}} ## Documentation for Models diff --git a/modules/openapi-generator/src/main/resources/apex/api.mustache b/modules/openapi-generator/src/main/resources/apex/api.mustache index 3683b7cf5b1..eff84988e22 100644 --- a/modules/openapi-generator/src/main/resources/apex/api.mustache +++ b/modules/openapi-generator/src/main/resources/apex/api.mustache @@ -23,11 +23,11 @@ public class {{classname}} { * @param {{paramName}} {{description}}{{#required}} (required){{/required}}{{^required}} (optional{{#defaultValue}}, default to {{{.}}}{{/defaultValue}}){{/required}} {{/allParams}} {{#returnType}} - * @return {{{returnType}}} + * @return {{{.}}} {{/returnType}} * @throws OAS.ApiException if fails to make API call */ - public {{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}void{{/returnType}} {{operationId}}({{#hasParams}}Map params{{/hasParams}}) { + public {{{returnType}}}{{^returnType}}void{{/returnType}} {{operationId}}({{#hasParams}}Map params{{/hasParams}}) { {{#allParams}} {{#required}} client.assertNotNull(params.get('{{paramName}}'), '{{paramName}}'); @@ -73,7 +73,7 @@ public class {{classname}} { {{/isArray}} {{/formParams}} - {{#returnType}}return ({{{returnType}}}) {{/returnType}}client.invoke( + {{#returnType}}return ({{{.}}}) {{/returnType}}client.invoke( '{{httpMethod}}', '{{path}}',{{#bodyParam}} ({{{dataType}}}) params.get('{{paramName}}'){{/bodyParam}}{{^bodyParam}} ''{{/bodyParam}}, query, form, @@ -106,7 +106,7 @@ public class {{classname}} { new List(), {{/hasAuthMethods}} {{#returnType}} - {{{returnType}}}.class + {{{.}}}.class {{/returnType}} {{^returnType}} null diff --git a/modules/openapi-generator/src/main/resources/apex/api_doc.mustache b/modules/openapi-generator/src/main/resources/apex/api_doc.mustache index 2b5bb723415..39a1770f24c 100644 --- a/modules/openapi-generator/src/main/resources/apex/api_doc.mustache +++ b/modules/openapi-generator/src/main/resources/apex/api_doc.mustache @@ -1,12 +1,12 @@ # {{classname}}{{#description}} -{{description}}{{/description}} +{{.}}{{/description}} All URIs are relative to *{{basePath}}* Method | HTTP request | Description ------------- | ------------- | ------------- -{{#operations}}{{#operation}}[**{{operationId}}**]({{classname}}.md#{{operationId}}) | **{{httpMethod}}** {{path}} | {{#summary}}{{summary}}{{/summary}} +{{#operations}}{{#operation}}[**{{operationId}}**]({{classname}}.md#{{operationId}}) | **{{httpMethod}}** {{path}} | {{summary}} {{/operation}}{{/operations}} {{#operations}} @@ -14,11 +14,11 @@ Method | HTTP request | Description ## {{operationId}} -> {{#returnType}}{{returnType}} {{/returnType}}{{operationId}}({{#allParams}}{{{paramName}}}{{^-last}}, {{/-last}}{{/allParams}}) +> {{#returnType}}{{.}} {{/returnType}}{{operationId}}({{#allParams}}{{{paramName}}}{{^-last}}, {{/-last}}{{/allParams}}) {{summary}}{{#notes}} -{{notes}}{{/notes}} +{{.}}{{/notes}} ### Example @@ -53,7 +53,7 @@ Map params = new Map{ try { // cross your fingers - {{#returnType}}{{{returnType}}} result = {{/returnType}}api.{{{operationId}}}({{#hasParams}}params{{/hasParams}}); + {{#returnType}}{{{.}}} result = {{/returnType}}api.{{{operationId}}}({{#hasParams}}params{{/hasParams}}); {{#returnType}} System.debug(result); {{/returnType}} @@ -67,7 +67,7 @@ try { {{^allParams}}This endpoint does not need any parameter.{{/allParams}}{{#allParams}}{{#-last}} Name | Type | Description | Notes ------------- | ------------- | ------------- | -------------{{/-last}}{{/allParams}} -{{#allParams}} **{{paramName}}** | {{#isPrimitiveType}}**{{dataType}}**{{/isPrimitiveType}}{{^isPrimitiveType}}{{#isFile}}**{{dataType}}**{{/isFile}}{{^isFile}}[**{{dataType}}**]({{baseType}}.md){{/isFile}}{{/isPrimitiveType}}| {{description}} |{{^required}} [optional]{{/required}}{{#defaultValue}} [default to {{defaultValue}}]{{/defaultValue}}{{#allowableValues}} [enum: {{#values}}{{{.}}}{{^-last}}, {{/-last}}{{/values}}]{{/allowableValues}} +{{#allParams}} **{{paramName}}** | {{#isPrimitiveType}}**{{dataType}}**{{/isPrimitiveType}}{{^isPrimitiveType}}{{#isFile}}**{{dataType}}**{{/isFile}}{{^isFile}}[**{{dataType}}**]({{baseType}}.md){{/isFile}}{{/isPrimitiveType}}| {{description}} |{{^required}} [optional]{{/required}}{{#defaultValue}} [default to {{.}}]{{/defaultValue}}{{#allowableValues}} [enum: {{#values}}{{{.}}}{{^-last}}, {{/-last}}{{/values}}]{{/allowableValues}} {{/allParams}} ### Return type diff --git a/modules/openapi-generator/src/main/resources/apex/git_push.sh.mustache b/modules/openapi-generator/src/main/resources/apex/git_push.sh.mustache index 8b3f689c912..f0bed5bd841 100644 --- a/modules/openapi-generator/src/main/resources/apex/git_push.sh.mustache +++ b/modules/openapi-generator/src/main/resources/apex/git_push.sh.mustache @@ -55,4 +55,3 @@ git pull origin master # Pushes (Forces) the changes in the local repository up to the remote repository echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" git push origin master 2>&1 | grep -v 'To https' - diff --git a/modules/openapi-generator/src/main/resources/apex/licenseInfo.mustache b/modules/openapi-generator/src/main/resources/apex/licenseInfo.mustache index 3f52a36757f..0ef467e8321 100644 --- a/modules/openapi-generator/src/main/resources/apex/licenseInfo.mustache +++ b/modules/openapi-generator/src/main/resources/apex/licenseInfo.mustache @@ -2,8 +2,8 @@ * {{{appName}}} * {{{appDescription}}} * - * {{#version}}The version of the OpenAPI document: {{{version}}}{{/version}} - * {{#infoEmail}}Contact: {{{infoEmail}}}{{/infoEmail}} + * {{#version}}The version of the OpenAPI document: {{{.}}}{{/version}} + * {{#infoEmail}}Contact: {{{.}}}{{/infoEmail}} * * NOTE: This class is auto generated by the OAS code generator program. * https://github.com/OpenAPITools/openapi-generator diff --git a/modules/openapi-generator/src/main/resources/apex/modelEnum.mustache b/modules/openapi-generator/src/main/resources/apex/modelEnum.mustache index ad4d173fe5d..909b57af16f 100644 --- a/modules/openapi-generator/src/main/resources/apex/modelEnum.mustache +++ b/modules/openapi-generator/src/main/resources/apex/modelEnum.mustache @@ -1,7 +1,7 @@ /** - * {{^description}}Gets or Sets {{{name}}}{{/description}}{{#description}}{{{description}}}{{/description}} + * {{^description}}Gets or Sets {{{name}}}{{/description}}{{{description}}} */ -{{>additionalEnumTypeAnnotations}}public enum {{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} { +{{>additionalEnumTypeAnnotations}}public enum {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} { {{#allowableValues}} {{#enumVars}} {{name}}{{^-last}},{{/-last}} diff --git a/modules/openapi-generator/src/main/resources/apex/modelInnerEnum.mustache b/modules/openapi-generator/src/main/resources/apex/modelInnerEnum.mustache index c21dd1e3f0d..d0b3c7a08a3 100644 --- a/modules/openapi-generator/src/main/resources/apex/modelInnerEnum.mustache +++ b/modules/openapi-generator/src/main/resources/apex/modelInnerEnum.mustache @@ -1,7 +1,7 @@ /** - * {{^description}}Gets or Sets {{{name}}}{{/description}}{{#description}}{{{description}}}{{/description}} + * {{^description}}Gets or Sets {{{name}}}{{/description}}{{{description}}} */ - {{>additionalEnumTypeAnnotations}}public enum {{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}} { + {{>additionalEnumTypeAnnotations}}public enum {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}} { {{#allowableValues}} {{#enumVars}} {{{name}}}{{^-last}},{{/-last}} diff --git a/modules/openapi-generator/src/main/resources/apex/package.mustache b/modules/openapi-generator/src/main/resources/apex/package.mustache index cee19208383..ec3d92d2510 100644 --- a/modules/openapi-generator/src/main/resources/apex/package.mustache +++ b/modules/openapi-generator/src/main/resources/apex/package.mustache @@ -2,7 +2,7 @@ {{appName}} API Client Client library for calling the {{appName}} API.{{#appDescription}} -{{{appDescription}}}{{/appDescription}} +{{{.}}}{{/appDescription}} Generated with OAS Codegen (github.com/OAS-api/OAS-codegen) {{#apiInfo}} diff --git a/modules/openapi-generator/src/main/resources/apex/pojo.mustache b/modules/openapi-generator/src/main/resources/apex/pojo.mustache index c3a5126aeb6..bb21f63f548 100644 --- a/modules/openapi-generator/src/main/resources/apex/pojo.mustache +++ b/modules/openapi-generator/src/main/resources/apex/pojo.mustache @@ -1,7 +1,7 @@ /** - * {{#description}}{{.}}{{/description}}{{^description}}{{classname}}{{/description}} + * {{description}}{{^description}}{{classname}}{{/description}} */{{>additionalModelTypeAnnotations}} -public class {{classname}}{{#parent}} extends {{{parent}}}{{/parent}}{{#interfaces}}{{#-first}} implements {{/-first}}{{^-first}}, {{/-first}}{{.}}{{/interfaces}} { +public class {{classname}}{{#parent}} extends {{{.}}}{{/parent}}{{#interfaces}}{{#-first}} implements {{/-first}}{{^-first}}, {{/-first}}{{.}}{{/interfaces}} { {{#vars}} {{#isEnum}} {{^isContainer}} @@ -17,16 +17,16 @@ public class {{classname}}{{#parent}} extends {{{parent}}}{{/parent}}{{#interfac {{/items.isEnum}} /** {{#description}} - * {{{description}}} + * {{{.}}} {{/description}} {{^description}} * Get {{name}} {{/description}} {{#minimum}} - * minimum: {{minimum}} + * minimum: {{.}} {{/minimum}} {{#maximum}} - * maximum: {{maximum}} + * maximum: {{.}} {{/maximum}} * @return {{name}} */ diff --git a/modules/openapi-generator/src/main/resources/asciidoc-documentation/index.mustache b/modules/openapi-generator/src/main/resources/asciidoc-documentation/index.mustache index fcab76298ef..48d810d038a 100644 --- a/modules/openapi-generator/src/main/resources/asciidoc-documentation/index.mustache +++ b/modules/openapi-generator/src/main/resources/asciidoc-documentation/index.mustache @@ -1,12 +1,12 @@ = {{{appName}}} -{{#headerAttributes}} +{{#headerAttributes}} {{infoEmail}} -{{#version}}{{{version}}}{{/version}} +{{{version}}} :toc: left :numbered: :toclevels: 3 :source-highlighter: highlightjs -:keywords: openapi, rest, {{appName}} +:keywords: openapi, rest, {{appName}} :specDir: {{specDir}} :snippetDir: {{snippetDir}} :generator-template: v1 2019-12-20 @@ -59,13 +59,13 @@ Operation Id:: {{nickname}} {{/useMethodAndPath}} {{^useMethodAndPath}} ==== {{nickname}} - + `{{httpMethod}} {{path}}` {{/useMethodAndPath}} {{{summary}}} -===== Description +===== Description {{{notes}}} @@ -81,7 +81,7 @@ Operation Id:: {{nickname}} {{/hasReference}} {{^hasReference}} -{{#returnType}}<<{{returnType}}>>{{/returnType}} +{{#returnType}}<<{{.}}>>{{/returnType}} {{^returnType}}-{{/returnType}} {{/hasReference}} @@ -97,8 +97,8 @@ Operation Id:: {{nickname}} .http response codes [cols="2,3,1"] -|=== -| Code | Message | Datatype +|=== +| Code | Message | Datatype {{#responses}} @@ -107,7 +107,7 @@ Operation Id:: {{nickname}} | {{^simpleType}}{{dataType}}[<<{{baseType}}>>]{{/simpleType}} {{#simpleType}}<<{{dataType}}>>{{/simpleType}} {{/responses}} -|=== +|=== {{^skipExamples}} ===== Samples diff --git a/modules/openapi-generator/src/main/resources/asciidoc-documentation/model.mustache b/modules/openapi-generator/src/main/resources/asciidoc-documentation/model.mustache index c5f93d6afdb..604d7d14c4a 100644 --- a/modules/openapi-generator/src/main/resources/asciidoc-documentation/model.mustache +++ b/modules/openapi-generator/src/main/resources/asciidoc-documentation/model.mustache @@ -11,13 +11,13 @@ [.fields-{{classname}}] [cols="2,1,2,4,1"] -|=== +|=== | Field Name| Required| Type| Description| Format {{#vars}} -| {{baseName}} -| {{#required}}X{{/required}} -| {{dataType}} {{#isContainer}} of <<{{complexType}}>>{{/isContainer}} +| {{baseName}} +| {{#required}}X{{/required}} +| {{dataType}} {{#isContainer}} of <<{{complexType}}>>{{/isContainer}} | {{description}} | {{{dataFormat}}} {{#isEnum}}_Enum:_ {{#_enum}}{{this}}, {{/_enum}}{{/isEnum}} diff --git a/modules/openapi-generator/src/main/resources/asciidoc-documentation/param.mustache b/modules/openapi-generator/src/main/resources/asciidoc-documentation/param.mustache index 563e7976fdf..df96a59769f 100644 --- a/modules/openapi-generator/src/main/resources/asciidoc-documentation/param.mustache +++ b/modules/openapi-generator/src/main/resources/asciidoc-documentation/param.mustache @@ -1,5 +1,5 @@ -| {{baseName}} -| {{description}} {{#baseType}}<<{{baseType}}>>{{/baseType}} -| {{^required}}-{{/required}}{{#required}}X{{/required}} -| {{defaultValue}} -| {{{pattern}}} +| {{baseName}} +| {{description}} {{#baseType}}<<{{.}}>>{{/baseType}} +| {{^required}}-{{/required}}{{#required}}X{{/required}} +| {{defaultValue}} +| {{{pattern}}} diff --git a/modules/openapi-generator/src/main/resources/asciidoc-documentation/params.mustache b/modules/openapi-generator/src/main/resources/asciidoc-documentation/params.mustache index 7307bf155e8..76409161eff 100644 --- a/modules/openapi-generator/src/main/resources/asciidoc-documentation/params.mustache +++ b/modules/openapi-generator/src/main/resources/asciidoc-documentation/params.mustache @@ -9,13 +9,13 @@ {{#useTableTitles}} .Path Parameters {{/useTableTitles}} -|=== +|=== |Name| Description| Required| Default| Pattern {{#pathParams}} {{>param}} {{/pathParams}} -|=== +|=== {{/hasPathParams}} {{#hasBodyParam}} @@ -27,13 +27,13 @@ {{#useTableTitles}} .Body Parameter {{/useTableTitles}} -|=== +|=== |Name| Description| Required| Default| Pattern {{#bodyParams}} {{>param}} {{/bodyParams}} -|=== +|=== {{/hasBodyParam}} {{#hasFormParams}} @@ -45,13 +45,13 @@ {{#useTableTitles}} .Form Parameters {{/useTableTitles}} -|=== +|=== |Name| Description| Required| Default| Pattern {{#formParams}} {{>param}} {{/formParams}} -|=== +|=== {{/hasFormParams}} {{#hasHeaderParams}} @@ -63,13 +63,13 @@ {{#useTableTitles}} .Header Parameters {{/useTableTitles}} -|=== +|=== |Name| Description| Required| Default| Pattern {{#headerParams}} {{>param}} {{/headerParams}} -|=== +|=== {{/hasHeaderParams}} {{#hasQueryParams}} @@ -81,11 +81,11 @@ {{#useTableTitles}} .Query Parameters {{/useTableTitles}} -|=== +|=== |Name| Description| Required| Default| Pattern {{#queryParams}} {{>param}} {{/queryParams}} -|=== +|=== {{/hasQueryParams}} diff --git a/modules/openapi-generator/src/main/resources/aspnetcore/2.0/Filters/GeneratePathParamsValidationFilter.mustache b/modules/openapi-generator/src/main/resources/aspnetcore/2.0/Filters/GeneratePathParamsValidationFilter.mustache index d857a4a0f96..e990e87db3b 100644 --- a/modules/openapi-generator/src/main/resources/aspnetcore/2.0/Filters/GeneratePathParamsValidationFilter.mustache +++ b/modules/openapi-generator/src/main/resources/aspnetcore/2.0/Filters/GeneratePathParamsValidationFilter.mustache @@ -94,4 +94,3 @@ namespace {{packageName}}.Filters } } } - diff --git a/modules/openapi-generator/src/main/resources/aspnetcore/2.0/Formatters/InputFormatterStream.mustache b/modules/openapi-generator/src/main/resources/aspnetcore/2.0/Formatters/InputFormatterStream.mustache index f1a002ded67..e24d0a237a1 100644 --- a/modules/openapi-generator/src/main/resources/aspnetcore/2.0/Formatters/InputFormatterStream.mustache +++ b/modules/openapi-generator/src/main/resources/aspnetcore/2.0/Formatters/InputFormatterStream.mustache @@ -13,7 +13,7 @@ namespace {{packageName}}.Formatters SupportedMediaTypes.Add("application/octet-stream"); SupportedMediaTypes.Add("image/jpeg"); } - + protected override bool CanReadType(Type type) { if (type == typeof(Stream)) diff --git a/modules/openapi-generator/src/main/resources/aspnetcore/2.0/Program.mustache b/modules/openapi-generator/src/main/resources/aspnetcore/2.0/Program.mustache index 7de83779983..75b5d9d0675 100644 --- a/modules/openapi-generator/src/main/resources/aspnetcore/2.0/Program.mustache +++ b/modules/openapi-generator/src/main/resources/aspnetcore/2.0/Program.mustache @@ -24,8 +24,8 @@ namespace {{packageName}} /// Webhost public static IWebHost BuildWebHost(string[] args) => WebHost.CreateDefaultBuilder(args) - .UseStartup() - .UseUrls("http://0.0.0.0:{{#serverPort}}{{serverPort}}{{/serverPort}}{{^serverPort}}8080{{/serverPort}}/") + .UseStartup() + .UseUrls("http://0.0.0.0:{{serverPort}}{{^serverPort}}8080{{/serverPort}}/") .Build(); } } diff --git a/modules/openapi-generator/src/main/resources/aspnetcore/2.0/Project.csproj.mustache b/modules/openapi-generator/src/main/resources/aspnetcore/2.0/Project.csproj.mustache index 6732557feeb..c67bdaab878 100644 --- a/modules/openapi-generator/src/main/resources/aspnetcore/2.0/Project.csproj.mustache +++ b/modules/openapi-generator/src/main/resources/aspnetcore/2.0/Project.csproj.mustache @@ -1,6 +1,6 @@ - {{^packageDescription}}{{packageName}}{{/packageDescription}}{{packageDescription}} + {{packageDescription}}{{^packageDescription}}{{packageName}}{{/packageDescription}} {{packageCopyright}} {{packageAuthors}} netcoreapp2.0 diff --git a/modules/openapi-generator/src/main/resources/aspnetcore/2.0/README.mustache b/modules/openapi-generator/src/main/resources/aspnetcore/2.0/README.mustache index 37794bd48e0..eb041c5f9e8 100644 --- a/modules/openapi-generator/src/main/resources/aspnetcore/2.0/README.mustache +++ b/modules/openapi-generator/src/main/resources/aspnetcore/2.0/README.mustache @@ -1,7 +1,7 @@ # {{packageName}} - ASP.NET Core 2.0 Server {{#appDescriptionWithNewLines}} -{{{appDescriptionWithNewLines}}} +{{{.}}} {{/appDescriptionWithNewLines}} ## Run diff --git a/modules/openapi-generator/src/main/resources/aspnetcore/2.0/Startup.mustache b/modules/openapi-generator/src/main/resources/aspnetcore/2.0/Startup.mustache index 044ce0c80e0..fd0b75634c4 100644 --- a/modules/openapi-generator/src/main/resources/aspnetcore/2.0/Startup.mustache +++ b/modules/openapi-generator/src/main/resources/aspnetcore/2.0/Startup.mustache @@ -56,25 +56,25 @@ namespace {{packageName}} services .AddSwaggerGen(c => { - c.SwaggerDoc("{{#version}}{{{version}}}{{/version}}{{^version}}v1{{/version}}", new Info + c.SwaggerDoc("{{{version}}}{{^version}}v1{{/version}}", new Info { - Version = "{{#version}}{{{version}}}{{/version}}{{^version}}v1{{/version}}", - Title = "{{#appName}}{{{appName}}}{{/appName}}{{^appName}}{{packageName}}{{/appName}}", - Description = "{{#appName}}{{{appName}}}{{/appName}}{{^appName}}{{packageName}}{{/appName}} (ASP.NET Core 2.0)", + Version = "{{{version}}}{{^version}}v1{{/version}}", + Title = "{{{appName}}}{{^appName}}{{packageName}}{{/appName}}", + Description = "{{{appName}}}{{^appName}}{{packageName}}{{/appName}} (ASP.NET Core 2.0)", Contact = new Contact() { - Name = "{{#infoName}}{{{infoName}}}{{/infoName}}{{^infoName}}OpenAPI-Generator Contributors{{/infoName}}", - Url = "{{#infoUrl}}{{{infoUrl}}}{{/infoUrl}}{{^infoUrl}}https://github.com/openapitools/openapi-generator{{/infoUrl}}", - Email = "{{#infoEmail}}{{{infoEmail}}}{{/infoEmail}}" + Name = "{{{infoName}}}{{^infoName}}OpenAPI-Generator Contributors{{/infoName}}", + Url = "{{{infoUrl}}}{{^infoUrl}}https://github.com/openapitools/openapi-generator{{/infoUrl}}", + Email = "{{{infoEmail}}}" }, - TermsOfService = "{{#termsOfService}}{{{termsOfService}}}{{/termsOfService}}" + TermsOfService = "{{{termsOfService}}}" }); c.CustomSchemaIds(type => type.FriendlyId(true)); c.DescribeAllEnumsAsStrings(); c.IncludeXmlComments($"{AppContext.BaseDirectory}{Path.DirectorySeparatorChar}{_hostingEnv.ApplicationName}.xml"); {{#basePathWithoutHost}} // Sets the basePath property in the Swagger document generated - c.DocumentFilter("{{{basePathWithoutHost}}}"); + c.DocumentFilter("{{{.}}}"); {{/basePathWithoutHost}} // Include DataAnnotation attributes on Controller Action parameters as Swagger validation rules (e.g required, pattern, ..) @@ -100,10 +100,10 @@ namespace {{packageName}} .UseSwaggerUI(c => { //TODO: Either use the SwaggerGen generated Swagger contract (generated from C# classes) - c.SwaggerEndpoint("/swagger/{{#version}}{{{version}}}{{/version}}{{^version}}v1{{/version}}/openapi.json", "{{#appName}}{{{appName}}}{{/appName}}{{^appName}}{{packageName}}{{/appName}}"); + c.SwaggerEndpoint("/swagger/{{{version}}}{{^version}}v1{{/version}}/openapi.json", "{{{appName}}}{{^appName}}{{packageName}}{{/appName}}"); //TODO: Or alternatively use the original Swagger contract that's included in the static files - // c.SwaggerEndpoint("/openapi-original.json", "{{#appName}}{{{appName}}}{{/appName}}{{^appName}}{{packageName}}{{/appName}} Original"); + // c.SwaggerEndpoint("/openapi-original.json", "{{{appName}}}{{^appName}}{{packageName}}{{/appName}} Original"); }){{/useSwashbuckle}}; if (_hostingEnv.IsDevelopment()) diff --git a/modules/openapi-generator/src/main/resources/aspnetcore/2.0/controller.mustache b/modules/openapi-generator/src/main/resources/aspnetcore/2.0/controller.mustache index a1b1701985d..ac89e53c31a 100644 --- a/modules/openapi-generator/src/main/resources/aspnetcore/2.0/controller.mustache +++ b/modules/openapi-generator/src/main/resources/aspnetcore/2.0/controller.mustache @@ -16,13 +16,13 @@ namespace {{packageName}}.Controllers /// /// {{description}} /// {{#description}} - [Description("{{description}}")]{{/description}} + [Description("{{.}}")]{{/description}} public class {{classname}}Controller : Controller { {{#operation}} /// - /// {{#summary}}{{summary}}{{/summary}} + /// {{summary}} /// {{#notes}} - /// {{notes}}{{/notes}}{{#allParams}} + /// {{.}}{{/notes}}{{#allParams}} /// {{description}}{{#isDeprecated}} (deprecated){{/isDeprecated}}{{/allParams}}{{#responses}} /// {{message}}{{/responses}} [{{httpMethod}}] @@ -32,7 +32,7 @@ namespace {{packageName}}.Controllers {{/vendorExtensions.x-aspnetcore-consumes}} [ValidateModelState]{{#useSwashbuckle}} [SwaggerOperation("{{operationId}}")]{{#responses}}{{#dataType}} - [SwaggerResponse(statusCode: {{code}}, type: typeof({{&dataType}}), description: "{{message}}")]{{/dataType}}{{^dataType}}{{/dataType}}{{/responses}}{{/useSwashbuckle}} + [SwaggerResponse(statusCode: {{code}}, type: typeof({{&dataType}}), description: "{{message}}")]{{/dataType}}{{/responses}}{{/useSwashbuckle}} {{#isDeprecated}} [Obsolete] {{/isDeprecated}} diff --git a/modules/openapi-generator/src/main/resources/aspnetcore/2.0/enumClass.mustache b/modules/openapi-generator/src/main/resources/aspnetcore/2.0/enumClass.mustache index a8a68b99844..ba23434982a 100644 --- a/modules/openapi-generator/src/main/resources/aspnetcore/2.0/enumClass.mustache +++ b/modules/openapi-generator/src/main/resources/aspnetcore/2.0/enumClass.mustache @@ -1,12 +1,12 @@ /// - /// {{^description}}Gets or Sets {{{name}}}{{/description}}{{#description}}{{{description}}}{{/description}} + /// {{^description}}Gets or Sets {{{name}}}{{/description}}{{{description}}} /// {{#description}} - /// {{{description}}} + /// {{{.}}} {{/description}} {{#allowableValues}}{{#enumVars}}{{#-first}}{{#isString}}[JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))]{{/isString}}{{/-first}}{{/enumVars}}{{/allowableValues}} - public enum {{#datatypeWithEnum}}{{.}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}} + public enum {{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}} { {{#allowableValues}}{{#enumVars}} /// diff --git a/modules/openapi-generator/src/main/resources/aspnetcore/2.0/formParam.mustache b/modules/openapi-generator/src/main/resources/aspnetcore/2.0/formParam.mustache index 7c9085c62df..e2c1c23a407 100644 --- a/modules/openapi-generator/src/main/resources/aspnetcore/2.0/formParam.mustache +++ b/modules/openapi-generator/src/main/resources/aspnetcore/2.0/formParam.mustache @@ -1 +1 @@ -{{#isFormParam}}{{^isBinary}}[FromForm (Name = "{{baseName}}")]{{/isBinary}}{{#required}}[Required()]{{/required}}{{#pattern}}[RegularExpression("{{{pattern}}}")]{{/pattern}}{{#minLength}}{{#maxLength}}[StringLength({{maxLength}}, MinimumLength={{minLength}})]{{/maxLength}}{{/minLength}}{{#minLength}}{{^maxLength}} [MinLength({{minLength}})]{{/maxLength}}{{/minLength}}{{^minLength}}{{#maxLength}} [MaxLength({{maxLength}})]{{/maxLength}}{{/minLength}}{{#minimum}}{{#maximum}}[Range({{minimum}}, {{maximum}})]{{/maximum}}{{/minimum}}{{&dataType}} {{paramName}}{{/isFormParam}} \ No newline at end of file +{{#isFormParam}}{{^isBinary}}[FromForm (Name = "{{baseName}}")]{{/isBinary}}{{#required}}[Required()]{{/required}}{{#pattern}}[RegularExpression("{{{.}}}")]{{/pattern}}{{#minLength}}{{#maxLength}}[StringLength({{maxLength}}, MinimumLength={{minLength}})]{{/maxLength}}{{/minLength}}{{#minLength}}{{^maxLength}} [MinLength({{minLength}})]{{/maxLength}}{{/minLength}}{{^minLength}}{{#maxLength}} [MaxLength({{.}})]{{/maxLength}}{{/minLength}}{{#minimum}}{{#maximum}}[Range({{minimum}}, {{maximum}})]{{/maximum}}{{/minimum}}{{&dataType}} {{paramName}}{{/isFormParam}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/aspnetcore/2.0/headerParam.mustache b/modules/openapi-generator/src/main/resources/aspnetcore/2.0/headerParam.mustache index 45a5be9d7b5..674e03952fd 100644 --- a/modules/openapi-generator/src/main/resources/aspnetcore/2.0/headerParam.mustache +++ b/modules/openapi-generator/src/main/resources/aspnetcore/2.0/headerParam.mustache @@ -1 +1 @@ -{{#isHeaderParam}}[FromHeader]{{#required}}[Required()]{{/required}}{{#pattern}}[RegularExpression("{{{pattern}}}")]{{/pattern}}{{#minLength}}{{#maxLength}}[StringLength({{maxLength}}, MinimumLength={{minLength}}){{/maxLength}}{{/minLength}}{{#minLength}}{{^maxLength}} [MinLength({{minLength}})]{{/maxLength}}{{/minLength}}{{^minLength}}{{#maxLength}} [MaxLength({{maxLength}})]{{/maxLength}}{{/minLength}}{{#minimum}}{{#maximum}}[Range({{minimum}}, {{maximum}})]{{/maximum}}{{/minimum}}{{&dataType}} {{paramName}}{{/isHeaderParam}} \ No newline at end of file +{{#isHeaderParam}}[FromHeader]{{#required}}[Required()]{{/required}}{{#pattern}}[RegularExpression("{{{.}}}")]{{/pattern}}{{#minLength}}{{#maxLength}}[StringLength({{maxLength}}, MinimumLength={{minLength}}){{/maxLength}}{{/minLength}}{{#minLength}}{{^maxLength}} [MinLength({{minLength}})]{{/maxLength}}{{/minLength}}{{^minLength}}{{#maxLength}} [MaxLength({{.}})]{{/maxLength}}{{/minLength}}{{#minimum}}{{#maximum}}[Range({{minimum}}, {{maximum}})]{{/maximum}}{{/minimum}}{{&dataType}} {{paramName}}{{/isHeaderParam}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/aspnetcore/2.0/listReturn.mustache b/modules/openapi-generator/src/main/resources/aspnetcore/2.0/listReturn.mustache index d609e67148c..9f18d71d04c 100644 --- a/modules/openapi-generator/src/main/resources/aspnetcore/2.0/listReturn.mustache +++ b/modules/openapi-generator/src/main/resources/aspnetcore/2.0/listReturn.mustache @@ -1,4 +1,4 @@ var example = exampleJson != null - ? JsonConvert.DeserializeObject<{{returnContainer}}<{{#returnType}}{{{returnType}}}{{/returnType}}>>(exampleJson) - : Enumerable.Empty<{{#returnType}}{{{returnType}}}{{/returnType}}>(); \ No newline at end of file + ? JsonConvert.DeserializeObject<{{returnContainer}}<{{{returnType}}}>>(exampleJson) + : Enumerable.Empty<{{{returnType}}}>(); \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/aspnetcore/2.0/mapReturn.mustache b/modules/openapi-generator/src/main/resources/aspnetcore/2.0/mapReturn.mustache index 856fb1b3507..94f16e11fdc 100644 --- a/modules/openapi-generator/src/main/resources/aspnetcore/2.0/mapReturn.mustache +++ b/modules/openapi-generator/src/main/resources/aspnetcore/2.0/mapReturn.mustache @@ -1,4 +1,4 @@ var example = exampleJson != null - ? JsonConvert.DeserializeObject>(exampleJson) - : new Dictionary<{{#returnType}}{{{returnType}}}{{/returnType}}>(); \ No newline at end of file + ? JsonConvert.DeserializeObject>(exampleJson) + : new Dictionary<{{{returnType}}}>(); \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/aspnetcore/2.0/model.mustache b/modules/openapi-generator/src/main/resources/aspnetcore/2.0/model.mustache index bf30b9f5795..d28375e4b9b 100644 --- a/modules/openapi-generator/src/main/resources/aspnetcore/2.0/model.mustache +++ b/modules/openapi-generator/src/main/resources/aspnetcore/2.0/model.mustache @@ -15,7 +15,7 @@ namespace {{packageName}}.Models /// {{description}} /// [DataContract] - public partial class {{classname}} : {{#parent}}{{{parent}}}, {{/parent}}IEquatable<{{classname}}> + public partial class {{classname}} : {{#parent}}{{{.}}}, {{/parent}}IEquatable<{{classname}}> { {{#vars}} {{#items.isEnum}} @@ -31,20 +31,20 @@ namespace {{packageName}}.Models {{/complexType}} {{/isEnum}} /// - /// {{^description}}Gets or Sets {{{name}}}{{/description}}{{#description}}{{description}}{{/description}} + /// {{description}}{{^description}}Gets or Sets {{{name}}}{{/description}} /// {{#description}} - /// {{description}} + /// {{.}} {{/description}} {{#required}} [Required] {{/required}} [DataMember(Name="{{baseName}}", EmitDefaultValue={{#isNullable}}true{{/isNullable}}{{^isNullable}}false{{/isNullable}})] {{#isEnum}} - public {{{datatypeWithEnum}}}{{#isEnum}}{{^isContainer}}?{{/isContainer}}{{/isEnum}} {{name}} { get; set; }{{#defaultValue}} = {{{defaultValue}}};{{/defaultValue}} + public {{{datatypeWithEnum}}}{{#isEnum}}{{^isContainer}}?{{/isContainer}}{{/isEnum}} {{name}} { get; set; }{{#defaultValue}} = {{{.}}};{{/defaultValue}} {{/isEnum}} {{^isEnum}} - public {{{dataType}}} {{name}} { get; {{#isReadOnly}}private {{/isReadOnly}}set; }{{#defaultValue}} = {{{defaultValue}}};{{/defaultValue}} + public {{{dataType}}} {{name}} { get; {{#isReadOnly}}private {{/isReadOnly}}set; }{{#defaultValue}} = {{{.}}};{{/defaultValue}} {{/isEnum}} {{^-last}} diff --git a/modules/openapi-generator/src/main/resources/aspnetcore/2.0/objectReturn.mustache b/modules/openapi-generator/src/main/resources/aspnetcore/2.0/objectReturn.mustache index 4059a61ac0b..b037a14ceba 100644 --- a/modules/openapi-generator/src/main/resources/aspnetcore/2.0/objectReturn.mustache +++ b/modules/openapi-generator/src/main/resources/aspnetcore/2.0/objectReturn.mustache @@ -1,4 +1,4 @@ var example = exampleJson != null - ? JsonConvert.DeserializeObject<{{#returnType}}{{{returnType}}}{{/returnType}}>(exampleJson) - : default({{#returnType}}{{{returnType}}}{{/returnType}}); \ No newline at end of file + ? JsonConvert.DeserializeObject<{{{returnType}}}>(exampleJson) + : default({{{returnType}}}); \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/aspnetcore/2.0/partial_header.mustache b/modules/openapi-generator/src/main/resources/aspnetcore/2.0/partial_header.mustache index 9eb233d1197..408d841df26 100644 --- a/modules/openapi-generator/src/main/resources/aspnetcore/2.0/partial_header.mustache +++ b/modules/openapi-generator/src/main/resources/aspnetcore/2.0/partial_header.mustache @@ -1,13 +1,13 @@ /* {{#appName}} - * {{{appName}}} + * {{{.}}} * {{/appName}} {{#appDescription}} - * {{{appDescription}}} + * {{{.}}} * {{/appDescription}} - * {{#version}}The version of the OpenAPI document: {{{version}}}{{/version}} - * {{#infoEmail}}Contact: {{{infoEmail}}}{{/infoEmail}} + * {{#version}}The version of the OpenAPI document: {{{.}}}{{/version}} + * {{#infoEmail}}Contact: {{{.}}}{{/infoEmail}} * Generated by: https://openapi-generator.tech */ diff --git a/modules/openapi-generator/src/main/resources/aspnetcore/2.0/pathParam.mustache b/modules/openapi-generator/src/main/resources/aspnetcore/2.0/pathParam.mustache index e2a30150536..240144e0a80 100644 --- a/modules/openapi-generator/src/main/resources/aspnetcore/2.0/pathParam.mustache +++ b/modules/openapi-generator/src/main/resources/aspnetcore/2.0/pathParam.mustache @@ -1 +1 @@ -{{#isPathParam}}[FromRoute (Name = "{{baseName}}")]{{#required}}[Required]{{/required}}{{#pattern}}[RegularExpression("{{{pattern}}}")]{{/pattern}}{{#minLength}}{{#maxLength}}[StringLength({{maxLength}}, MinimumLength={{minLength}}){{/maxLength}}{{/minLength}}{{#minLength}}{{^maxLength}} [MinLength({{minLength}})]{{/maxLength}}{{/minLength}}{{^minLength}}{{#maxLength}} [MaxLength({{maxLength}})]{{/maxLength}}{{/minLength}}{{#minimum}}{{#maximum}}[Range({{minimum}}, {{maximum}})]{{/maximum}}{{/minimum}}{{&dataType}} {{paramName}}{{/isPathParam}} \ No newline at end of file +{{#isPathParam}}[FromRoute (Name = "{{baseName}}")]{{#required}}[Required]{{/required}}{{#pattern}}[RegularExpression("{{{.}}}")]{{/pattern}}{{#minLength}}{{#maxLength}}[StringLength({{maxLength}}, MinimumLength={{minLength}}){{/maxLength}}{{/minLength}}{{#minLength}}{{^maxLength}} [MinLength({{minLength}})]{{/maxLength}}{{/minLength}}{{^minLength}}{{#maxLength}} [MaxLength({{.}})]{{/maxLength}}{{/minLength}}{{#minimum}}{{#maximum}}[Range({{minimum}}, {{maximum}})]{{/maximum}}{{/minimum}}{{&dataType}} {{paramName}}{{/isPathParam}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/aspnetcore/2.0/queryParam.mustache b/modules/openapi-generator/src/main/resources/aspnetcore/2.0/queryParam.mustache index cafc0ccf868..b1d9a57e09d 100644 --- a/modules/openapi-generator/src/main/resources/aspnetcore/2.0/queryParam.mustache +++ b/modules/openapi-generator/src/main/resources/aspnetcore/2.0/queryParam.mustache @@ -1 +1 @@ -{{#isQueryParam}}[FromQuery (Name = "{{baseName}}")]{{#required}}[Required()]{{/required}}{{#pattern}}[RegularExpression("{{{pattern}}}")]{{/pattern}}{{#minLength}}{{#maxLength}}[StringLength({{maxLength}}, MinimumLength={{minLength}}){{/maxLength}}{{/minLength}}{{#minLength}}{{^maxLength}} [MinLength({{minLength}})]{{/maxLength}}{{/minLength}}{{^minLength}}{{#maxLength}} [MaxLength({{maxLength}})]{{/maxLength}}{{/minLength}}{{#minimum}}{{#maximum}}[Range({{minimum}}, {{maximum}})]{{/maximum}}{{/minimum}}{{&dataType}} {{paramName}}{{/isQueryParam}} \ No newline at end of file +{{#isQueryParam}}[FromQuery (Name = "{{baseName}}")]{{#required}}[Required()]{{/required}}{{#pattern}}[RegularExpression("{{{.}}}")]{{/pattern}}{{#minLength}}{{#maxLength}}[StringLength({{maxLength}}, MinimumLength={{minLength}}){{/maxLength}}{{/minLength}}{{#minLength}}{{^maxLength}} [MinLength({{minLength}})]{{/maxLength}}{{/minLength}}{{^minLength}}{{#maxLength}} [MaxLength({{.}})]{{/maxLength}}{{/minLength}}{{#minimum}}{{#maximum}}[Range({{minimum}}, {{maximum}})]{{/maximum}}{{/minimum}}{{&dataType}} {{paramName}}{{/isQueryParam}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/aspnetcore/2.0/validateModel.mustache b/modules/openapi-generator/src/main/resources/aspnetcore/2.0/validateModel.mustache index e11aaa5d270..0b2d5fdb70f 100644 --- a/modules/openapi-generator/src/main/resources/aspnetcore/2.0/validateModel.mustache +++ b/modules/openapi-generator/src/main/resources/aspnetcore/2.0/validateModel.mustache @@ -26,7 +26,7 @@ namespace {{packageName}}.Attributes { object args = null; if (context.ActionArguments.ContainsKey(parameter.Name)) - { + { args = context.ActionArguments[parameter.Name]; } diff --git a/modules/openapi-generator/src/main/resources/aspnetcore/2.1/Authentication/ApiAuthentication.mustache b/modules/openapi-generator/src/main/resources/aspnetcore/2.1/Authentication/ApiAuthentication.mustache index 755fefbd506..10ca7809ab8 100644 --- a/modules/openapi-generator/src/main/resources/aspnetcore/2.1/Authentication/ApiAuthentication.mustache +++ b/modules/openapi-generator/src/main/resources/aspnetcore/2.1/Authentication/ApiAuthentication.mustache @@ -69,4 +69,3 @@ namespace {{packageName}}.Authentication } } } - diff --git a/modules/openapi-generator/src/main/resources/aspnetcore/2.1/Filters/GeneratePathParamsValidationFilter.mustache b/modules/openapi-generator/src/main/resources/aspnetcore/2.1/Filters/GeneratePathParamsValidationFilter.mustache index d857a4a0f96..e990e87db3b 100644 --- a/modules/openapi-generator/src/main/resources/aspnetcore/2.1/Filters/GeneratePathParamsValidationFilter.mustache +++ b/modules/openapi-generator/src/main/resources/aspnetcore/2.1/Filters/GeneratePathParamsValidationFilter.mustache @@ -94,4 +94,3 @@ namespace {{packageName}}.Filters } } } - diff --git a/modules/openapi-generator/src/main/resources/aspnetcore/2.1/Formatters/InputFormatterStream.mustache b/modules/openapi-generator/src/main/resources/aspnetcore/2.1/Formatters/InputFormatterStream.mustache index f1a002ded67..e24d0a237a1 100644 --- a/modules/openapi-generator/src/main/resources/aspnetcore/2.1/Formatters/InputFormatterStream.mustache +++ b/modules/openapi-generator/src/main/resources/aspnetcore/2.1/Formatters/InputFormatterStream.mustache @@ -13,7 +13,7 @@ namespace {{packageName}}.Formatters SupportedMediaTypes.Add("application/octet-stream"); SupportedMediaTypes.Add("image/jpeg"); } - + protected override bool CanReadType(Type type) { if (type == typeof(Stream)) diff --git a/modules/openapi-generator/src/main/resources/aspnetcore/2.1/Program.mustache b/modules/openapi-generator/src/main/resources/aspnetcore/2.1/Program.mustache index 73cb81a3e41..ebe8176de55 100644 --- a/modules/openapi-generator/src/main/resources/aspnetcore/2.1/Program.mustache +++ b/modules/openapi-generator/src/main/resources/aspnetcore/2.1/Program.mustache @@ -25,6 +25,6 @@ namespace {{packageName}} public static IWebHostBuilder CreateWebHostBuilder(string[] args) => WebHost.CreateDefaultBuilder(args) .UseStartup() - .UseUrls("http://0.0.0.0:{{#serverPort}}{{serverPort}}{{/serverPort}}{{^serverPort}}8080{{/serverPort}}/"); + .UseUrls("http://0.0.0.0:{{serverPort}}{{^serverPort}}8080{{/serverPort}}/"); } } \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/aspnetcore/2.1/Project.csproj.mustache b/modules/openapi-generator/src/main/resources/aspnetcore/2.1/Project.csproj.mustache index 88a0fd7e44e..f257cb18aca 100644 --- a/modules/openapi-generator/src/main/resources/aspnetcore/2.1/Project.csproj.mustache +++ b/modules/openapi-generator/src/main/resources/aspnetcore/2.1/Project.csproj.mustache @@ -1,6 +1,6 @@ - {{^packageDescription}}{{packageName}}{{/packageDescription}}{{packageDescription}} + {{packageDescription}}{{^packageDescription}}{{packageName}}{{/packageDescription}} {{packageCopyright}} {{packageAuthors}} netcoreapp{{aspnetCoreVersion}} diff --git a/modules/openapi-generator/src/main/resources/aspnetcore/2.1/Project.nuspec.mustache b/modules/openapi-generator/src/main/resources/aspnetcore/2.1/Project.nuspec.mustache index d6a52c2c20a..0849b54d06d 100644 --- a/modules/openapi-generator/src/main/resources/aspnetcore/2.1/Project.nuspec.mustache +++ b/modules/openapi-generator/src/main/resources/aspnetcore/2.1/Project.nuspec.mustache @@ -12,7 +12,7 @@ http://ICON_URL_HERE_OR_DELETE_THIS_LINE --> false - {{^packageDescription}}{{packageName}}{{/packageDescription}}{{packageDescription}} + {{packageDescription}}{{^packageDescription}}{{packageName}}{{/packageDescription}} Summary of changes made in this release of the package. {{packageCopyright}} {{packageName}} diff --git a/modules/openapi-generator/src/main/resources/aspnetcore/2.1/README.mustache b/modules/openapi-generator/src/main/resources/aspnetcore/2.1/README.mustache index c5673ac9d1d..3602e5d507d 100644 --- a/modules/openapi-generator/src/main/resources/aspnetcore/2.1/README.mustache +++ b/modules/openapi-generator/src/main/resources/aspnetcore/2.1/README.mustache @@ -1,7 +1,7 @@ # {{packageName}} - ASP.NET Core {{aspnetCoreVersion}} Server {{#appDescriptionWithNewLines}} -{{{appDescriptionWithNewLines}}} +{{{.}}} {{/appDescriptionWithNewLines}} ## Run diff --git a/modules/openapi-generator/src/main/resources/aspnetcore/2.1/Startup.mustache b/modules/openapi-generator/src/main/resources/aspnetcore/2.1/Startup.mustache index 50ad25a5e41..7c25355f391 100644 --- a/modules/openapi-generator/src/main/resources/aspnetcore/2.1/Startup.mustache +++ b/modules/openapi-generator/src/main/resources/aspnetcore/2.1/Startup.mustache @@ -62,7 +62,7 @@ namespace {{packageName}} opts.InputFormatters.Insert(0, new InputFormatterStream()); }) {{#compatibilityVersion}} - .SetCompatibilityVersion(CompatibilityVersion.{{compatibilityVersion}}) + .SetCompatibilityVersion(CompatibilityVersion.{{.}}) {{/compatibilityVersion}} .{{#useNewtonsoft}}AddNewtonsoftJson{{/useNewtonsoft}}{{^useNewtonsoft}}AddJsonOptions{{/useNewtonsoft}}(opts => { @@ -77,25 +77,25 @@ namespace {{packageName}} services .AddSwaggerGen(c => { - c.SwaggerDoc("{{#version}}{{{version}}}{{/version}}{{^version}}v1{{/version}}", new Info + c.SwaggerDoc("{{{version}}}{{^version}}v1{{/version}}", new Info { - Version = "{{#version}}{{{version}}}{{/version}}{{^version}}v1{{/version}}", - Title = "{{#appName}}{{{appName}}}{{/appName}}{{^appName}}{{packageName}}{{/appName}}", - Description = "{{#appName}}{{{appName}}}{{/appName}}{{^appName}}{{packageName}}{{/appName}} (ASP.NET Core {{aspnetCoreVersion}})", + Version = "{{{version}}}{{^version}}v1{{/version}}", + Title = "{{{appName}}}{{^appName}}{{packageName}}{{/appName}}", + Description = "{{{appName}}}{{^appName}}{{packageName}}{{/appName}} (ASP.NET Core {{aspnetCoreVersion}})", Contact = new Contact() { - Name = "{{#infoName}}{{{infoName}}}{{/infoName}}{{^infoName}}OpenAPI-Generator Contributors{{/infoName}}", - Url = "{{#infoUrl}}{{{infoUrl}}}{{/infoUrl}}{{^infoUrl}}https://github.com/openapitools/openapi-generator{{/infoUrl}}", - Email = "{{#infoEmail}}{{{infoEmail}}}{{/infoEmail}}" + Name = "{{{infoName}}}{{^infoName}}OpenAPI-Generator Contributors{{/infoName}}", + Url = "{{{infoUrl}}}{{^infoUrl}}https://github.com/openapitools/openapi-generator{{/infoUrl}}", + Email = "{{{infoEmail}}}" }, - TermsOfService = "{{#termsOfService}}{{{termsOfService}}}{{/termsOfService}}" + TermsOfService = "{{{termsOfService}}}" }); c.CustomSchemaIds(type => type.FriendlyId(true)); c.DescribeAllEnumsAsStrings(); c.IncludeXmlComments($"{AppContext.BaseDirectory}{Path.DirectorySeparatorChar}{Assembly.GetEntryAssembly().GetName().Name}.xml"); {{#basePathWithoutHost}} // Sets the basePath property in the Swagger document generated - c.DocumentFilter("{{{basePathWithoutHost}}}"); + c.DocumentFilter("{{{.}}}"); {{/basePathWithoutHost}} // Include DataAnnotation attributes on Controller Action parameters as Swagger validation rules (e.g required, pattern, ..) @@ -123,10 +123,10 @@ namespace {{packageName}} .UseSwaggerUI(c => { //TODO: Either use the SwaggerGen generated Swagger contract (generated from C# classes) - c.SwaggerEndpoint("/swagger/{{#version}}{{{version}}}{{/version}}{{^version}}v1{{/version}}/openapi.json", "{{#appName}}{{{appName}}}{{/appName}}{{^appName}}{{packageName}}{{/appName}}"); + c.SwaggerEndpoint("/swagger/{{{version}}}{{^version}}v1{{/version}}/openapi.json", "{{{appName}}}{{^appName}}{{packageName}}{{/appName}}"); //TODO: Or alternatively use the original Swagger contract that's included in the static files - // c.SwaggerEndpoint("/openapi-original.json", "{{#appName}}{{{appName}}}{{/appName}}{{^appName}}{{packageName}}{{/appName}} Original"); + // c.SwaggerEndpoint("/openapi-original.json", "{{{appName}}}{{^appName}}{{packageName}}{{/appName}} Original"); }){{/useSwashbuckle}}; {{^useDefaultRouting}} app.UseRouting(); diff --git a/modules/openapi-generator/src/main/resources/aspnetcore/2.1/controller.mustache b/modules/openapi-generator/src/main/resources/aspnetcore/2.1/controller.mustache index c8203923b9d..52b6ec5c5ee 100644 --- a/modules/openapi-generator/src/main/resources/aspnetcore/2.1/controller.mustache +++ b/modules/openapi-generator/src/main/resources/aspnetcore/2.1/controller.mustache @@ -23,14 +23,14 @@ namespace {{apiPackage}} /// /// {{description}} /// {{#description}} - [Description("{{description}}")]{{/description}} + [Description("{{.}}")]{{/description}} [ApiController] - public {{#classModifier}}{{classModifier}} {{/classModifier}}class {{classname}}Controller : ControllerBase + public {{#classModifier}}{{.}} {{/classModifier}}class {{classname}}Controller : ControllerBase { {{#operation}} /// - /// {{#summary}}{{summary}}{{/summary}} + /// {{summary}} /// {{#notes}} - /// {{notes}}{{/notes}}{{#allParams}} + /// {{.}}{{/notes}}{{#allParams}} /// {{description}}{{#isDeprecated}} (deprecated){{/isDeprecated}}{{/allParams}}{{#responses}} /// {{message}}{{/responses}} [{{httpMethod}}] @@ -48,14 +48,14 @@ namespace {{apiPackage}} {{/vendorExtensions.x-aspnetcore-consumes}} [ValidateModelState]{{#useSwashbuckle}} [SwaggerOperation("{{operationId}}")]{{#responses}}{{#dataType}} - [SwaggerResponse(statusCode: {{code}}, type: typeof({{&dataType}}), description: "{{message}}")]{{/dataType}}{{^dataType}}{{/dataType}}{{/responses}}{{/useSwashbuckle}}{{^useSwashbuckle}}{{#responses}}{{#dataType}} - [ProducesResponseType(statusCode: {{code}}, type: typeof({{&dataType}}))]{{/dataType}}{{^dataType}}{{/dataType}}{{/responses}}{{/useSwashbuckle}} + [SwaggerResponse(statusCode: {{code}}, type: typeof({{&dataType}}), description: "{{message}}")]{{/dataType}}{{/responses}}{{/useSwashbuckle}}{{^useSwashbuckle}}{{#responses}}{{#dataType}} + [ProducesResponseType(statusCode: {{code}}, type: typeof({{&dataType}}))]{{/dataType}}{{/responses}}{{/useSwashbuckle}} {{#isDeprecated}} [Obsolete] {{/isDeprecated}} public {{operationModifier}} {{#operationResultTask}}{{#operationIsAsync}}async {{/operationIsAsync}}Task<{{/operationResultTask}}IActionResult{{#operationResultTask}}>{{/operationResultTask}} {{operationId}}({{#allParams}}{{>pathParam}}{{>queryParam}}{{>bodyParam}}{{>formParam}}{{>headerParam}}{{^-last}}{{^isCookieParam}}, {{/isCookieParam}}{{/-last}}{{/allParams}}){{^generateBody}};{{/generateBody}} {{#generateBody}} - { + { {{#cookieParams}} var {{paramName}} = Request.Cookies["{{paramName}}"]; {{/cookieParams}} diff --git a/modules/openapi-generator/src/main/resources/aspnetcore/2.1/enumClass.mustache b/modules/openapi-generator/src/main/resources/aspnetcore/2.1/enumClass.mustache index 8a932b5ade6..cd6595452ae 100644 --- a/modules/openapi-generator/src/main/resources/aspnetcore/2.1/enumClass.mustache +++ b/modules/openapi-generator/src/main/resources/aspnetcore/2.1/enumClass.mustache @@ -1,13 +1,13 @@ /// - /// {{^description}}Gets or Sets {{{name}}}{{/description}}{{#description}}{{{description}}}{{/description}} + /// {{^description}}Gets or Sets {{{name}}}{{/description}}{{{description}}} /// {{#description}} - /// {{{description}}} + /// {{{.}}} {{/description}} - {{#allowableValues}}{{#enumVars}}{{#-first}}{{#isString}}[TypeConverter(typeof(CustomEnumConverter<{{#datatypeWithEnum}}{{.}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}>))] + {{#allowableValues}}{{#enumVars}}{{#-first}}{{#isString}}[TypeConverter(typeof(CustomEnumConverter<{{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}>))] [JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))]{{/isString}}{{/-first}}{{/enumVars}}{{/allowableValues}} - public enum {{#datatypeWithEnum}}{{.}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}} + public enum {{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}} { {{#allowableValues}}{{#enumVars}} /// diff --git a/modules/openapi-generator/src/main/resources/aspnetcore/2.1/formParam.mustache b/modules/openapi-generator/src/main/resources/aspnetcore/2.1/formParam.mustache index 7c9085c62df..e2c1c23a407 100644 --- a/modules/openapi-generator/src/main/resources/aspnetcore/2.1/formParam.mustache +++ b/modules/openapi-generator/src/main/resources/aspnetcore/2.1/formParam.mustache @@ -1 +1 @@ -{{#isFormParam}}{{^isBinary}}[FromForm (Name = "{{baseName}}")]{{/isBinary}}{{#required}}[Required()]{{/required}}{{#pattern}}[RegularExpression("{{{pattern}}}")]{{/pattern}}{{#minLength}}{{#maxLength}}[StringLength({{maxLength}}, MinimumLength={{minLength}})]{{/maxLength}}{{/minLength}}{{#minLength}}{{^maxLength}} [MinLength({{minLength}})]{{/maxLength}}{{/minLength}}{{^minLength}}{{#maxLength}} [MaxLength({{maxLength}})]{{/maxLength}}{{/minLength}}{{#minimum}}{{#maximum}}[Range({{minimum}}, {{maximum}})]{{/maximum}}{{/minimum}}{{&dataType}} {{paramName}}{{/isFormParam}} \ No newline at end of file +{{#isFormParam}}{{^isBinary}}[FromForm (Name = "{{baseName}}")]{{/isBinary}}{{#required}}[Required()]{{/required}}{{#pattern}}[RegularExpression("{{{.}}}")]{{/pattern}}{{#minLength}}{{#maxLength}}[StringLength({{maxLength}}, MinimumLength={{minLength}})]{{/maxLength}}{{/minLength}}{{#minLength}}{{^maxLength}} [MinLength({{minLength}})]{{/maxLength}}{{/minLength}}{{^minLength}}{{#maxLength}} [MaxLength({{.}})]{{/maxLength}}{{/minLength}}{{#minimum}}{{#maximum}}[Range({{minimum}}, {{maximum}})]{{/maximum}}{{/minimum}}{{&dataType}} {{paramName}}{{/isFormParam}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/aspnetcore/2.1/headerParam.mustache b/modules/openapi-generator/src/main/resources/aspnetcore/2.1/headerParam.mustache index a3a929904c6..a742a222236 100644 --- a/modules/openapi-generator/src/main/resources/aspnetcore/2.1/headerParam.mustache +++ b/modules/openapi-generator/src/main/resources/aspnetcore/2.1/headerParam.mustache @@ -1 +1 @@ -{{#isHeaderParam}}[FromHeader]{{#required}}[Required()]{{/required}}{{#pattern}}[RegularExpression("{{{pattern}}}")]{{/pattern}}{{#minLength}}{{#maxLength}}[StringLength({{maxLength}}, MinimumLength={{minLength}})]{{/maxLength}}{{/minLength}}{{#minLength}}{{^maxLength}} [MinLength({{minLength}})]{{/maxLength}}{{/minLength}}{{^minLength}}{{#maxLength}} [MaxLength({{maxLength}})]{{/maxLength}}{{/minLength}}{{#minimum}}{{#maximum}}[Range({{minimum}}, {{maximum}})]{{/maximum}}{{/minimum}}{{&dataType}} {{paramName}}{{/isHeaderParam}} \ No newline at end of file +{{#isHeaderParam}}[FromHeader]{{#required}}[Required()]{{/required}}{{#pattern}}[RegularExpression("{{{.}}}")]{{/pattern}}{{#minLength}}{{#maxLength}}[StringLength({{maxLength}}, MinimumLength={{minLength}})]{{/maxLength}}{{/minLength}}{{#minLength}}{{^maxLength}} [MinLength({{minLength}})]{{/maxLength}}{{/minLength}}{{^minLength}}{{#maxLength}} [MaxLength({{.}})]{{/maxLength}}{{/minLength}}{{#minimum}}{{#maximum}}[Range({{minimum}}, {{maximum}})]{{/maximum}}{{/minimum}}{{&dataType}} {{paramName}}{{/isHeaderParam}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/aspnetcore/2.1/listReturn.mustache b/modules/openapi-generator/src/main/resources/aspnetcore/2.1/listReturn.mustache index d609e67148c..9f18d71d04c 100644 --- a/modules/openapi-generator/src/main/resources/aspnetcore/2.1/listReturn.mustache +++ b/modules/openapi-generator/src/main/resources/aspnetcore/2.1/listReturn.mustache @@ -1,4 +1,4 @@ var example = exampleJson != null - ? JsonConvert.DeserializeObject<{{returnContainer}}<{{#returnType}}{{{returnType}}}{{/returnType}}>>(exampleJson) - : Enumerable.Empty<{{#returnType}}{{{returnType}}}{{/returnType}}>(); \ No newline at end of file + ? JsonConvert.DeserializeObject<{{returnContainer}}<{{{returnType}}}>>(exampleJson) + : Enumerable.Empty<{{{returnType}}}>(); \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/aspnetcore/2.1/mapReturn.mustache b/modules/openapi-generator/src/main/resources/aspnetcore/2.1/mapReturn.mustache index 856fb1b3507..94f16e11fdc 100644 --- a/modules/openapi-generator/src/main/resources/aspnetcore/2.1/mapReturn.mustache +++ b/modules/openapi-generator/src/main/resources/aspnetcore/2.1/mapReturn.mustache @@ -1,4 +1,4 @@ var example = exampleJson != null - ? JsonConvert.DeserializeObject>(exampleJson) - : new Dictionary<{{#returnType}}{{{returnType}}}{{/returnType}}>(); \ No newline at end of file + ? JsonConvert.DeserializeObject>(exampleJson) + : new Dictionary<{{{returnType}}}>(); \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/aspnetcore/2.1/model.mustache b/modules/openapi-generator/src/main/resources/aspnetcore/2.1/model.mustache index 491b39e54a1..9b146b15871 100644 --- a/modules/openapi-generator/src/main/resources/aspnetcore/2.1/model.mustache +++ b/modules/openapi-generator/src/main/resources/aspnetcore/2.1/model.mustache @@ -17,7 +17,7 @@ namespace {{modelPackage}} /// {{description}} /// [DataContract] - public {{#modelClassModifier}}{{modelClassModifier}} {{/modelClassModifier}}class {{classname}} : {{#parent}}{{{parent}}}, {{/parent}}IEquatable<{{classname}}> + public {{#modelClassModifier}}{{.}} {{/modelClassModifier}}class {{classname}} : {{#parent}}{{{.}}}, {{/parent}}IEquatable<{{classname}}> { {{#vars}} {{#items.isEnum}} @@ -33,21 +33,21 @@ namespace {{modelPackage}} {{/complexType}} {{/isEnum}} /// - /// {{^description}}Gets or Sets {{{name}}}{{/description}}{{#description}}{{description}}{{/description}} + /// {{description}}{{^description}}Gets or Sets {{{name}}}{{/description}} /// {{#description}} - /// {{description}}{{/description}}{{#required}} + /// {{.}}{{/description}}{{#required}} [Required]{{/required}}{{#pattern}} - [RegularExpression("{{{pattern}}}")]{{/pattern}}{{#minLength}}{{#maxLength}} + [RegularExpression("{{{.}}}")]{{/pattern}}{{#minLength}}{{#maxLength}} [StringLength({{maxLength}}, MinimumLength={{minLength}})]{{/maxLength}}{{/minLength}}{{#minLength}}{{^maxLength}} [MinLength({{minLength}})]{{/maxLength}}{{/minLength}}{{^minLength}}{{#maxLength}} - [MaxLength({{maxLength}})]{{/maxLength}}{{/minLength}}{{#minimum}}{{#maximum}} + [MaxLength({{.}})]{{/maxLength}}{{/minLength}}{{#minimum}}{{#maximum}} [Range({{minimum}}, {{maximum}})]{{/maximum}}{{/minimum}} [DataMember(Name="{{baseName}}", EmitDefaultValue={{#isNullable}}true{{/isNullable}}{{^isNullable}}false{{/isNullable}})] {{#isEnum}} - public {{{datatypeWithEnum}}}{{#isNullable}}?{{/isNullable}} {{name}} { get; set; }{{#defaultValue}} = {{{defaultValue}}};{{/defaultValue}} + public {{{datatypeWithEnum}}}{{#isNullable}}?{{/isNullable}} {{name}} { get; set; }{{#defaultValue}} = {{{.}}};{{/defaultValue}} {{/isEnum}} {{^isEnum}} - public {{{dataType}}} {{name}} { get; {{#isReadOnly}}private {{/isReadOnly}}set; }{{#defaultValue}} = {{{defaultValue}}};{{/defaultValue}} + public {{{dataType}}} {{name}} { get; {{#isReadOnly}}private {{/isReadOnly}}set; }{{#defaultValue}} = {{{.}}};{{/defaultValue}} {{/isEnum}} {{^-last}} diff --git a/modules/openapi-generator/src/main/resources/aspnetcore/2.1/objectReturn.mustache b/modules/openapi-generator/src/main/resources/aspnetcore/2.1/objectReturn.mustache index 4059a61ac0b..b037a14ceba 100644 --- a/modules/openapi-generator/src/main/resources/aspnetcore/2.1/objectReturn.mustache +++ b/modules/openapi-generator/src/main/resources/aspnetcore/2.1/objectReturn.mustache @@ -1,4 +1,4 @@ var example = exampleJson != null - ? JsonConvert.DeserializeObject<{{#returnType}}{{{returnType}}}{{/returnType}}>(exampleJson) - : default({{#returnType}}{{{returnType}}}{{/returnType}}); \ No newline at end of file + ? JsonConvert.DeserializeObject<{{{returnType}}}>(exampleJson) + : default({{{returnType}}}); \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/aspnetcore/2.1/partial_header.mustache b/modules/openapi-generator/src/main/resources/aspnetcore/2.1/partial_header.mustache index 9eb233d1197..408d841df26 100644 --- a/modules/openapi-generator/src/main/resources/aspnetcore/2.1/partial_header.mustache +++ b/modules/openapi-generator/src/main/resources/aspnetcore/2.1/partial_header.mustache @@ -1,13 +1,13 @@ /* {{#appName}} - * {{{appName}}} + * {{{.}}} * {{/appName}} {{#appDescription}} - * {{{appDescription}}} + * {{{.}}} * {{/appDescription}} - * {{#version}}The version of the OpenAPI document: {{{version}}}{{/version}} - * {{#infoEmail}}Contact: {{{infoEmail}}}{{/infoEmail}} + * {{#version}}The version of the OpenAPI document: {{{.}}}{{/version}} + * {{#infoEmail}}Contact: {{{.}}}{{/infoEmail}} * Generated by: https://openapi-generator.tech */ diff --git a/modules/openapi-generator/src/main/resources/aspnetcore/2.1/pathParam.mustache b/modules/openapi-generator/src/main/resources/aspnetcore/2.1/pathParam.mustache index 3447b8005d1..83de202f655 100644 --- a/modules/openapi-generator/src/main/resources/aspnetcore/2.1/pathParam.mustache +++ b/modules/openapi-generator/src/main/resources/aspnetcore/2.1/pathParam.mustache @@ -1 +1 @@ -{{#isPathParam}}[FromRoute (Name = "{{baseName}}")]{{#required}}[Required]{{/required}}{{#pattern}}[RegularExpression("{{{pattern}}}")]{{/pattern}}{{#minLength}}{{#maxLength}}[StringLength({{maxLength}}, MinimumLength={{minLength}})]{{/maxLength}}{{/minLength}}{{#minLength}}{{^maxLength}} [MinLength({{minLength}})]{{/maxLength}}{{/minLength}}{{^minLength}}{{#maxLength}} [MaxLength({{maxLength}})]{{/maxLength}}{{/minLength}}{{#minimum}}{{#maximum}}[Range({{minimum}}, {{maximum}})]{{/maximum}}{{/minimum}}{{&dataType}} {{paramName}}{{/isPathParam}} \ No newline at end of file +{{#isPathParam}}[FromRoute (Name = "{{baseName}}")]{{#required}}[Required]{{/required}}{{#pattern}}[RegularExpression("{{{.}}}")]{{/pattern}}{{#minLength}}{{#maxLength}}[StringLength({{maxLength}}, MinimumLength={{minLength}})]{{/maxLength}}{{/minLength}}{{#minLength}}{{^maxLength}} [MinLength({{minLength}})]{{/maxLength}}{{/minLength}}{{^minLength}}{{#maxLength}} [MaxLength({{.}})]{{/maxLength}}{{/minLength}}{{#minimum}}{{#maximum}}[Range({{minimum}}, {{maximum}})]{{/maximum}}{{/minimum}}{{&dataType}} {{paramName}}{{/isPathParam}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/aspnetcore/2.1/queryParam.mustache b/modules/openapi-generator/src/main/resources/aspnetcore/2.1/queryParam.mustache index 3a052802fcd..a0eedc432ff 100644 --- a/modules/openapi-generator/src/main/resources/aspnetcore/2.1/queryParam.mustache +++ b/modules/openapi-generator/src/main/resources/aspnetcore/2.1/queryParam.mustache @@ -1 +1 @@ -{{#isQueryParam}}[FromQuery (Name = "{{baseName}}")]{{#required}}[Required()]{{/required}}{{#pattern}}[RegularExpression("{{{pattern}}}")]{{/pattern}}{{#minLength}}{{#maxLength}}[StringLength({{maxLength}}, MinimumLength={{minLength}})]{{/maxLength}}{{/minLength}}{{#minLength}}{{^maxLength}} [MinLength({{minLength}})]{{/maxLength}}{{/minLength}}{{^minLength}}{{#maxLength}} [MaxLength({{maxLength}})]{{/maxLength}}{{/minLength}}{{#minimum}}{{#maximum}}[Range({{minimum}}, {{maximum}})]{{/maximum}}{{/minimum}}{{&dataType}} {{paramName}}{{/isQueryParam}} \ No newline at end of file +{{#isQueryParam}}[FromQuery (Name = "{{baseName}}")]{{#required}}[Required()]{{/required}}{{#pattern}}[RegularExpression("{{{.}}}")]{{/pattern}}{{#minLength}}{{#maxLength}}[StringLength({{maxLength}}, MinimumLength={{minLength}})]{{/maxLength}}{{/minLength}}{{#minLength}}{{^maxLength}} [MinLength({{minLength}})]{{/maxLength}}{{/minLength}}{{^minLength}}{{#maxLength}} [MaxLength({{.}})]{{/maxLength}}{{/minLength}}{{#minimum}}{{#maximum}}[Range({{minimum}}, {{maximum}})]{{/maximum}}{{/minimum}}{{&dataType}} {{paramName}}{{/isQueryParam}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/aspnetcore/2.1/validateModel.mustache b/modules/openapi-generator/src/main/resources/aspnetcore/2.1/validateModel.mustache index e11aaa5d270..0b2d5fdb70f 100644 --- a/modules/openapi-generator/src/main/resources/aspnetcore/2.1/validateModel.mustache +++ b/modules/openapi-generator/src/main/resources/aspnetcore/2.1/validateModel.mustache @@ -26,7 +26,7 @@ namespace {{packageName}}.Attributes { object args = null; if (context.ActionArguments.ContainsKey(parameter.Name)) - { + { args = context.ActionArguments[parameter.Name]; } diff --git a/modules/openapi-generator/src/main/resources/aspnetcore/3.0/Authentication/ApiAuthentication.mustache b/modules/openapi-generator/src/main/resources/aspnetcore/3.0/Authentication/ApiAuthentication.mustache index a9de368316d..125b1e8ef2a 100644 --- a/modules/openapi-generator/src/main/resources/aspnetcore/3.0/Authentication/ApiAuthentication.mustache +++ b/modules/openapi-generator/src/main/resources/aspnetcore/3.0/Authentication/ApiAuthentication.mustache @@ -68,4 +68,3 @@ namespace {{packageName}}.Authentication } } } - diff --git a/modules/openapi-generator/src/main/resources/aspnetcore/3.0/Filters/GeneratePathParamsValidationFilter.mustache b/modules/openapi-generator/src/main/resources/aspnetcore/3.0/Filters/GeneratePathParamsValidationFilter.mustache index f86af9fdd42..f62a1df4944 100644 --- a/modules/openapi-generator/src/main/resources/aspnetcore/3.0/Filters/GeneratePathParamsValidationFilter.mustache +++ b/modules/openapi-generator/src/main/resources/aspnetcore/3.0/Filters/GeneratePathParamsValidationFilter.mustache @@ -95,4 +95,3 @@ namespace {{packageName}}.Filters } } } - diff --git a/modules/openapi-generator/src/main/resources/aspnetcore/3.0/Formatters/InputFormatterStream.mustache b/modules/openapi-generator/src/main/resources/aspnetcore/3.0/Formatters/InputFormatterStream.mustache index f1a002ded67..e24d0a237a1 100644 --- a/modules/openapi-generator/src/main/resources/aspnetcore/3.0/Formatters/InputFormatterStream.mustache +++ b/modules/openapi-generator/src/main/resources/aspnetcore/3.0/Formatters/InputFormatterStream.mustache @@ -13,7 +13,7 @@ namespace {{packageName}}.Formatters SupportedMediaTypes.Add("application/octet-stream"); SupportedMediaTypes.Add("image/jpeg"); } - + protected override bool CanReadType(Type type) { if (type == typeof(Stream)) diff --git a/modules/openapi-generator/src/main/resources/aspnetcore/3.0/Program.mustache b/modules/openapi-generator/src/main/resources/aspnetcore/3.0/Program.mustache index 38cd18fc61f..f575d1f5b63 100644 --- a/modules/openapi-generator/src/main/resources/aspnetcore/3.0/Program.mustache +++ b/modules/openapi-generator/src/main/resources/aspnetcore/3.0/Program.mustache @@ -27,7 +27,7 @@ namespace {{packageName}} .ConfigureWebHostDefaults(webBuilder => { webBuilder.UseStartup() - .UseUrls("http://0.0.0.0:{{#serverPort}}{{serverPort}}{{/serverPort}}{{^serverPort}}8080{{/serverPort}}/"); + .UseUrls("http://0.0.0.0:{{serverPort}}{{^serverPort}}8080{{/serverPort}}/"); }); } } diff --git a/modules/openapi-generator/src/main/resources/aspnetcore/3.0/Project.csproj.mustache b/modules/openapi-generator/src/main/resources/aspnetcore/3.0/Project.csproj.mustache index ee3ced7ba19..889efc0161d 100644 --- a/modules/openapi-generator/src/main/resources/aspnetcore/3.0/Project.csproj.mustache +++ b/modules/openapi-generator/src/main/resources/aspnetcore/3.0/Project.csproj.mustache @@ -1,6 +1,6 @@ - {{^packageDescription}}{{packageName}}{{/packageDescription}}{{packageDescription}} + {{packageDescription}}{{^packageDescription}}{{packageName}}{{/packageDescription}} {{packageCopyright}} {{packageAuthors}} {{targetFramework}} diff --git a/modules/openapi-generator/src/main/resources/aspnetcore/3.0/Project.nuspec.mustache b/modules/openapi-generator/src/main/resources/aspnetcore/3.0/Project.nuspec.mustache index b97c14d13d3..1d24d331642 100644 --- a/modules/openapi-generator/src/main/resources/aspnetcore/3.0/Project.nuspec.mustache +++ b/modules/openapi-generator/src/main/resources/aspnetcore/3.0/Project.nuspec.mustache @@ -12,7 +12,7 @@ http://ICON_URL_HERE_OR_DELETE_THIS_LINE --> false - {{^packageDescription}}{{packageName}}{{/packageDescription}}{{packageDescription}} + {{packageDescription}}{{^packageDescription}}{{packageName}}{{/packageDescription}} Summary of changes made in this release of the package. {{packageCopyright}} {{packageName}} diff --git a/modules/openapi-generator/src/main/resources/aspnetcore/3.0/README.mustache b/modules/openapi-generator/src/main/resources/aspnetcore/3.0/README.mustache index c5673ac9d1d..3602e5d507d 100644 --- a/modules/openapi-generator/src/main/resources/aspnetcore/3.0/README.mustache +++ b/modules/openapi-generator/src/main/resources/aspnetcore/3.0/README.mustache @@ -1,7 +1,7 @@ # {{packageName}} - ASP.NET Core {{aspnetCoreVersion}} Server {{#appDescriptionWithNewLines}} -{{{appDescriptionWithNewLines}}} +{{{.}}} {{/appDescriptionWithNewLines}} ## Run diff --git a/modules/openapi-generator/src/main/resources/aspnetcore/3.0/Startup.mustache b/modules/openapi-generator/src/main/resources/aspnetcore/3.0/Startup.mustache index 250dcf66584..d94e1e6bb19 100644 --- a/modules/openapi-generator/src/main/resources/aspnetcore/3.0/Startup.mustache +++ b/modules/openapi-generator/src/main/resources/aspnetcore/3.0/Startup.mustache @@ -71,7 +71,7 @@ namespace {{packageName}} }) {{#compatibilityVersion}} // Don't need this for 3.x - see https://docs.microsoft.com/en-us/aspnet/core/mvc/compatibility-version?view=aspnetcore-3.1 - //.SetCompatibilityVersion(CompatibilityVersion.{{compatibilityVersion}}) + //.SetCompatibilityVersion(CompatibilityVersion.{{.}}) {{/compatibilityVersion}} .{{#useNewtonsoft}}AddNewtonsoftJson{{/useNewtonsoft}}{{^useNewtonsoft}}AddJsonOptions{{/useNewtonsoft}}(opts => { @@ -86,29 +86,29 @@ namespace {{packageName}} services .AddSwaggerGen(c => { - c.SwaggerDoc("{{#version}}{{{version}}}{{/version}}{{^version}}v1{{/version}}", new OpenApiInfo + c.SwaggerDoc("{{{version}}}{{^version}}v1{{/version}}", new OpenApiInfo { - Title = "{{#appName}}{{{appName}}}{{/appName}}{{^appName}}{{packageName}}{{/appName}}", - Description = "{{#appName}}{{{appName}}}{{/appName}}{{^appName}}{{packageName}}{{/appName}} (ASP.NET Core {{aspnetCoreVersion}})", - TermsOfService = new Uri("{{#termsOfService}}{{{termsOfService}}}{{/termsOfService}}{{^termsOfService}}https://github.com/openapitools/openapi-generator{{/termsOfService}}"), + Title = "{{{appName}}}{{^appName}}{{packageName}}{{/appName}}", + Description = "{{{appName}}}{{^appName}}{{packageName}}{{/appName}} (ASP.NET Core {{aspnetCoreVersion}})", + TermsOfService = new Uri("{{{termsOfService}}}{{^termsOfService}}https://github.com/openapitools/openapi-generator{{/termsOfService}}"), Contact = new OpenApiContact { - Name = "{{#infoName}}{{{infoName}}}{{/infoName}}{{^infoName}}OpenAPI-Generator Contributors{{/infoName}}", - Url = new Uri("{{#infoUrl}}{{{infoUrl}}}{{/infoUrl}}{{^infoUrl}}https://github.com/openapitools/openapi-generator{{/infoUrl}}"), - Email = "{{#infoEmail}}{{{infoEmail}}}{{/infoEmail}}" + Name = "{{{infoName}}}{{^infoName}}OpenAPI-Generator Contributors{{/infoName}}", + Url = new Uri("{{{infoUrl}}}{{^infoUrl}}https://github.com/openapitools/openapi-generator{{/infoUrl}}"), + Email = "{{{infoEmail}}}" }, License = new OpenApiLicense { Name = "{{licenseName}}", Url = new Uri("{{licenseUrl}}") }, - Version = "{{#version}}{{{version}}}{{/version}}{{^version}}v1{{/version}}", + Version = "{{{version}}}{{^version}}v1{{/version}}", }); c.CustomSchemaIds(type => type.FriendlyId(true)); c.IncludeXmlComments($"{AppContext.BaseDirectory}{Path.DirectorySeparatorChar}{Assembly.GetEntryAssembly().GetName().Name}.xml"); {{#basePathWithoutHost}} // Sets the basePath property in the OpenAPI document generated - c.DocumentFilter("{{{basePathWithoutHost}}}"); + c.DocumentFilter("{{{.}}}"); {{/basePathWithoutHost}} // Include DataAnnotation attributes on Controller Action parameters as OpenAPI validation rules (e.g required, pattern, ..) @@ -151,10 +151,10 @@ namespace {{packageName}} // set route prefix to openapi, e.g. http://localhost:8080/openapi/index.html c.RoutePrefix = "openapi"; //TODO: Either use the SwaggerGen generated OpenAPI contract (generated from C# classes) - c.SwaggerEndpoint("/openapi/{{#version}}{{{version}}}{{/version}}{{^version}}v1{{/version}}/openapi.json", "{{#appName}}{{{appName}}}{{/appName}}{{^appName}}{{packageName}}{{/appName}}"); + c.SwaggerEndpoint("/openapi/{{{version}}}{{^version}}v1{{/version}}/openapi.json", "{{{appName}}}{{^appName}}{{packageName}}{{/appName}}"); //TODO: Or alternatively use the original OpenAPI contract that's included in the static files - // c.SwaggerEndpoint("/openapi-original.json", "{{#appName}}{{{appName}}}{{/appName}}{{^appName}}{{packageName}}{{/appName}} Original"); + // c.SwaggerEndpoint("/openapi-original.json", "{{{appName}}}{{^appName}}{{packageName}}{{/appName}} Original"); }){{/useSwashbuckle}}; app.UseRouting(); app.UseEndpoints(endpoints => diff --git a/modules/openapi-generator/src/main/resources/aspnetcore/3.0/controller.mustache b/modules/openapi-generator/src/main/resources/aspnetcore/3.0/controller.mustache index 9f6fcc803df..ba1d43982a7 100644 --- a/modules/openapi-generator/src/main/resources/aspnetcore/3.0/controller.mustache +++ b/modules/openapi-generator/src/main/resources/aspnetcore/3.0/controller.mustache @@ -23,14 +23,14 @@ namespace {{apiPackage}} /// /// {{description}} /// {{#description}} - [Description("{{description}}")]{{/description}} + [Description("{{.}}")]{{/description}} [ApiController] - public {{#classModifier}}{{classModifier}} {{/classModifier}}class {{classname}}Controller : ControllerBase + public {{#classModifier}}{{.}} {{/classModifier}}class {{classname}}Controller : ControllerBase { {{#operation}} /// - /// {{#summary}}{{summary}}{{/summary}} + /// {{summary}} /// {{#notes}} - /// {{notes}}{{/notes}}{{#allParams}} + /// {{.}}{{/notes}}{{#allParams}} /// {{description}}{{#isDeprecated}} (deprecated){{/isDeprecated}}{{/allParams}}{{#responses}} /// {{message}}{{/responses}} [{{httpMethod}}] @@ -48,14 +48,14 @@ namespace {{apiPackage}} {{/vendorExtensions.x-aspnetcore-consumes}} [ValidateModelState]{{#useSwashbuckle}} [SwaggerOperation("{{operationId}}")]{{#responses}}{{#dataType}} - [SwaggerResponse(statusCode: {{code}}, type: typeof({{&dataType}}), description: "{{message}}")]{{/dataType}}{{^dataType}}{{/dataType}}{{/responses}}{{/useSwashbuckle}}{{^useSwashbuckle}}{{#responses}}{{#dataType}} - [ProducesResponseType(statusCode: {{code}}, type: typeof({{&dataType}}))]{{/dataType}}{{^dataType}}{{/dataType}}{{/responses}}{{/useSwashbuckle}} + [SwaggerResponse(statusCode: {{code}}, type: typeof({{&dataType}}), description: "{{message}}")]{{/dataType}}{{/responses}}{{/useSwashbuckle}}{{^useSwashbuckle}}{{#responses}}{{#dataType}} + [ProducesResponseType(statusCode: {{code}}, type: typeof({{&dataType}}))]{{/dataType}}{{/responses}}{{/useSwashbuckle}} {{#isDeprecated}} [Obsolete] {{/isDeprecated}} public {{operationModifier}} {{#operationResultTask}}{{#operationIsAsync}}async {{/operationIsAsync}}Task<{{/operationResultTask}}IActionResult{{#operationResultTask}}>{{/operationResultTask}} {{operationId}}({{#allParams}}{{>pathParam}}{{>queryParam}}{{>bodyParam}}{{>formParam}}{{>headerParam}}{{^-last}}{{^isCookieParam}}, {{/isCookieParam}}{{/-last}}{{/allParams}}){{^generateBody}};{{/generateBody}} {{#generateBody}} - { + { {{#cookieParams}} var {{paramName}} = Request.Cookies["{{paramName}}"]; {{/cookieParams}} diff --git a/modules/openapi-generator/src/main/resources/aspnetcore/3.0/enumClass.mustache b/modules/openapi-generator/src/main/resources/aspnetcore/3.0/enumClass.mustache index 8a932b5ade6..cd6595452ae 100644 --- a/modules/openapi-generator/src/main/resources/aspnetcore/3.0/enumClass.mustache +++ b/modules/openapi-generator/src/main/resources/aspnetcore/3.0/enumClass.mustache @@ -1,13 +1,13 @@ /// - /// {{^description}}Gets or Sets {{{name}}}{{/description}}{{#description}}{{{description}}}{{/description}} + /// {{^description}}Gets or Sets {{{name}}}{{/description}}{{{description}}} /// {{#description}} - /// {{{description}}} + /// {{{.}}} {{/description}} - {{#allowableValues}}{{#enumVars}}{{#-first}}{{#isString}}[TypeConverter(typeof(CustomEnumConverter<{{#datatypeWithEnum}}{{.}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}>))] + {{#allowableValues}}{{#enumVars}}{{#-first}}{{#isString}}[TypeConverter(typeof(CustomEnumConverter<{{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}>))] [JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))]{{/isString}}{{/-first}}{{/enumVars}}{{/allowableValues}} - public enum {{#datatypeWithEnum}}{{.}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}} + public enum {{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}} { {{#allowableValues}}{{#enumVars}} /// diff --git a/modules/openapi-generator/src/main/resources/aspnetcore/3.0/formParam.mustache b/modules/openapi-generator/src/main/resources/aspnetcore/3.0/formParam.mustache index f0b9d704280..d22f70b0e26 100644 --- a/modules/openapi-generator/src/main/resources/aspnetcore/3.0/formParam.mustache +++ b/modules/openapi-generator/src/main/resources/aspnetcore/3.0/formParam.mustache @@ -1 +1 @@ -{{#isFormParam}}{{^isBinary}}[FromForm{{^isModel}} (Name = "{{baseName}}"){{/isModel}}]{{/isBinary}}{{#required}}[Required()]{{/required}}{{#pattern}}[RegularExpression("{{{pattern}}}")]{{/pattern}}{{#minLength}}{{#maxLength}}[StringLength({{maxLength}}, MinimumLength={{minLength}})]{{/maxLength}}{{/minLength}}{{#minLength}}{{^maxLength}} [MinLength({{minLength}})]{{/maxLength}}{{/minLength}}{{^minLength}}{{#maxLength}} [MaxLength({{maxLength}})]{{/maxLength}}{{/minLength}}{{#minimum}}{{#maximum}}[Range({{minimum}}, {{maximum}})]{{/maximum}}{{/minimum}}{{&dataType}} {{paramName}}{{/isFormParam}} \ No newline at end of file +{{#isFormParam}}{{^isBinary}}[FromForm{{^isModel}} (Name = "{{baseName}}"){{/isModel}}]{{/isBinary}}{{#required}}[Required()]{{/required}}{{#pattern}}[RegularExpression("{{{.}}}")]{{/pattern}}{{#minLength}}{{#maxLength}}[StringLength({{maxLength}}, MinimumLength={{minLength}})]{{/maxLength}}{{/minLength}}{{#minLength}}{{^maxLength}} [MinLength({{minLength}})]{{/maxLength}}{{/minLength}}{{^minLength}}{{#maxLength}} [MaxLength({{.}})]{{/maxLength}}{{/minLength}}{{#minimum}}{{#maximum}}[Range({{minimum}}, {{maximum}})]{{/maximum}}{{/minimum}}{{&dataType}} {{paramName}}{{/isFormParam}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/aspnetcore/3.0/headerParam.mustache b/modules/openapi-generator/src/main/resources/aspnetcore/3.0/headerParam.mustache index a3a929904c6..a742a222236 100644 --- a/modules/openapi-generator/src/main/resources/aspnetcore/3.0/headerParam.mustache +++ b/modules/openapi-generator/src/main/resources/aspnetcore/3.0/headerParam.mustache @@ -1 +1 @@ -{{#isHeaderParam}}[FromHeader]{{#required}}[Required()]{{/required}}{{#pattern}}[RegularExpression("{{{pattern}}}")]{{/pattern}}{{#minLength}}{{#maxLength}}[StringLength({{maxLength}}, MinimumLength={{minLength}})]{{/maxLength}}{{/minLength}}{{#minLength}}{{^maxLength}} [MinLength({{minLength}})]{{/maxLength}}{{/minLength}}{{^minLength}}{{#maxLength}} [MaxLength({{maxLength}})]{{/maxLength}}{{/minLength}}{{#minimum}}{{#maximum}}[Range({{minimum}}, {{maximum}})]{{/maximum}}{{/minimum}}{{&dataType}} {{paramName}}{{/isHeaderParam}} \ No newline at end of file +{{#isHeaderParam}}[FromHeader]{{#required}}[Required()]{{/required}}{{#pattern}}[RegularExpression("{{{.}}}")]{{/pattern}}{{#minLength}}{{#maxLength}}[StringLength({{maxLength}}, MinimumLength={{minLength}})]{{/maxLength}}{{/minLength}}{{#minLength}}{{^maxLength}} [MinLength({{minLength}})]{{/maxLength}}{{/minLength}}{{^minLength}}{{#maxLength}} [MaxLength({{.}})]{{/maxLength}}{{/minLength}}{{#minimum}}{{#maximum}}[Range({{minimum}}, {{maximum}})]{{/maximum}}{{/minimum}}{{&dataType}} {{paramName}}{{/isHeaderParam}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/aspnetcore/3.0/listReturn.mustache b/modules/openapi-generator/src/main/resources/aspnetcore/3.0/listReturn.mustache index d609e67148c..9f18d71d04c 100644 --- a/modules/openapi-generator/src/main/resources/aspnetcore/3.0/listReturn.mustache +++ b/modules/openapi-generator/src/main/resources/aspnetcore/3.0/listReturn.mustache @@ -1,4 +1,4 @@ var example = exampleJson != null - ? JsonConvert.DeserializeObject<{{returnContainer}}<{{#returnType}}{{{returnType}}}{{/returnType}}>>(exampleJson) - : Enumerable.Empty<{{#returnType}}{{{returnType}}}{{/returnType}}>(); \ No newline at end of file + ? JsonConvert.DeserializeObject<{{returnContainer}}<{{{returnType}}}>>(exampleJson) + : Enumerable.Empty<{{{returnType}}}>(); \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/aspnetcore/3.0/mapReturn.mustache b/modules/openapi-generator/src/main/resources/aspnetcore/3.0/mapReturn.mustache index 856fb1b3507..94f16e11fdc 100644 --- a/modules/openapi-generator/src/main/resources/aspnetcore/3.0/mapReturn.mustache +++ b/modules/openapi-generator/src/main/resources/aspnetcore/3.0/mapReturn.mustache @@ -1,4 +1,4 @@ var example = exampleJson != null - ? JsonConvert.DeserializeObject>(exampleJson) - : new Dictionary<{{#returnType}}{{{returnType}}}{{/returnType}}>(); \ No newline at end of file + ? JsonConvert.DeserializeObject>(exampleJson) + : new Dictionary<{{{returnType}}}>(); \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/aspnetcore/3.0/model.mustache b/modules/openapi-generator/src/main/resources/aspnetcore/3.0/model.mustache index 5bd13ab9058..917e3680492 100644 --- a/modules/openapi-generator/src/main/resources/aspnetcore/3.0/model.mustache +++ b/modules/openapi-generator/src/main/resources/aspnetcore/3.0/model.mustache @@ -30,7 +30,7 @@ namespace {{modelPackage}} [JsonSubtypes.KnownSubType(typeof({{{modelName}}}), "{{^vendorExtensions.x-discriminator-value}}{{{mappingName}}}{{/vendorExtensions.x-discriminator-value}}{{#vendorExtensions.x-discriminator-value}}{{{.}}}{{/vendorExtensions.x-discriminator-value}}")] {{/mappedModels}} {{/discriminator}} - public {{#modelClassModifier}}{{modelClassModifier}} {{/modelClassModifier}}class {{classname}} : {{#parent}}{{{parent}}}, {{/parent}}IEquatable<{{classname}}> + public {{#modelClassModifier}}{{.}} {{/modelClassModifier}}class {{classname}} : {{#parent}}{{{.}}}, {{/parent}}IEquatable<{{classname}}> { {{#vars}} {{#items.isEnum}} @@ -46,21 +46,21 @@ namespace {{modelPackage}} {{/complexType}} {{/isEnum}} /// - /// {{^description}}Gets or Sets {{{name}}}{{/description}}{{#description}}{{description}}{{/description}} + /// {{description}}{{^description}}Gets or Sets {{{name}}}{{/description}} /// {{#description}} - /// {{description}}{{/description}}{{#required}} + /// {{.}}{{/description}}{{#required}} [Required]{{/required}}{{#pattern}} - [RegularExpression("{{{pattern}}}")]{{/pattern}}{{#minLength}}{{#maxLength}} + [RegularExpression("{{{.}}}")]{{/pattern}}{{#minLength}}{{#maxLength}} [StringLength({{maxLength}}, MinimumLength={{minLength}})]{{/maxLength}}{{/minLength}}{{#minLength}}{{^maxLength}} [MinLength({{minLength}})]{{/maxLength}}{{/minLength}}{{^minLength}}{{#maxLength}} - [MaxLength({{maxLength}})]{{/maxLength}}{{/minLength}}{{#minimum}}{{#maximum}} + [MaxLength({{.}})]{{/maxLength}}{{/minLength}}{{#minimum}}{{#maximum}} [Range({{minimum}}, {{maximum}})]{{/maximum}}{{/minimum}} [DataMember(Name="{{baseName}}", EmitDefaultValue={{#isNullable}}true{{/isNullable}}{{^isNullable}}false{{/isNullable}})] {{#isEnum}} - public {{{datatypeWithEnum}}}{{#isNullable}}?{{/isNullable}} {{name}} { get; set; }{{#defaultValue}} = {{{defaultValue}}};{{/defaultValue}} + public {{{datatypeWithEnum}}}{{#isNullable}}?{{/isNullable}} {{name}} { get; set; }{{#defaultValue}} = {{{.}}};{{/defaultValue}} {{/isEnum}} {{^isEnum}} - public {{{dataType}}} {{name}} { get; {{#isReadOnly}}private {{/isReadOnly}}set; }{{#defaultValue}} = {{{defaultValue}}};{{/defaultValue}} + public {{{dataType}}} {{name}} { get; {{#isReadOnly}}private {{/isReadOnly}}set; }{{#defaultValue}} = {{{.}}};{{/defaultValue}} {{/isEnum}} {{^-last}} diff --git a/modules/openapi-generator/src/main/resources/aspnetcore/3.0/objectReturn.mustache b/modules/openapi-generator/src/main/resources/aspnetcore/3.0/objectReturn.mustache index 4059a61ac0b..b037a14ceba 100644 --- a/modules/openapi-generator/src/main/resources/aspnetcore/3.0/objectReturn.mustache +++ b/modules/openapi-generator/src/main/resources/aspnetcore/3.0/objectReturn.mustache @@ -1,4 +1,4 @@ var example = exampleJson != null - ? JsonConvert.DeserializeObject<{{#returnType}}{{{returnType}}}{{/returnType}}>(exampleJson) - : default({{#returnType}}{{{returnType}}}{{/returnType}}); \ No newline at end of file + ? JsonConvert.DeserializeObject<{{{returnType}}}>(exampleJson) + : default({{{returnType}}}); \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/aspnetcore/3.0/partial_header.mustache b/modules/openapi-generator/src/main/resources/aspnetcore/3.0/partial_header.mustache index 9eb233d1197..408d841df26 100644 --- a/modules/openapi-generator/src/main/resources/aspnetcore/3.0/partial_header.mustache +++ b/modules/openapi-generator/src/main/resources/aspnetcore/3.0/partial_header.mustache @@ -1,13 +1,13 @@ /* {{#appName}} - * {{{appName}}} + * {{{.}}} * {{/appName}} {{#appDescription}} - * {{{appDescription}}} + * {{{.}}} * {{/appDescription}} - * {{#version}}The version of the OpenAPI document: {{{version}}}{{/version}} - * {{#infoEmail}}Contact: {{{infoEmail}}}{{/infoEmail}} + * {{#version}}The version of the OpenAPI document: {{{.}}}{{/version}} + * {{#infoEmail}}Contact: {{{.}}}{{/infoEmail}} * Generated by: https://openapi-generator.tech */ diff --git a/modules/openapi-generator/src/main/resources/aspnetcore/3.0/pathParam.mustache b/modules/openapi-generator/src/main/resources/aspnetcore/3.0/pathParam.mustache index 3447b8005d1..83de202f655 100644 --- a/modules/openapi-generator/src/main/resources/aspnetcore/3.0/pathParam.mustache +++ b/modules/openapi-generator/src/main/resources/aspnetcore/3.0/pathParam.mustache @@ -1 +1 @@ -{{#isPathParam}}[FromRoute (Name = "{{baseName}}")]{{#required}}[Required]{{/required}}{{#pattern}}[RegularExpression("{{{pattern}}}")]{{/pattern}}{{#minLength}}{{#maxLength}}[StringLength({{maxLength}}, MinimumLength={{minLength}})]{{/maxLength}}{{/minLength}}{{#minLength}}{{^maxLength}} [MinLength({{minLength}})]{{/maxLength}}{{/minLength}}{{^minLength}}{{#maxLength}} [MaxLength({{maxLength}})]{{/maxLength}}{{/minLength}}{{#minimum}}{{#maximum}}[Range({{minimum}}, {{maximum}})]{{/maximum}}{{/minimum}}{{&dataType}} {{paramName}}{{/isPathParam}} \ No newline at end of file +{{#isPathParam}}[FromRoute (Name = "{{baseName}}")]{{#required}}[Required]{{/required}}{{#pattern}}[RegularExpression("{{{.}}}")]{{/pattern}}{{#minLength}}{{#maxLength}}[StringLength({{maxLength}}, MinimumLength={{minLength}})]{{/maxLength}}{{/minLength}}{{#minLength}}{{^maxLength}} [MinLength({{minLength}})]{{/maxLength}}{{/minLength}}{{^minLength}}{{#maxLength}} [MaxLength({{.}})]{{/maxLength}}{{/minLength}}{{#minimum}}{{#maximum}}[Range({{minimum}}, {{maximum}})]{{/maximum}}{{/minimum}}{{&dataType}} {{paramName}}{{/isPathParam}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/aspnetcore/3.0/queryParam.mustache b/modules/openapi-generator/src/main/resources/aspnetcore/3.0/queryParam.mustache index 3a052802fcd..a0eedc432ff 100644 --- a/modules/openapi-generator/src/main/resources/aspnetcore/3.0/queryParam.mustache +++ b/modules/openapi-generator/src/main/resources/aspnetcore/3.0/queryParam.mustache @@ -1 +1 @@ -{{#isQueryParam}}[FromQuery (Name = "{{baseName}}")]{{#required}}[Required()]{{/required}}{{#pattern}}[RegularExpression("{{{pattern}}}")]{{/pattern}}{{#minLength}}{{#maxLength}}[StringLength({{maxLength}}, MinimumLength={{minLength}})]{{/maxLength}}{{/minLength}}{{#minLength}}{{^maxLength}} [MinLength({{minLength}})]{{/maxLength}}{{/minLength}}{{^minLength}}{{#maxLength}} [MaxLength({{maxLength}})]{{/maxLength}}{{/minLength}}{{#minimum}}{{#maximum}}[Range({{minimum}}, {{maximum}})]{{/maximum}}{{/minimum}}{{&dataType}} {{paramName}}{{/isQueryParam}} \ No newline at end of file +{{#isQueryParam}}[FromQuery (Name = "{{baseName}}")]{{#required}}[Required()]{{/required}}{{#pattern}}[RegularExpression("{{{.}}}")]{{/pattern}}{{#minLength}}{{#maxLength}}[StringLength({{maxLength}}, MinimumLength={{minLength}})]{{/maxLength}}{{/minLength}}{{#minLength}}{{^maxLength}} [MinLength({{minLength}})]{{/maxLength}}{{/minLength}}{{^minLength}}{{#maxLength}} [MaxLength({{.}})]{{/maxLength}}{{/minLength}}{{#minimum}}{{#maximum}}[Range({{minimum}}, {{maximum}})]{{/maximum}}{{/minimum}}{{&dataType}} {{paramName}}{{/isQueryParam}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/aspnetcore/3.0/validateModel.mustache b/modules/openapi-generator/src/main/resources/aspnetcore/3.0/validateModel.mustache index e11aaa5d270..0b2d5fdb70f 100644 --- a/modules/openapi-generator/src/main/resources/aspnetcore/3.0/validateModel.mustache +++ b/modules/openapi-generator/src/main/resources/aspnetcore/3.0/validateModel.mustache @@ -26,7 +26,7 @@ namespace {{packageName}}.Attributes { object args = null; if (context.ActionArguments.ContainsKey(parameter.Name)) - { + { args = context.ActionArguments[parameter.Name]; } diff --git a/modules/openapi-generator/src/main/resources/bash/README.mustache b/modules/openapi-generator/src/main/resources/bash/README.mustache index 74f700ceb9e..e320d2f9992 100644 --- a/modules/openapi-generator/src/main/resources/bash/README.mustache +++ b/modules/openapi-generator/src/main/resources/bash/README.mustache @@ -100,7 +100,7 @@ All URIs are relative to *{{basePathWithoutHost}}* Class | Method | HTTP request | Description ------------ | ------------- | ------------- | ------------- -{{#apiInfo}}{{#apis}}{{#operations}}{{#operation}}*{{classname}}* | [**{{operationId}}**]({{apiDocPath}}{{classname}}.md#{{operationIdLowerCase}}) | **{{httpMethod}}** {{path}} | {{#summary}}{{summary}}{{/summary}} +{{#apiInfo}}{{#apis}}{{#operations}}{{#operation}}*{{classname}}* | [**{{operationId}}**]({{apiDocPath}}{{classname}}.md#{{operationIdLowerCase}}) | **{{httpMethod}}** {{path}} | {{summary}} {{/operation}}{{/operations}}{{/apis}}{{/apiInfo}} ## Documentation For Models @@ -126,8 +126,8 @@ Class | Method | HTTP request | Description - **Type**: OAuth - **Flow**: {{{flow}}}{{#authorizationUrl}} -- **Authorization URL**: {{{authorizationUrl}}}{{/authorizationUrl}}{{#tokenUrl}} -- **Token URL**: {{{tokenUrl}}}{{/tokenUrl}} +- **Authorization URL**: {{{.}}}{{/authorizationUrl}}{{#tokenUrl}} +- **Token URL**: {{{.}}}{{/tokenUrl}} - **Scopes**:{{^scopes}} N/A{{/scopes}} {{#scopes}} - **{{{scope}}}**: {{{description}}} {{/scopes}} diff --git a/modules/openapi-generator/src/main/resources/bash/api_doc.mustache b/modules/openapi-generator/src/main/resources/bash/api_doc.mustache index 0d7dbab61a7..00bfe70e186 100644 --- a/modules/openapi-generator/src/main/resources/bash/api_doc.mustache +++ b/modules/openapi-generator/src/main/resources/bash/api_doc.mustache @@ -1,12 +1,12 @@ # {{classname}}{{#description}} -{{description}}{{/description}} +{{.}}{{/description}} All URIs are relative to *{{basePathWithoutHost}}* Method | HTTP request | Description ------------- | ------------- | ------------- -{{#operations}}{{#operation}}[**{{operationId}}**]({{classname}}.md#{{operationId}}) | **{{httpMethod}}** {{path}} | {{#summary}}{{summary}}{{/summary}} +{{#operations}}{{#operation}}[**{{operationId}}**]({{classname}}.md#{{operationId}}) | **{{httpMethod}}** {{path}} | {{summary}} {{/operation}}{{/operations}} {{#operations}} @@ -16,7 +16,7 @@ Method | HTTP request | Description {{{summary}}}{{#notes}} -{{{notes}}}{{/notes}} +{{{.}}}{{/notes}} ### Example @@ -29,7 +29,7 @@ Method | HTTP request | Description {{^allParams}}This endpoint does not need any parameter.{{/allParams}}{{#allParams}}{{#-last}} Name | Type | Description | Notes ------------- | ------------- | ------------- | -------------{{/-last}}{{/allParams}} -{{#allParams}} **{{paramName}}** | {{#isFile}}**{{dataType}}**{{/isFile}}{{^isFile}}{{#isPrimitiveType}}**{{dataType}}**{{/isPrimitiveType}}{{^isPrimitiveType}}[**{{dataType}}**]({{baseType}}.md){{/isPrimitiveType}}{{/isFile}} | {{{description}}} |{{^required}} [optional]{{/required}}{{#defaultValue}} [default to {{defaultValue}}]{{/defaultValue}} +{{#allParams}} **{{paramName}}** | {{#isFile}}**{{dataType}}**{{/isFile}}{{^isFile}}{{#isPrimitiveType}}**{{dataType}}**{{/isPrimitiveType}}{{^isPrimitiveType}}[**{{dataType}}**]({{baseType}}.md){{/isPrimitiveType}}{{/isFile}} | {{{description}}} |{{^required}} [optional]{{/required}}{{#defaultValue}} [default to {{.}}]{{/defaultValue}} {{/allParams}} ### Return type diff --git a/modules/openapi-generator/src/main/resources/bash/client.mustache b/modules/openapi-generator/src/main/resources/bash/client.mustache index 3f5dcc0e291..63457784268 100644 --- a/modules/openapi-generator/src/main/resources/bash/client.mustache +++ b/modules/openapi-generator/src/main/resources/bash/client.mustache @@ -580,9 +580,9 @@ EOF {{#isOAuth}} echo -e " - ${MAGENTA}OAuth2 (flow: {{flow}})${OFF}"{{#authorizationUrl}} echo -e " Authorization URL: " - echo -e " * {{authorizationUrl}}"{{/authorizationUrl}}{{#tokenUrl}} + echo -e " * {{.}}"{{/authorizationUrl}}{{#tokenUrl}} echo -e " Token URL: " - echo -e " * {{tokenUrl}}"{{/tokenUrl}} + echo -e " * {{.}}"{{/tokenUrl}} echo -e " Scopes:" {{#scopes}} echo -e " * {{scope}} - {{description}}" @@ -613,7 +613,7 @@ echo " $ops" | column -t -s ';' echo -e " --about\\t\\t\\t\\tPrint the information about service" echo -e " --host ${CYAN}${OFF}\\t\\t\\t\\tSpecify the host URL " {{#openAPI}} -{{#host}}echo -e " \\t\\t\\t\\t(e.g. 'https://{{host}}')"{{/host}} +{{#host}}echo -e " \\t\\t\\t\\t(e.g. 'https://{{.}}')"{{/host}} {{^host}}echo -e " \\t\\t\\t\\t(e.g. 'https://127.0.0.1:8080')"{{/host}} {{/openAPI}} echo -e " --force\\t\\t\\t\\tForce command invocation in spite of missing" @@ -679,14 +679,14 @@ print_{{operationId}}_help() { {{/x-bash-codegen-description}} {{^x-bash-codegen-description}} {{#notes}} - echo -e "{{{notes}}}" | paste -sd' ' | fold -sw 80 + echo -e "{{{.}}}" | paste -sd' ' | fold -sw 80 echo -e "" {{/notes}} {{/x-bash-codegen-description}} {{/vendorExtensions}} {{^vendorExtensions}} {{#notes}} - echo -e "{{{notes}}}" | paste -sd' ' | fold -sw 80 + echo -e "{{{.}}}" | paste -sd' ' | fold -sw 80 echo -e "" {{/notes}} {{/vendorExtensions}} diff --git a/modules/openapi-generator/src/main/resources/clojure/git_push.sh.mustache b/modules/openapi-generator/src/main/resources/clojure/git_push.sh.mustache index 8b3f689c912..f0bed5bd841 100755 --- a/modules/openapi-generator/src/main/resources/clojure/git_push.sh.mustache +++ b/modules/openapi-generator/src/main/resources/clojure/git_push.sh.mustache @@ -55,4 +55,3 @@ git pull origin master # Pushes (Forces) the changes in the local repository up to the remote repository echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" git push origin master 2>&1 | grep -v 'To https' - diff --git a/modules/openapi-generator/src/main/resources/codegen/README.mustache b/modules/openapi-generator/src/main/resources/codegen/README.mustache index c55f0b6ce13..0ab1584ea15 100644 --- a/modules/openapi-generator/src/main/resources/codegen/README.mustache +++ b/modules/openapi-generator/src/main/resources/codegen/README.mustache @@ -10,7 +10,7 @@ The goal of OpenAPI is to define a standard, language-agnostic interface to REST When properly described with OpenAPI, a consumer can understand and interact with the remote service with a minimal amount of implementation logic. Similar to what interfaces have done for lower-level programming, OpenAPI removes the guesswork in calling the service. -Check out [OpenAPI-Spec](https://github.com/OAI/OpenAPI-Specification) for additional information about the OpenAPI project, including additional libraries with support for other languages and more. +Check out [OpenAPI-Spec](https://github.com/OAI/OpenAPI-Specification) for additional information about the OpenAPI project, including additional libraries with support for other languages and more. ## How do I use this? At this point, you've likely generated a client setup. It will include something along these lines: @@ -65,7 +65,7 @@ for reading the code more, though. See how the `{{generatorClass}}` implements That class has the signature of all values that can be overridden. You can also step through {{generatorClass}}.java in a debugger. Just debug the JUnit -test in DebugCodegenLauncher. That runs the command line tool and lets you inspect what the code is doing. +test in DebugCodegenLauncher. That runs the command line tool and lets you inspect what the code is doing. For the templates themselves, you have a number of values available to you for generation. You can execute the `java` command from above while passing different debug flags to show diff --git a/modules/openapi-generator/src/main/resources/codegen/generatorClass.mustache b/modules/openapi-generator/src/main/resources/codegen/generatorClass.mustache index d7b220b680f..72755d960eb 100644 --- a/modules/openapi-generator/src/main/resources/codegen/generatorClass.mustache +++ b/modules/openapi-generator/src/main/resources/codegen/generatorClass.mustache @@ -14,7 +14,7 @@ public class {{generatorClass}} extends DefaultCodegen implements CodegenConfig /** * Configures the type of generator. - * + * * @return the CodegenType for this generator * @see org.openapitools.codegen.CodegenType */ @@ -25,7 +25,7 @@ public class {{generatorClass}} extends DefaultCodegen implements CodegenConfig /** * Configures a friendly name for the generator. This will be used by the generator * to select the library with the -g flag. - * + * * @return the friendly name for the generator */ public String getName() { @@ -60,7 +60,7 @@ public class {{generatorClass}} extends DefaultCodegen implements CodegenConfig /** * Returns human-friendly help for the generator. Provide the consumer with help * tips, parameters here - * + * * @return A string value for the help message */ public String getHelp() { @@ -147,7 +147,7 @@ public class {{generatorClass}} extends DefaultCodegen implements CodegenConfig /** * Escapes a reserved word as defined in the `reservedWords` array. Handle escaping * those terms here. This logic is only called if a variable matches the reserved words - * + * * @return the escaped term */ @Override diff --git a/modules/openapi-generator/src/main/resources/codegen/generatorClassTest.mustache b/modules/openapi-generator/src/main/resources/codegen/generatorClassTest.mustache index 4267a928fcf..d4773b14f81 100644 --- a/modules/openapi-generator/src/main/resources/codegen/generatorClassTest.mustache +++ b/modules/openapi-generator/src/main/resources/codegen/generatorClassTest.mustache @@ -7,8 +7,8 @@ import org.openapitools.codegen.config.CodegenConfigurator; /*** * This test allows you to easily launch your code generation software under a debugger. - * Then run this test under debug mode. You will be able to step through your java code - * and then see the results in the out directory. + * Then run this test under debug mode. You will be able to step through your java code + * and then see the results in the out directory. * * To experiment with debugging your code generator: * 1) Set a break point in {{generatorClass}}.java in the postProcessOperationsWithModels() method. @@ -22,7 +22,7 @@ public class {{generatorClass}}Test { @Test public void launchCodeGenerator() { // to understand how the 'openapi-generator-cli' module is using 'CodegenConfigurator', have a look at the 'Generate' class: - // https://github.com/OpenAPITools/openapi-generator/blob/master/modules/openapi-generator-cli/src/main/java/org/openapitools/codegen/cmd/Generate.java + // https://github.com/OpenAPITools/openapi-generator/blob/master/modules/openapi-generator-cli/src/main/java/org/openapitools/codegen/cmd/Generate.java final CodegenConfigurator configurator = new CodegenConfigurator() .setGeneratorName("{{name}}") // use this codegen library .setInputSpec("../../../modules/openapi-generator/src/test/resources/2_0/petstore.yaml") // sample OpenAPI file diff --git a/modules/openapi-generator/src/main/resources/codegen/kotlin/README.mustache b/modules/openapi-generator/src/main/resources/codegen/kotlin/README.mustache index 940ebbc0fa4..1c026bed904 100644 --- a/modules/openapi-generator/src/main/resources/codegen/kotlin/README.mustache +++ b/modules/openapi-generator/src/main/resources/codegen/kotlin/README.mustache @@ -17,7 +17,7 @@ ```bash java -jar build/libs/{{kebabName}}-openapi-generator-standalone.jar config-help -g {{name}} ``` - + ## Building ### Standalone diff --git a/modules/openapi-generator/src/main/resources/codegen/pom.mustache b/modules/openapi-generator/src/main/resources/codegen/pom.mustache index 628dd6552f7..a4f01d1cbbd 100644 --- a/modules/openapi-generator/src/main/resources/codegen/pom.mustache +++ b/modules/openapi-generator/src/main/resources/codegen/pom.mustache @@ -117,7 +117,7 @@ junit junit ${junit-version} - + UTF-8 diff --git a/modules/openapi-generator/src/main/resources/confluenceWikiDocs/index.mustache b/modules/openapi-generator/src/main/resources/confluenceWikiDocs/index.mustache index 9ddece9da19..86c92f99dfb 100644 --- a/modules/openapi-generator/src/main/resources/confluenceWikiDocs/index.mustache +++ b/modules/openapi-generator/src/main/resources/confluenceWikiDocs/index.mustache @@ -2,7 +2,7 @@ h1. {{{appName}}} {{{appDescription}}} -{{#version}}*Version:* {{{version}}}{{/version}} +{{#version}}*Version:* {{{.}}}{{/version}} ---- @@ -15,7 +15,7 @@ h2. Endpoints h3. {{nickname}} {panel:title={{nickname}}|borderStyle=solid|borderColor=#003b6f|titleBGColor=#003b6f|titleColor=#a6b8c7|bgColor=#ffffff} - {{#summary}}*Summary:* {{summary}}{{/summary}} + {{#summary}}*Summary:* {{.}}{{/summary}} *Description:* {{notes}}{{^notes}}*No Description*{{/notes}} || HttpMethod | {status:colour=Yellow|title={{httpMethod}}|subtle=false} | @@ -76,10 +76,10 @@ h2. Models h3. {{classname}} {{{description}}} - + {{#isEnum}} ||Name||Value||Description|| {{#allowableValues}} {{#enumVars}} |{{{name}}} |{{{value}}} |{{{enumDescription}}} | - {{/enumVars}} + {{/enumVars}} {{/allowableValues}} {{/isEnum}} {{^isEnum}}||Field Name||Required||Type||Description||Enum|| {{#vars}} |{{baseName}} |{{#required}}(/){{/required}}{{^required}}(x){{/required}} |{noformat:nopanel=true}{{{dataType}}}{noformat} |{{description}} | {{#isEnum}} {{_enum}} {{/isEnum}} | diff --git a/modules/openapi-generator/src/main/resources/cpp-pistache-server/helpers-source.mustache b/modules/openapi-generator/src/main/resources/cpp-pistache-server/helpers-source.mustache index 214086354d5..575dcf7b59c 100644 --- a/modules/openapi-generator/src/main/resources/cpp-pistache-server/helpers-source.mustache +++ b/modules/openapi-generator/src/main/resources/cpp-pistache-server/helpers-source.mustache @@ -11,7 +11,7 @@ const std::regex regexRfc3339_date_time( ); -namespace +namespace { // Determine if given year is a leap year // See RFC 3339, Appendix C https://tools.ietf.org/html/rfc3339#appendix-C diff --git a/modules/openapi-generator/src/main/resources/cpp-pistache-server/licenseInfo.mustache b/modules/openapi-generator/src/main/resources/cpp-pistache-server/licenseInfo.mustache index 3a547de74bb..8d5259173a1 100644 --- a/modules/openapi-generator/src/main/resources/cpp-pistache-server/licenseInfo.mustache +++ b/modules/openapi-generator/src/main/resources/cpp-pistache-server/licenseInfo.mustache @@ -2,8 +2,8 @@ * {{{appName}}} * {{{appDescription}}} * -* {{#version}}The version of the OpenAPI document: {{{version}}}{{/version}} -* {{#infoEmail}}Contact: {{{infoEmail}}}{{/infoEmail}} +* {{#version}}The version of the OpenAPI document: {{{.}}}{{/version}} +* {{#infoEmail}}Contact: {{{.}}}{{/infoEmail}} * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech diff --git a/modules/openapi-generator/src/main/resources/cpp-pistache-server/main-api-server.mustache b/modules/openapi-generator/src/main/resources/cpp-pistache-server/main-api-server.mustache index 01d7882fa98..118db3cd98b 100644 --- a/modules/openapi-generator/src/main/resources/cpp-pistache-server/main-api-server.mustache +++ b/modules/openapi-generator/src/main/resources/cpp-pistache-server/main-api-server.mustache @@ -54,7 +54,7 @@ int main() { std::vector sigs{SIGQUIT, SIGINT, SIGTERM, SIGHUP}; setUpUnixSignals(sigs); #endif - Pistache::Address addr(Pistache::Ipv4::any(), Pistache::Port({{#serverPort}}{{serverPort}}{{/serverPort}}{{^serverPort}}8080{{/serverPort}})); + Pistache::Address addr(Pistache::Ipv4::any(), Pistache::Port({{serverPort}}{{^serverPort}}8080{{/serverPort}})); httpEndpoint = new Pistache::Http::Endpoint((addr)); auto router = std::make_shared(); @@ -76,4 +76,3 @@ int main() { httpEndpoint->shutdown(); } - diff --git a/modules/openapi-generator/src/main/resources/cpp-qt-client/HttpRequest.cpp.mustache b/modules/openapi-generator/src/main/resources/cpp-qt-client/HttpRequest.cpp.mustache index bf88363b51c..0da1decf03a 100644 --- a/modules/openapi-generator/src/main/resources/cpp-qt-client/HttpRequest.cpp.mustache +++ b/modules/openapi-generator/src/main/resources/cpp-qt-client/HttpRequest.cpp.mustache @@ -328,7 +328,7 @@ void {{prefix}}HttpRequestWorker::execute({{prefix}}HttpRequestInput *input) { if ({{prefix}}HttpRequestWorker::sslDefaultConfiguration != nullptr) { request.setSslConfiguration(*{{prefix}}HttpRequestWorker::sslDefaultConfiguration); } - request.setRawHeader("User-Agent", "{{#httpUserAgent}}{{.}}{{/httpUserAgent}}{{^httpUserAgent}}OpenAPI-Generator/{{apiVersion}}/cpp-qt{{/httpUserAgent}}"); + request.setRawHeader("User-Agent", "{{httpUserAgent}}{{^httpUserAgent}}OpenAPI-Generator/{{apiVersion}}/cpp-qt{{/httpUserAgent}}"); foreach (QString key, input->headers.keys()) { request.setRawHeader(key.toStdString().c_str(), input->headers.value(key).toStdString().c_str()); } if (request_content.size() > 0 && !isFormData && (input->var_layout != MULTIPART)) { diff --git a/modules/openapi-generator/src/main/resources/cpp-qt-client/Project.mustache b/modules/openapi-generator/src/main/resources/cpp-qt-client/Project.mustache index a815942bc7d..c48c32708b9 100644 --- a/modules/openapi-generator/src/main/resources/cpp-qt-client/Project.mustache +++ b/modules/openapi-generator/src/main/resources/cpp-qt-client/Project.mustache @@ -43,4 +43,3 @@ SOURCES += \ $${PWD}/{{prefix}}Helpers.cpp \ $${PWD}/{{prefix}}HttpRequest.cpp \ $${PWD}/{{prefix}}HttpFileElement.cpp - diff --git a/modules/openapi-generator/src/main/resources/cpp-qt-client/README.mustache b/modules/openapi-generator/src/main/resources/cpp-qt-client/README.mustache index 9692bf79152..0460040d219 100644 --- a/modules/openapi-generator/src/main/resources/cpp-qt-client/README.mustache +++ b/modules/openapi-generator/src/main/resources/cpp-qt-client/README.mustache @@ -8,7 +8,7 @@ - Build date: {{generatedDate}} {{/hideGenerationTimestamp}} -{{#appDescriptionWithNewLines}}{{{appDescriptionWithNewLines}}}{{/appDescriptionWithNewLines}} +{{{appDescriptionWithNewLines}}} {{#infoUrl}} For more information, please visit [{{{infoUrl}}}]({{{infoUrl}}}) @@ -89,7 +89,7 @@ example.cpp: #include "../client/{{{classname}}}.h" #include "example.h" #include -#include +#include {{#allParams}} {{dataType}} Example::create(){ @@ -113,7 +113,7 @@ void Example::exampleFunction1(){ {{/authMethods}} {{/hasAuthMethods}} {{#allParams}} - + QEventLoop loop; connect(&apiInstance, &{{{classname}}}::{{nickname}}Signal, [&]() { loop.quit(); @@ -138,7 +138,7 @@ All URIs are relative to *{{basePath}}* Class | Method | HTTP request | Description ------------ | ------------- | ------------- | ------------- -{{#apiInfo}}{{#apis}}{{#operations}}{{#operation}}*{{classname}}* | [**{{operationId}}**]({{apiDocPath}}{{classname}}.md#{{operationId}}) | **{{httpMethod}}** {{commonPath}}{{path}} | {{#summary}}{{summary}}{{/summary}} +{{#apiInfo}}{{#apis}}{{#operations}}{{#operation}}*{{classname}}* | [**{{operationId}}**]({{apiDocPath}}{{classname}}.md#{{operationId}}) | **{{httpMethod}}** {{commonPath}}{{path}} | {{summary}} {{/operation}}{{/operations}}{{/apis}}{{/apiInfo}} ## Documentation for Models @@ -148,7 +148,7 @@ Class | Method | HTTP request | Description ## Documentation for Servers -Parameterized Servers are supported. Define a server in the API for each endpoint with arbitrary numbers of variables: +Parameterized Servers are supported. Define a server in the API for each endpoint with arbitrary numbers of variables: ``` servers: @@ -173,7 +173,7 @@ To change the default variable, use this function in each Api: ``` int setDefaultServerValue(int serverIndex,const QString &operation, const QString &variable,const QString &val); ``` -The parameter "serverIndex" will choose a server from the server list for each endpoint. There is always at least one server with index 0. The Paramter "operation" should be the desired endpoint operationid. +The parameter "serverIndex" will choose a server from the server list for each endpoint. There is always at least one server with index 0. The Paramter "operation" should be the desired endpoint operationid. Variable is the name of the variable you wish to change and the value is the new default Value. The function will return -1 when the variable does not exists, -2 if value is not defined in the variable enum and -3 if the operation is not found. diff --git a/modules/openapi-generator/src/main/resources/cpp-qt-client/ServerVariable.mustache b/modules/openapi-generator/src/main/resources/cpp-qt-client/ServerVariable.mustache index 04abcf783ff..6f5b287416b 100644 --- a/modules/openapi-generator/src/main/resources/cpp-qt-client/ServerVariable.mustache +++ b/modules/openapi-generator/src/main/resources/cpp-qt-client/ServerVariable.mustache @@ -19,11 +19,11 @@ public: * @param defaultValue The default value to use for substitution. * @param enumValues An enumeration of string values to be used if the substitution options are from a limited set. */ - {{prefix}}ServerVariable(const QString &description, const QString &defaultValue, const QSet &enumValues) + {{prefix}}ServerVariable(const QString &description, const QString &defaultValue, const QSet &enumValues) : _defaultValue(defaultValue), _description(description), _enumValues(enumValues){} - + {{prefix}}ServerVariable(){} ~{{prefix}}ServerVariable(){} diff --git a/modules/openapi-generator/src/main/resources/cpp-qt-client/api-header.mustache b/modules/openapi-generator/src/main/resources/cpp-qt-client/api-header.mustache index 639f2f766ea..09449281ecd 100644 --- a/modules/openapi-generator/src/main/resources/cpp-qt-client/api-header.mustache +++ b/modules/openapi-generator/src/main/resources/cpp-qt-client/api-header.mustache @@ -78,11 +78,11 @@ private: signals: {{#operations}}{{#operation}} - void {{nickname}}Signal({{#returnType}}{{{returnType}}} summary{{/returnType}});{{/operation}}{{/operations}} + void {{nickname}}Signal({{#returnType}}{{{.}}} summary{{/returnType}});{{/operation}}{{/operations}} {{#operations}}{{#operation}} - void {{nickname}}SignalFull({{prefix}}HttpRequestWorker *worker{{#returnType}}, {{{returnType}}} summary{{/returnType}});{{/operation}}{{/operations}} + void {{nickname}}SignalFull({{prefix}}HttpRequestWorker *worker{{#returnType}}, {{{.}}} summary{{/returnType}});{{/operation}}{{/operations}} {{#operations}}{{#operation}} - void {{nickname}}SignalE({{#returnType}}{{{returnType}}} summary, {{/returnType}}QNetworkReply::NetworkError error_type, QString error_str);{{/operation}}{{/operations}} + void {{nickname}}SignalE({{#returnType}}{{{.}}} summary, {{/returnType}}QNetworkReply::NetworkError error_type, QString error_str);{{/operation}}{{/operations}} {{#operations}}{{#operation}} void {{nickname}}SignalEFull({{prefix}}HttpRequestWorker *worker, QNetworkReply::NetworkError error_type, QString error_str);{{/operation}}{{/operations}} diff --git a/modules/openapi-generator/src/main/resources/cpp-qt-client/licenseInfo.mustache b/modules/openapi-generator/src/main/resources/cpp-qt-client/licenseInfo.mustache index 360883d9f9d..166d1da53c5 100644 --- a/modules/openapi-generator/src/main/resources/cpp-qt-client/licenseInfo.mustache +++ b/modules/openapi-generator/src/main/resources/cpp-qt-client/licenseInfo.mustache @@ -2,8 +2,8 @@ * {{{appName}}} * {{{appDescription}}} * - * {{#version}}The version of the OpenAPI document: {{{version}}}{{/version}} - *{{#infoEmail}} Contact: {{{infoEmail}}} + * {{#version}}The version of the OpenAPI document: {{{.}}}{{/version}} + *{{#infoEmail}} Contact: {{{.}}} *{{/infoEmail}} * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech diff --git a/modules/openapi-generator/src/main/resources/cpp-qt-client/model-header.mustache b/modules/openapi-generator/src/main/resources/cpp-qt-client/model-header.mustache index 143f1424bfa..9179d3c7f7d 100644 --- a/modules/openapi-generator/src/main/resources/cpp-qt-client/model-header.mustache +++ b/modules/openapi-generator/src/main/resources/cpp-qt-client/model-header.mustache @@ -46,7 +46,7 @@ public: {{#enumVars}} {{#enumDescription}} /** - * {{enumDescription}} + * {{.}} */ {{/enumDescription}} {{{name}}}{{^-last}}, {{/-last}} diff --git a/modules/openapi-generator/src/main/resources/cpp-qt-qhttpengine-server/apihandler.cpp.mustache b/modules/openapi-generator/src/main/resources/cpp-qt-qhttpengine-server/apihandler.cpp.mustache index 90af1b39df3..27f5a4a97c1 100644 --- a/modules/openapi-generator/src/main/resources/cpp-qt-qhttpengine-server/apihandler.cpp.mustache +++ b/modules/openapi-generator/src/main/resources/cpp-qt-qhttpengine-server/apihandler.cpp.mustache @@ -20,16 +20,16 @@ namespace {{this}} { } -{{#operations}}{{#operation}}void {{classname}}Handler::{{nickname}}({{#allParams}}{{{dataType}}}{{#isBodyParam}}{{/isBodyParam}} {{paramName}}{{^-last}}, {{/-last}}{{/allParams}}) { +{{#operations}}{{#operation}}void {{classname}}Handler::{{nickname}}({{#allParams}}{{{dataType}}} {{paramName}}{{^-last}}, {{/-last}}{{/allParams}}) { {{#allParams}} Q_UNUSED({{paramName}}); {{/allParams}} auto reqObj = qobject_cast<{{classname}}Request*>(sender()); - if( reqObj != nullptr ) - { - {{#returnType}}{{{returnType}}} res;{{/returnType}} + if( reqObj != nullptr ) + { + {{#returnType}}{{{.}}} res;{{/returnType}} reqObj->{{nickname}}Response({{#returnType}}res{{/returnType}}); - } + } } {{/operation}}{{/operations}} diff --git a/modules/openapi-generator/src/main/resources/cpp-qt-qhttpengine-server/apihandler.h.mustache b/modules/openapi-generator/src/main/resources/cpp-qt-qhttpengine-server/apihandler.h.mustache index ab3fdb3d6a4..55a3e3db47f 100644 --- a/modules/openapi-generator/src/main/resources/cpp-qt-qhttpengine-server/apihandler.h.mustache +++ b/modules/openapi-generator/src/main/resources/cpp-qt-qhttpengine-server/apihandler.h.mustache @@ -14,14 +14,14 @@ namespace {{this}} { class {{classname}}Handler : public QObject { Q_OBJECT - + public: {{classname}}Handler(); virtual ~{{classname}}Handler(); public slots: - {{#operations}}{{#operation}}virtual void {{nickname}}({{#allParams}}{{{dataType}}}{{#isBodyParam}}{{/isBodyParam}} {{paramName}}{{^-last}}, {{/-last}}{{/allParams}}); + {{#operations}}{{#operation}}virtual void {{nickname}}({{#allParams}}{{{dataType}}} {{paramName}}{{^-last}}, {{/-last}}{{/allParams}}); {{/operation}}{{/operations}} }; diff --git a/modules/openapi-generator/src/main/resources/cpp-qt-qhttpengine-server/apirequest.cpp.mustache b/modules/openapi-generator/src/main/resources/cpp-qt-qhttpengine-server/apirequest.cpp.mustache index ca8513d078d..7799749ee8a 100644 --- a/modules/openapi-generator/src/main/resources/cpp-qt-qhttpengine-server/apirequest.cpp.mustache +++ b/modules/openapi-generator/src/main/resources/cpp-qt-qhttpengine-server/apirequest.cpp.mustache @@ -108,12 +108,12 @@ void {{classname}}Request::{{nickname}}Request({{#hasPathParams}}{{#pathParams}} {{/isArray}} {{/bodyParam}}{{/bodyParams}} - emit {{nickname}}({{#allParams}}{{#isBodyParam}}{{/isBodyParam}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}); + emit {{nickname}}({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}); } {{/operation}}{{/operations}} -{{#operations}}{{#operation}}void {{classname}}Request::{{nickname}}Response({{#returnType}}const {{{returnType}}}& res{{/returnType}}){ +{{#operations}}{{#operation}}void {{classname}}Request::{{nickname}}Response({{#returnType}}const {{{.}}}& res{{/returnType}}){ setSocketResponseHeaders();{{#returnType}}{{#isMap}} QJsonDocument resDoc(::{{cppNamespace}}::toJsonValue(res).toObject()); socket->writeJson(resDoc);{{/isMap}}{{^isMap}}{{^returnTypeIsPrimitive}}{{^vendorExtensions.x-returns-enum}} @@ -129,7 +129,7 @@ void {{classname}}Request::{{nickname}}Request({{#hasPathParams}}{{#pathParams}} } {{/operation}}{{/operations}} -{{#operations}}{{#operation}}void {{classname}}Request::{{nickname}}Error({{#returnType}}const {{{returnType}}}& res, {{/returnType}}QNetworkReply::NetworkError error_type, QString& error_str){ +{{#operations}}{{#operation}}void {{classname}}Request::{{nickname}}Error({{#returnType}}const {{{.}}}& res, {{/returnType}}QNetworkReply::NetworkError error_type, QString& error_str){ Q_UNUSED(error_type); // TODO: Remap error_type to QHttpEngine::Socket errors setSocketResponseHeaders();{{#returnType}} Q_UNUSED(error_str); // response will be used instead of error string{{#isMap}} @@ -152,7 +152,7 @@ void {{classname}}Request::sendCustomResponse(QByteArray & res, QNetworkReply::N socket->write(res); if(socket->isOpen()){ socket->close(); - } + } } void {{classname}}Request::sendCustomResponse(QIODevice *res, QNetworkReply::NetworkError error_type){ diff --git a/modules/openapi-generator/src/main/resources/cpp-qt-qhttpengine-server/apirequest.h.mustache b/modules/openapi-generator/src/main/resources/cpp-qt-qhttpengine-server/apirequest.h.mustache index 7f78b963173..b2fad55940b 100644 --- a/modules/openapi-generator/src/main/resources/cpp-qt-qhttpengine-server/apirequest.h.mustache +++ b/modules/openapi-generator/src/main/resources/cpp-qt-qhttpengine-server/apirequest.h.mustache @@ -28,10 +28,10 @@ public: {{#operations}}{{#operation}}void {{nickname}}Request({{#hasPathParams}}{{#pathParams}}const QString& {{{paramName}}}{{^-last}}, {{/-last}}{{/pathParams}}{{/hasPathParams}}); {{/operation}}{{/operations}} - {{#operations}}{{#operation}}void {{nickname}}Response({{#returnType}}const {{{returnType}}}& res{{/returnType}}); + {{#operations}}{{#operation}}void {{nickname}}Response({{#returnType}}const {{{.}}}& res{{/returnType}}); {{/operation}}{{/operations}} - {{#operations}}{{#operation}}void {{nickname}}Error({{#returnType}}const {{{returnType}}}& res, {{/returnType}}QNetworkReply::NetworkError error_type, QString& error_str); + {{#operations}}{{#operation}}void {{nickname}}Error({{#returnType}}const {{{.}}}& res, {{/returnType}}QNetworkReply::NetworkError error_type, QString& error_str); {{/operation}}{{/operations}} void sendCustomResponse(QByteArray & res, QNetworkReply::NetworkError error_type); diff --git a/modules/openapi-generator/src/main/resources/cpp-qt-qhttpengine-server/apirouter.h.mustache b/modules/openapi-generator/src/main/resources/cpp-qt-qhttpengine-server/apirouter.h.mustache index 2b1c0cf75da..028a3097e25 100644 --- a/modules/openapi-generator/src/main/resources/cpp-qt-qhttpengine-server/apirouter.h.mustache +++ b/modules/openapi-generator/src/main/resources/cpp-qt-qhttpengine-server/apirouter.h.mustache @@ -89,7 +89,7 @@ private : } return QStringLiteral(""); } - + inline QRegularExpressionMatch getRequestMatch(QString serverTemplatePath, QString requestPath){ QRegularExpression parExpr( R"(\{([^\/\\s]+)\})" ); serverTemplatePath.replace( parExpr, R"((?<\1>[^\/\s]+))" ); diff --git a/modules/openapi-generator/src/main/resources/cpp-qt-qhttpengine-server/licenseInfo.mustache b/modules/openapi-generator/src/main/resources/cpp-qt-qhttpengine-server/licenseInfo.mustache index 360883d9f9d..166d1da53c5 100644 --- a/modules/openapi-generator/src/main/resources/cpp-qt-qhttpengine-server/licenseInfo.mustache +++ b/modules/openapi-generator/src/main/resources/cpp-qt-qhttpengine-server/licenseInfo.mustache @@ -2,8 +2,8 @@ * {{{appName}}} * {{{appDescription}}} * - * {{#version}}The version of the OpenAPI document: {{{version}}}{{/version}} - *{{#infoEmail}} Contact: {{{infoEmail}}} + * {{#version}}The version of the OpenAPI document: {{{.}}}{{/version}} + *{{#infoEmail}} Contact: {{{.}}} *{{/infoEmail}} * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech diff --git a/modules/openapi-generator/src/main/resources/cpp-qt-qhttpengine-server/main.cpp.mustache b/modules/openapi-generator/src/main/resources/cpp-qt-qhttpengine-server/main.cpp.mustache index 5b4954ae4ff..87b94f71ec6 100644 --- a/modules/openapi-generator/src/main/resources/cpp-qt-qhttpengine-server/main.cpp.mustache +++ b/modules/openapi-generator/src/main/resources/cpp-qt-qhttpengine-server/main.cpp.mustache @@ -58,7 +58,7 @@ int main(int argc, char * argv[]) QStringList() << "p" << "port", "port to listen on", "port", - "{{#serverPort}}{{serverPort}}{{/serverPort}}{{^serverPort}}8080{{/serverPort}}" + "{{serverPort}}{{^serverPort}}8080{{/serverPort}}" ); parser.addOption(portOption); parser.addHelpOption(); diff --git a/modules/openapi-generator/src/main/resources/cpp-qt-qhttpengine-server/model-header.mustache b/modules/openapi-generator/src/main/resources/cpp-qt-qhttpengine-server/model-header.mustache index 5bbe8c8c20e..8a56eb6669e 100644 --- a/modules/openapi-generator/src/main/resources/cpp-qt-qhttpengine-server/model-header.mustache +++ b/modules/openapi-generator/src/main/resources/cpp-qt-qhttpengine-server/model-header.mustache @@ -44,7 +44,7 @@ public: {{#enumVars}} {{#enumDescription}} /** - * {{enumDescription}} + * {{.}} */ {{/enumDescription}} {{{name}}}{{^-last}}, {{/-last}} diff --git a/modules/openapi-generator/src/main/resources/cpp-rest-sdk-client/README.mustache b/modules/openapi-generator/src/main/resources/cpp-rest-sdk-client/README.mustache index fa672709a8a..62f5bac46d0 100644 --- a/modules/openapi-generator/src/main/resources/cpp-rest-sdk-client/README.mustache +++ b/modules/openapi-generator/src/main/resources/cpp-rest-sdk-client/README.mustache @@ -1,7 +1,7 @@ # C++ API client {{#appDescriptionWithNewLines}} -{{{appDescriptionWithNewLines}}} +{{{.}}} {{/appDescriptionWithNewLines}} ## Overview diff --git a/modules/openapi-generator/src/main/resources/cpp-rest-sdk-client/api-gmock.mustache b/modules/openapi-generator/src/main/resources/cpp-rest-sdk-client/api-gmock.mustache index 4eac5d61d49..d144bf6a064 100644 --- a/modules/openapi-generator/src/main/resources/cpp-rest-sdk-client/api-gmock.mustache +++ b/modules/openapi-generator/src/main/resources/cpp-rest-sdk-client/api-gmock.mustache @@ -24,7 +24,7 @@ public: ~{{classname}}Mock() override = default; {{#operation}} - MOCK_METHOD{{allParams.size}}( {{operationId}}, pplx::task<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}void{{/returnType}}> ( + MOCK_METHOD{{allParams.size}}( {{operationId}}, pplx::task<{{{returnType}}}{{^returnType}}void{{/returnType}}> ( {{#allParams}} {{^required}}boost::optional<{{/required}}{{#isFile}}std::shared_ptr<{{/isFile}}{{{dataType}}}{{#isFile}}>{{/isFile}}{{^required}}>{{/required}} {{paramName}}{{^-last}},{{/-last}} {{/allParams}} diff --git a/modules/openapi-generator/src/main/resources/cpp-rest-sdk-client/api-header.mustache b/modules/openapi-generator/src/main/resources/cpp-rest-sdk-client/api-header.mustache index 4d2e796717a..3b1c75e86d1 100644 --- a/modules/openapi-generator/src/main/resources/cpp-rest-sdk-client/api-header.mustache +++ b/modules/openapi-generator/src/main/resources/cpp-rest-sdk-client/api-header.mustache @@ -31,7 +31,7 @@ public: virtual ~I{{classname}}() = default; {{#operation}} - virtual pplx::task<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}void{{/returnType}}> {{operationId}}( + virtual pplx::task<{{{returnType}}}{{^returnType}}void{{/returnType}}> {{operationId}}( {{#allParams}} {{^required}}boost::optional<{{/required}}{{{dataType}}}{{^required}}>{{/required}} {{paramName}}{{^-last}},{{/-last}} {{/allParams}} @@ -65,7 +65,7 @@ public: {{#allParams}} /// {{#lambda.multiline_comment_4}}{{description}}{{/lambda.multiline_comment_4}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}} {{/allParams}} - pplx::task<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}void{{/returnType}}> {{operationId}}( + pplx::task<{{{returnType}}}{{^returnType}}void{{/returnType}}> {{operationId}}( {{#allParams}} {{^required}}boost::optional<{{/required}}{{{dataType}}}{{^required}}>{{/required}} {{paramName}}{{^-last}},{{/-last}} {{/allParams}} diff --git a/modules/openapi-generator/src/main/resources/cpp-rest-sdk-client/api-source.mustache b/modules/openapi-generator/src/main/resources/cpp-rest-sdk-client/api-source.mustache index 145f613b0b1..517af2c5d08 100644 --- a/modules/openapi-generator/src/main/resources/cpp-rest-sdk-client/api-source.mustache +++ b/modules/openapi-generator/src/main/resources/cpp-rest-sdk-client/api-source.mustache @@ -26,7 +26,7 @@ using namespace {{modelNamespace}}; } {{#operation}} -pplx::task<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}void{{/returnType}}> {{classname}}::{{operationId}}({{#allParams}}{{^required}}boost::optional<{{/required}}{{{dataType}}}{{^required}}>{{/required}} {{paramName}}{{^-last}}, {{/-last}}{{/allParams}}) const +pplx::task<{{{returnType}}}{{^returnType}}void{{/returnType}}> {{classname}}::{{operationId}}({{#allParams}}{{^required}}boost::optional<{{/required}}{{{dataType}}}{{^required}}>{{/required}} {{paramName}}{{^-last}}, {{/-last}}{{/allParams}}) const { {{#allParams}}{{#required}}{{^isPrimitiveType}}{{^isContainer}} // verify the required parameter '{{paramName}}' is set diff --git a/modules/openapi-generator/src/main/resources/cpp-rest-sdk-client/git_push.sh.mustache b/modules/openapi-generator/src/main/resources/cpp-rest-sdk-client/git_push.sh.mustache index 8b3f689c912..f0bed5bd841 100644 --- a/modules/openapi-generator/src/main/resources/cpp-rest-sdk-client/git_push.sh.mustache +++ b/modules/openapi-generator/src/main/resources/cpp-rest-sdk-client/git_push.sh.mustache @@ -55,4 +55,3 @@ git pull origin master # Pushes (Forces) the changes in the local repository up to the remote repository echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" git push origin master 2>&1 | grep -v 'To https' - diff --git a/modules/openapi-generator/src/main/resources/cpp-rest-sdk-client/licenseInfo.mustache b/modules/openapi-generator/src/main/resources/cpp-rest-sdk-client/licenseInfo.mustache index 0342fdbca19..4b9c44b14bc 100644 --- a/modules/openapi-generator/src/main/resources/cpp-rest-sdk-client/licenseInfo.mustache +++ b/modules/openapi-generator/src/main/resources/cpp-rest-sdk-client/licenseInfo.mustache @@ -3,10 +3,10 @@ * {{{appDescription}}} * {{#version}} - * The version of the OpenAPI document: {{{version}}} + * The version of the OpenAPI document: {{{.}}} {{/version}} {{#infoEmail}} - * Contact: {{{infoEmail}}} + * Contact: {{{.}}} {{/infoEmail}} * * NOTE: This class is auto generated by OpenAPI-Generator {{{generatorVersion}}}. diff --git a/modules/openapi-generator/src/main/resources/cpp-rest-sdk-client/model-header.mustache b/modules/openapi-generator/src/main/resources/cpp-rest-sdk-client/model-header.mustache index 109596f437e..f8ba4b95e7f 100644 --- a/modules/openapi-generator/src/main/resources/cpp-rest-sdk-client/model-header.mustache +++ b/modules/openapi-generator/src/main/resources/cpp-rest-sdk-client/model-header.mustache @@ -26,7 +26,7 @@ namespace {{this}} { {{/vendorExtensions.x-has-forward-declarations}} {{#isEnum}} class {{declspec}} {{classname}} - : public {{#parent}}{{{parent}}}{{/parent}}{{^parent}}ModelBase{{/parent}} + : public {{{parent}}}{{^parent}}ModelBase{{/parent}} { public: {{classname}}(); @@ -49,7 +49,7 @@ public: {{#enumVars}} {{#enumDescription}} /// - /// {{enumDescription}} + /// {{.}} /// {{/enumDescription}} {{classname}}_{{{name}}}{{^last}},{{/last}} @@ -70,7 +70,7 @@ public: /// {{description}} /// class {{declspec}} {{classname}} - : public {{#parent}}{{{parent}}}{{/parent}}{{^parent}}ModelBase{{/parent}} + : public {{{parent}}}{{^parent}}ModelBase{{/parent}} { public: {{classname}}(); diff --git a/modules/openapi-generator/src/main/resources/cpp-rest-sdk-client/model-source.mustache b/modules/openapi-generator/src/main/resources/cpp-rest-sdk-client/model-source.mustache index 41eb29a5610..f9714b7b63f 100644 --- a/modules/openapi-generator/src/main/resources/cpp-rest-sdk-client/model-source.mustache +++ b/modules/openapi-generator/src/main/resources/cpp-rest-sdk-client/model-source.mustache @@ -127,7 +127,7 @@ void {{classname}}::validate() web::json::value {{classname}}::toJson() const { {{#parent}} - web::json::value val = this->{{{parent}}}::toJson();{{/parent}} + web::json::value val = this->{{{.}}}::toJson();{{/parent}} {{^parent}} web::json::value val = web::json::value::object(); {{/parent}} @@ -144,7 +144,7 @@ bool {{classname}}::fromJson(const web::json::value& val) { bool ok = true; {{#parent}} - ok &= this->{{{parent}}}::fromJson(val); + ok &= this->{{{.}}}::fromJson(val); {{/parent}} {{#vars}}{{^isInherited}} if(val.has_field(utility::conversions::to_string_t("{{baseName}}"))) diff --git a/modules/openapi-generator/src/main/resources/cpp-rest-sdk-client/modelbase-header.mustache b/modules/openapi-generator/src/main/resources/cpp-rest-sdk-client/modelbase-header.mustache index e9e60bd6983..b688c4fd1e5 100644 --- a/modules/openapi-generator/src/main/resources/cpp-rest-sdk-client/modelbase-header.mustache +++ b/modules/openapi-generator/src/main/resources/cpp-rest-sdk-client/modelbase-header.mustache @@ -201,7 +201,7 @@ bool ModelBase::fromString( const utility::string_t& val, std::shared_ptr& ou if(outVal == nullptr) { outVal = std::shared_ptr(new T()); - } + } if( outVal != nullptr ) { ok = outVal->fromJson(web::json::value::parse(val)); diff --git a/modules/openapi-generator/src/main/resources/cpp-restbed-server/api-header.mustache b/modules/openapi-generator/src/main/resources/cpp-restbed-server/api-header.mustache index c74cec16a4f..30e1154cff5 100644 --- a/modules/openapi-generator/src/main/resources/cpp-restbed-server/api-header.mustache +++ b/modules/openapi-generator/src/main/resources/cpp-restbed-server/api-header.mustache @@ -84,11 +84,11 @@ public: ~{{classname}}(); void startService(int const& port); void stopService(); - + protected: {{#operation}} std::shared_ptr<{{classname}}{{vendorExtensions.x-codegen-resource-name}}Resource> m_sp{{classname}}{{vendorExtensions.x-codegen-resource-name}}Resource; - {{/operation}} + {{/operation}} }; diff --git a/modules/openapi-generator/src/main/resources/cpp-restbed-server/api-source.mustache b/modules/openapi-generator/src/main/resources/cpp-restbed-server/api-source.mustache index 4ded701c2ee..e80c89321fc 100644 --- a/modules/openapi-generator/src/main/resources/cpp-restbed-server/api-source.mustache +++ b/modules/openapi-generator/src/main/resources/cpp-restbed-server/api-source.mustache @@ -33,7 +33,7 @@ void {{classname}}::startService(int const& port) { std::shared_ptr settings = std::make_shared(); settings->set_port(port); settings->set_root("{{contextPath}}"); - + this->start(settings); } @@ -217,7 +217,7 @@ void {{classname}}{{vendorExtensions.x-codegen-resource-name}}Resource::{{httpMe }); {{/hasBodyParam}} } -{{/vendorExtensions.x-codegen-other-methods}} +{{/vendorExtensions.x-codegen-other-methods}} {{/operation}} diff --git a/modules/openapi-generator/src/main/resources/cpp-restbed-server/git_push.sh.mustache b/modules/openapi-generator/src/main/resources/cpp-restbed-server/git_push.sh.mustache index 8b3f689c912..f0bed5bd841 100644 --- a/modules/openapi-generator/src/main/resources/cpp-restbed-server/git_push.sh.mustache +++ b/modules/openapi-generator/src/main/resources/cpp-restbed-server/git_push.sh.mustache @@ -55,4 +55,3 @@ git pull origin master # Pushes (Forces) the changes in the local repository up to the remote repository echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" git push origin master 2>&1 | grep -v 'To https' - diff --git a/modules/openapi-generator/src/main/resources/cpp-restbed-server/licenseInfo.mustache b/modules/openapi-generator/src/main/resources/cpp-restbed-server/licenseInfo.mustache index e0d370894bb..85213c8b15c 100644 --- a/modules/openapi-generator/src/main/resources/cpp-restbed-server/licenseInfo.mustache +++ b/modules/openapi-generator/src/main/resources/cpp-restbed-server/licenseInfo.mustache @@ -2,8 +2,8 @@ * {{{appName}}} * {{{appDescription}}} * - * {{#version}}The version of the OpenAPI document: {{{version}}}{{/version}} - * {{#infoEmail}}Contact: {{{infoEmail}}}{{/infoEmail}} + * {{#version}}The version of the OpenAPI document: {{{.}}}{{/version}} + * {{#infoEmail}}Contact: {{{.}}}{{/infoEmail}} * * NOTE: This class is auto generated by OpenAPI-Generator {{{generatorVersion}}}. * https://openapi-generator.tech diff --git a/modules/openapi-generator/src/main/resources/cpp-restbed-server/model-header.mustache b/modules/openapi-generator/src/main/resources/cpp-restbed-server/model-header.mustache index 090481e0a16..805b0664ab2 100644 --- a/modules/openapi-generator/src/main/resources/cpp-restbed-server/model-header.mustache +++ b/modules/openapi-generator/src/main/resources/cpp-restbed-server/model-header.mustache @@ -30,7 +30,7 @@ class {{declspec}} {{classname}} {{#interfaces}}{{#-first}}:{{/-first}}{{^-first public: {{classname}}(); virtual ~{{classname}}(); - + std::string toJsonString(bool prettyJson = false); void fromJsonString(std::string const& jsonString); boost::property_tree::ptree toPropertyTree(); diff --git a/modules/openapi-generator/src/main/resources/cpp-tiny/README.mustache b/modules/openapi-generator/src/main/resources/cpp-tiny/README.mustache index e749562a0aa..2a47e520d3e 100644 --- a/modules/openapi-generator/src/main/resources/cpp-tiny/README.mustache +++ b/modules/openapi-generator/src/main/resources/cpp-tiny/README.mustache @@ -40,4 +40,3 @@ All URIs are relative to {{{scheme}}}://{{{host}}}{{{basePath}}} |------------- | -------------| {{#models}}{{#model}}|*{{classname}}* | {{{description}}}| {{/model}}{{/models}} - diff --git a/modules/openapi-generator/src/main/resources/cpp-tiny/helpers-body.mustache b/modules/openapi-generator/src/main/resources/cpp-tiny/helpers-body.mustache index c3935b37cde..5fc0fc2f991 100644 --- a/modules/openapi-generator/src/main/resources/cpp-tiny/helpers-body.mustache +++ b/modules/openapi-generator/src/main/resources/cpp-tiny/helpers-body.mustache @@ -23,39 +23,39 @@ jsonToValue(void* target, bourne::json value, std::string type) { if (target == NULL || value.is_null()) { return; - } - - else if (type.compare("bool") == 0) + } + + else if (type.compare("bool") == 0) { bool* val = static_cast (target); *val = value.to_bool(); - } - - else if (type.compare("int") == 0) + } + + else if (type.compare("int") == 0) { int* val = static_cast (target); *val = value.to_int(); - } - - else if (type.compare("float") == 0) + } + + else if (type.compare("float") == 0) { float* val = static_cast (target); *val = (float)(value.to_float()); - } + } else if (type.compare("long") == 0) { long* val = static_cast (target); *val = (long)(value.to_int()); - } - - else if (type.compare("double") == 0) + } + + else if (type.compare("double") == 0) { double* val = static_cast (target); *val = value.to_float(); - } - - else if (type.compare("std::string") == 0) + } + + else if (type.compare("std::string") == 0) { std::string* val = static_cast (target); *val = value.to_string(); diff --git a/modules/openapi-generator/src/main/resources/cpp-tiny/helpers-header.mustache b/modules/openapi-generator/src/main/resources/cpp-tiny/helpers-header.mustache index 5ef7d9afdf7..710a3333f58 100644 --- a/modules/openapi-generator/src/main/resources/cpp-tiny/helpers-header.mustache +++ b/modules/openapi-generator/src/main/resources/cpp-tiny/helpers-header.mustache @@ -19,4 +19,3 @@ std::string stringify(float input); std::string stringify(std::string input); #endif /* TINY_CPP_CLIENT_HELPERS_H_ */ - diff --git a/modules/openapi-generator/src/main/resources/cpp-tiny/model-body.mustache b/modules/openapi-generator/src/main/resources/cpp-tiny/model-body.mustache index b2f2ee66fd9..056ff957c20 100644 --- a/modules/openapi-generator/src/main/resources/cpp-tiny/model-body.mustache +++ b/modules/openapi-generator/src/main/resources/cpp-tiny/model-body.mustache @@ -28,13 +28,13 @@ using namespace Tiny; void {{classname}}::fromJson(std::string jsonObj) -{ +{ bourne::json object = bourne::json::parse(jsonObj); {{#vars}} const char *{{name}}Key = "{{baseName}}"; - - if(object.has_key({{name}}Key)) + + if(object.has_key({{name}}Key)) { bourne::json value = object[{{name}}Key]; @@ -50,11 +50,11 @@ void {{#isPrimitiveType}} jsonToValue(&element, var, "{{dataType}}"); {{/isPrimitiveType}} - + {{^isPrimitiveType}} element.fromJson(var.dump()); {{/isPrimitiveType}} - + {{/items}} {{name}}_list.push_back(element); } @@ -64,7 +64,7 @@ void {{/isContainer}} {{^isContainer}} - + {{#isPrimitiveType}} jsonToValue(&{{name}}, value, "{{baseType}}"); {{/isPrimitiveType}} @@ -87,13 +87,13 @@ bourne::json bourne::json object = bourne::json::object(); {{#vars}} - + {{#isContainer}} {{#isArray}} - + {{#items}} {{#isPrimitiveType}} - + std::list<{{dataType}}> {{name}}_list = {{getter}}(); bourne::json {{name}}_arr = bourne::json::array(); @@ -103,7 +103,7 @@ bourne::json } object["{{name}}"] = {{name}}_arr; - + {{/isPrimitiveType}} {{^isPrimitiveType}} @@ -117,7 +117,7 @@ bourne::json } object["{{name}}"] = {{name}}_arr; - {{/isPrimitiveType}} + {{/isPrimitiveType}} {{/items}} {{/isArray}} {{/isContainer}} diff --git a/modules/openapi-generator/src/main/resources/cpp-tiny/root.cert.mustache b/modules/openapi-generator/src/main/resources/cpp-tiny/root.cert.mustache index bad9c08efad..59d760f1e16 100644 --- a/modules/openapi-generator/src/main/resources/cpp-tiny/root.cert.mustache +++ b/modules/openapi-generator/src/main/resources/cpp-tiny/root.cert.mustache @@ -50,4 +50,3 @@ "rqXRfboQnoZsG4q5WTP468SQvvG5\n" \ "-----END CERTIFICATE-----\n" \ */ - diff --git a/modules/openapi-generator/src/main/resources/cpp-tiny/run-tests.mustache b/modules/openapi-generator/src/main/resources/cpp-tiny/run-tests.mustache index 54bf326c43a..dd22e715258 100644 --- a/modules/openapi-generator/src/main/resources/cpp-tiny/run-tests.mustache +++ b/modules/openapi-generator/src/main/resources/cpp-tiny/run-tests.mustache @@ -24,7 +24,7 @@ void runTests(){ {{/vars}} {{/model}}{{/models}} - + } int main(void) { @@ -40,5 +40,5 @@ void setup() { } void loop() { - + } diff --git a/modules/openapi-generator/src/main/resources/cpp-tiny/service/Response.h.mustache b/modules/openapi-generator/src/main/resources/cpp-tiny/service/Response.h.mustache index 9b7b616b8f1..af7543e0c9b 100644 --- a/modules/openapi-generator/src/main/resources/cpp-tiny/service/Response.h.mustache +++ b/modules/openapi-generator/src/main/resources/cpp-tiny/service/Response.h.mustache @@ -21,5 +21,5 @@ template T obj; }; } // namespace Tinyclient - + #endif /* TINY_CPP_CLIENT_RESPONSE_H_ */ diff --git a/modules/openapi-generator/src/main/resources/cpp-tiny/service/api-body.mustache b/modules/openapi-generator/src/main/resources/cpp-tiny/service/api-body.mustache index dc129868837..c151d92c4d8 100644 --- a/modules/openapi-generator/src/main/resources/cpp-tiny/service/api-body.mustache +++ b/modules/openapi-generator/src/main/resources/cpp-tiny/service/api-body.mustache @@ -216,4 +216,3 @@ using namespace Tiny; {{/operations}} - diff --git a/modules/openapi-generator/src/main/resources/cpp-tiny/unit-test-model.mustache b/modules/openapi-generator/src/main/resources/cpp-tiny/unit-test-model.mustache index 14894973b81..c6b008606ed 100644 --- a/modules/openapi-generator/src/main/resources/cpp-tiny/unit-test-model.mustache +++ b/modules/openapi-generator/src/main/resources/cpp-tiny/unit-test-model.mustache @@ -14,7 +14,7 @@ using namespace Tiny; void test_{{classname}}_{{name}}_is_assigned_from_json() { {{#isInteger}} - bourne::json input = + bourne::json input = { "{{name}}", 1 }; @@ -26,7 +26,7 @@ void test_{{classname}}_{{name}}_is_assigned_from_json() {{#isString}} - bourne::json input = + bourne::json input = { "{{name}}", "hello" }; @@ -38,7 +38,7 @@ void test_{{classname}}_{{name}}_is_assigned_from_json() {{#isBoolean}} - bourne::json input = + bourne::json input = { "{{name}}", true }; @@ -50,7 +50,7 @@ void test_{{classname}}_{{name}}_is_assigned_from_json() {{#isLong}} - bourne::json input = + bourne::json input = { "{{name}}", 1 }; @@ -62,7 +62,7 @@ void test_{{classname}}_{{name}}_is_assigned_from_json() {{#isFloat}} - bourne::json input = + bourne::json input = { "{{name}}", 1.0 }; @@ -80,7 +80,7 @@ void test_{{classname}}_{{name}}_is_assigned_from_json() void test_{{classname}}_{{name}}_is_converted_to_json() { {{#isInteger}} - bourne::json input = + bourne::json input = { "{{name}}", 1 }; @@ -95,7 +95,7 @@ void test_{{classname}}_{{name}}_is_converted_to_json() {{/isInteger}} {{#isString}} - bourne::json input = + bourne::json input = { "{{name}}", "hello" }; @@ -110,7 +110,7 @@ void test_{{classname}}_{{name}}_is_converted_to_json() {{/isString}} {{#isBoolean}} - bourne::json input = + bourne::json input = { "{{name}}", true }; @@ -125,7 +125,7 @@ void test_{{classname}}_{{name}}_is_converted_to_json() {{/isBoolean}} {{#isLong}} - bourne::json input = + bourne::json input = { "{{name}}", 1 }; @@ -140,7 +140,7 @@ void test_{{classname}}_{{name}}_is_converted_to_json() {{/isLong}} {{#isFloat}} - bourne::json input = + bourne::json input = { "{{name}}", 1.0 }; diff --git a/modules/openapi-generator/src/main/resources/cpp-tiny/unittest.mustache b/modules/openapi-generator/src/main/resources/cpp-tiny/unittest.mustache index c6a1f23a6e3..6cb35dfc332 100644 --- a/modules/openapi-generator/src/main/resources/cpp-tiny/unittest.mustache +++ b/modules/openapi-generator/src/main/resources/cpp-tiny/unittest.mustache @@ -4,7 +4,7 @@ #include #include "bourne/json.hpp" -void setUp(){ +void setUp(){ } @@ -12,7 +12,7 @@ void tearDown(){ } void test_id_is_assigned(){ - bourne::json petJSON = + bourne::json petJSON = { "id", 1 }; @@ -24,19 +24,19 @@ void test_id_is_assigned(){ } void test_name_is_assigned(){ - bourne::json petJSON = + bourne::json petJSON = { "name", "Shiba" }; Tiny::Pet pet(petJSON.dump()); - + TEST_ASSERT_EQUAL_STRING("Shiba", pet.getName().c_str()); } void test_status_is_assigned(){ - bourne::json petJSON = + bourne::json petJSON = { "status", "Sold" }; @@ -48,13 +48,13 @@ void test_status_is_assigned(){ void test_category_object_is_assigned(){ - bourne::json catJSON = + bourne::json catJSON = { "id", 3, "name", "Small dog" }; - bourne::json petJSON = + bourne::json petJSON = { "category", catJSON, }; @@ -73,7 +73,7 @@ void test_photo_string_list_is_assigned(){ bourne::json photoARR = bourne::json::array("url1", "url2", "url3", "url4"); - bourne::json petJSON = + bourne::json petJSON = { "photoUrls", photoARR, }; @@ -84,14 +84,14 @@ void test_photo_string_list_is_assigned(){ } void test_tags_object_list_is_assigned(){ - bourne::json aTag = + bourne::json aTag = { "id", 2, "name", "Hello" }; bourne::json tagsARR = bourne::json::array(aTag); - bourne::json petJSON = + bourne::json petJSON = { "tags", tagsARR, }; @@ -126,7 +126,5 @@ void setup() { } void loop() { - + } - - diff --git a/modules/openapi-generator/src/main/resources/cpp-tizen-client/Doxyfile.mustache b/modules/openapi-generator/src/main/resources/cpp-tizen-client/Doxyfile.mustache index a1bae5840c6..e4fc0125bf0 100644 --- a/modules/openapi-generator/src/main/resources/cpp-tizen-client/Doxyfile.mustache +++ b/modules/openapi-generator/src/main/resources/cpp-tizen-client/Doxyfile.mustache @@ -154,7 +154,7 @@ FULL_PATH_NAMES = NO # will be relative from the directory where doxygen is started. # This tag requires that the tag FULL_PATH_NAMES is set to YES. -STRIP_FROM_PATH = +STRIP_FROM_PATH = # The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of the # path mentioned in the documentation of a class, which tells the reader which @@ -163,7 +163,7 @@ STRIP_FROM_PATH = # specify the list of include paths that are normally passed to the compiler # using the -I flag. -STRIP_FROM_INC_PATH = +STRIP_FROM_INC_PATH = # If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter (but # less readable) file names. This can be useful is your file systems doesn't @@ -230,13 +230,13 @@ TAB_SIZE = 4 # "Side Effects:". You can put \n's in the value part of an alias to insert # newlines. -ALIASES = +ALIASES = # This tag can be used to specify a number of word-keyword mappings (TCL only). # A mapping has the form "name=value". For example adding "class=itcl::class" # will allow you to use the command class in the itcl::class meaning. -TCL_SUBST = +TCL_SUBST = # Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C sources # only. Doxygen will then generate output that is more tailored for C. For @@ -280,7 +280,7 @@ OPTIMIZE_OUTPUT_VHDL = NO # Note that for custom extensions you also need to set FILE_PATTERNS otherwise # the files are not read by doxygen. -EXTENSION_MAPPING = +EXTENSION_MAPPING = # If the MARKDOWN_SUPPORT tag is enabled then doxygen pre-processes all comments # according to the Markdown format, which allows for more readable @@ -616,7 +616,7 @@ GENERATE_DEPRECATEDLIST= YES # sections, marked by \if ... \endif and \cond # ... \endcond blocks. -ENABLED_SECTIONS = +ENABLED_SECTIONS = # The MAX_INITIALIZER_LINES tag determines the maximum number of lines that the # initial value of a variable or macro / define can have for it to appear in the @@ -658,7 +658,7 @@ SHOW_NAMESPACES = YES # by doxygen. Whatever the program writes to standard output is used as the file # version. For an example see the documentation. -FILE_VERSION_FILTER = +FILE_VERSION_FILTER = # The LAYOUT_FILE tag can be used to specify a layout file which will be parsed # by doxygen. The layout file controls the global structure of the generated @@ -671,7 +671,7 @@ FILE_VERSION_FILTER = # DoxygenLayout.xml, doxygen will parse it automatically even if the LAYOUT_FILE # tag is left empty. -LAYOUT_FILE = +LAYOUT_FILE = # The CITE_BIB_FILES tag can be used to specify one or more bib files containing # the reference definitions. This must be a list of .bib files. The .bib @@ -682,7 +682,7 @@ LAYOUT_FILE = # search path. Do not use file names with spaces, bibtex cannot handle them. See # also \cite for info how to create references. -CITE_BIB_FILES = +CITE_BIB_FILES = #--------------------------------------------------------------------------- # Configuration options related to warning and progress messages @@ -741,7 +741,7 @@ WARN_FORMAT = "$file:$line: $text" # messages should be written. If left blank the output is written to standard # error (stderr). -WARN_LOGFILE = +WARN_LOGFILE = #--------------------------------------------------------------------------- # Configuration options related to the input files @@ -788,7 +788,7 @@ RECURSIVE = NO # Note that relative paths are relative to the directory from which doxygen is # run. -EXCLUDE = +EXCLUDE = # The EXCLUDE_SYMLINKS tag can be used to select whether or not files or # directories that are symbolic links (a Unix file system feature) are excluded @@ -804,7 +804,7 @@ EXCLUDE_SYMLINKS = NO # Note that the wildcards are matched against the file with absolute path, so to # exclude all test directories for example use the pattern */test/* -EXCLUDE_PATTERNS = +EXCLUDE_PATTERNS = # The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names # (namespaces, classes, functions, etc.) that should be excluded from the @@ -815,13 +815,13 @@ EXCLUDE_PATTERNS = # Note that the wildcards are matched against the file with absolute path, so to # exclude all test directories use the pattern */test/* -EXCLUDE_SYMBOLS = +EXCLUDE_SYMBOLS = # The EXAMPLE_PATH tag can be used to specify one or more files or directories # that contain example code fragments that are included (see the \include # command). -EXAMPLE_PATH = +EXAMPLE_PATH = # If the value of the EXAMPLE_PATH tag contains directories, you can use the # EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp and @@ -841,7 +841,7 @@ EXAMPLE_RECURSIVE = NO # that contain images that are to be included in the documentation (see the # \image command). -IMAGE_PATH = +IMAGE_PATH = # The INPUT_FILTER tag can be used to specify a program that doxygen should # invoke to filter for each input file. Doxygen will invoke the filter program @@ -858,7 +858,7 @@ IMAGE_PATH = # code is scanned, but not when the output code is generated. If lines are added # or removed, the anchors will not be placed correctly. -INPUT_FILTER = +INPUT_FILTER = # The FILTER_PATTERNS tag can be used to specify filters on a per file pattern # basis. Doxygen will compare the file name with each pattern and apply the @@ -867,7 +867,7 @@ INPUT_FILTER = # filters are used. If the FILTER_PATTERNS tag is empty or if none of the # patterns match the file name, INPUT_FILTER is applied. -FILTER_PATTERNS = +FILTER_PATTERNS = # If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using # INPUT_FILTER ) will also be used to filter the input files that are used for @@ -882,14 +882,14 @@ FILTER_SOURCE_FILES = NO # *.ext= (so without naming a filter). # This tag requires that the tag FILTER_SOURCE_FILES is set to YES. -FILTER_SOURCE_PATTERNS = +FILTER_SOURCE_PATTERNS = # If the USE_MDFILE_AS_MAINPAGE tag refers to the name of a markdown file that # is part of the input, its contents will be placed on the main page # (index.html). This can be useful if you have a project on for instance GitHub # and want to reuse the introduction page also for the doxygen output. -USE_MDFILE_AS_MAINPAGE = +USE_MDFILE_AS_MAINPAGE = #--------------------------------------------------------------------------- # Configuration options related to source browsing @@ -1001,7 +1001,7 @@ COLS_IN_ALPHA_INDEX = 5 # while generating the index headers. # This tag requires that the tag ALPHABETICAL_INDEX is set to YES. -IGNORE_PREFIX = +IGNORE_PREFIX = #--------------------------------------------------------------------------- # Configuration options related to the HTML output @@ -1045,7 +1045,7 @@ HTML_FILE_EXTENSION = .html # of the possible markers and block names see the documentation. # This tag requires that the tag GENERATE_HTML is set to YES. -HTML_HEADER = +HTML_HEADER = # The HTML_FOOTER tag can be used to specify a user-defined HTML footer for each # generated HTML page. If the tag is left blank doxygen will generate a standard @@ -1055,7 +1055,7 @@ HTML_HEADER = # that doxygen normally uses. # This tag requires that the tag GENERATE_HTML is set to YES. -HTML_FOOTER = +HTML_FOOTER = # The HTML_STYLESHEET tag can be used to specify a user-defined cascading style # sheet that is used by each HTML page. It can be used to fine-tune the look of @@ -1067,7 +1067,7 @@ HTML_FOOTER = # obsolete. # This tag requires that the tag GENERATE_HTML is set to YES. -HTML_STYLESHEET = +HTML_STYLESHEET = # The HTML_EXTRA_STYLESHEET tag can be used to specify an additional user- # defined cascading style sheet that is included after the standard style sheets @@ -1078,7 +1078,7 @@ HTML_STYLESHEET = # see the documentation. # This tag requires that the tag GENERATE_HTML is set to YES. -HTML_EXTRA_STYLESHEET = +HTML_EXTRA_STYLESHEET = # The HTML_EXTRA_FILES tag can be used to specify one or more extra images or # other source files which should be copied to the HTML output directory. Note @@ -1088,7 +1088,7 @@ HTML_EXTRA_STYLESHEET = # files will be copied as-is; there are no commands or markers available. # This tag requires that the tag GENERATE_HTML is set to YES. -HTML_EXTRA_FILES = +HTML_EXTRA_FILES = # The HTML_COLORSTYLE_HUE tag controls the color of the HTML output. Doxygen # will adjust the colors in the stylesheet and background images according to @@ -1216,7 +1216,7 @@ GENERATE_HTMLHELP = NO # written to the html output directory. # This tag requires that the tag GENERATE_HTMLHELP is set to YES. -CHM_FILE = +CHM_FILE = # The HHC_LOCATION tag can be used to specify the location (absolute path # including file name) of the HTML help compiler ( hhc.exe). If non-empty @@ -1224,7 +1224,7 @@ CHM_FILE = # The file has to be specified with full path. # This tag requires that the tag GENERATE_HTMLHELP is set to YES. -HHC_LOCATION = +HHC_LOCATION = # The GENERATE_CHI flag controls if a separate .chi index file is generated ( # YES) or that it should be included in the master .chm file ( NO). @@ -1237,7 +1237,7 @@ GENERATE_CHI = NO # and project file content. # This tag requires that the tag GENERATE_HTMLHELP is set to YES. -CHM_INDEX_ENCODING = +CHM_INDEX_ENCODING = # The BINARY_TOC flag controls whether a binary table of contents is generated ( # YES) or a normal table of contents ( NO) in the .chm file. @@ -1267,7 +1267,7 @@ GENERATE_QHP = NO # the HTML output folder. # This tag requires that the tag GENERATE_QHP is set to YES. -QCH_FILE = +QCH_FILE = # The QHP_NAMESPACE tag specifies the namespace to use when generating Qt Help # Project output. For more information please see Qt Help Project / Namespace @@ -1292,7 +1292,7 @@ QHP_VIRTUAL_FOLDER = doc # filters). # This tag requires that the tag GENERATE_QHP is set to YES. -QHP_CUST_FILTER_NAME = +QHP_CUST_FILTER_NAME = # The QHP_CUST_FILTER_ATTRS tag specifies the list of the attributes of the # custom filter to add. For more information please see Qt Help Project / Custom @@ -1300,21 +1300,21 @@ QHP_CUST_FILTER_NAME = # filters). # This tag requires that the tag GENERATE_QHP is set to YES. -QHP_CUST_FILTER_ATTRS = +QHP_CUST_FILTER_ATTRS = # The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this # project's filter section matches. Qt Help Project / Filter Attributes (see: # http://qt-project.org/doc/qt-4.8/qthelpproject.html#filter-attributes). # This tag requires that the tag GENERATE_QHP is set to YES. -QHP_SECT_FILTER_ATTRS = +QHP_SECT_FILTER_ATTRS = # The QHG_LOCATION tag can be used to specify the location of Qt's # qhelpgenerator. If non-empty doxygen will try to run qhelpgenerator on the # generated .qhp file. # This tag requires that the tag GENERATE_QHP is set to YES. -QHG_LOCATION = +QHG_LOCATION = # If the GENERATE_ECLIPSEHELP tag is set to YES, additional index files will be # generated, together with the HTML files, they form an Eclipse help plugin. To @@ -1447,7 +1447,7 @@ MATHJAX_RELPATH = http://cdn.mathjax.org/mathjax/latest # MATHJAX_EXTENSIONS = TeX/AMSmath TeX/AMSsymbols # This tag requires that the tag USE_MATHJAX is set to YES. -MATHJAX_EXTENSIONS = +MATHJAX_EXTENSIONS = # The MATHJAX_CODEFILE tag can be used to specify a file with javascript pieces # of code that will be used on startup of the MathJax code. See the MathJax site @@ -1455,7 +1455,7 @@ MATHJAX_EXTENSIONS = # example see the documentation. # This tag requires that the tag USE_MATHJAX is set to YES. -MATHJAX_CODEFILE = +MATHJAX_CODEFILE = # When the SEARCHENGINE tag is enabled doxygen will generate a search box for # the HTML output. The underlying search engine uses javascript and DHTML and @@ -1515,7 +1515,7 @@ EXTERNAL_SEARCH = NO # Searching" for details. # This tag requires that the tag SEARCHENGINE is set to YES. -SEARCHENGINE_URL = +SEARCHENGINE_URL = # When SERVER_BASED_SEARCH and EXTERNAL_SEARCH are both enabled the unindexed # search data is written to a file for indexing by an external tool. With the @@ -1531,7 +1531,7 @@ SEARCHDATA_FILE = searchdata.xml # projects and redirect the results back to the right project. # This tag requires that the tag SEARCHENGINE is set to YES. -EXTERNAL_SEARCH_ID = +EXTERNAL_SEARCH_ID = # The EXTRA_SEARCH_MAPPINGS tag can be used to enable searching through doxygen # projects other than the one defined by this configuration file, but that are @@ -1541,7 +1541,7 @@ EXTERNAL_SEARCH_ID = # EXTRA_SEARCH_MAPPINGS = tagname1=loc1 tagname2=loc2 ... # This tag requires that the tag SEARCHENGINE is set to YES. -EXTRA_SEARCH_MAPPINGS = +EXTRA_SEARCH_MAPPINGS = #--------------------------------------------------------------------------- # Configuration options related to the LaTeX output @@ -1602,7 +1602,7 @@ PAPER_TYPE = a4 # If left blank no extra packages will be included. # This tag requires that the tag GENERATE_LATEX is set to YES. -EXTRA_PACKAGES = +EXTRA_PACKAGES = # The LATEX_HEADER tag can be used to specify a personal LaTeX header for the # generated LaTeX document. The header should contain everything until the first @@ -1618,7 +1618,7 @@ EXTRA_PACKAGES = # PROJECT_NAME), or the project number (see PROJECT_NUMBER). # This tag requires that the tag GENERATE_LATEX is set to YES. -LATEX_HEADER = +LATEX_HEADER = # The LATEX_FOOTER tag can be used to specify a personal LaTeX footer for the # generated LaTeX document. The footer should contain everything after the last @@ -1627,7 +1627,7 @@ LATEX_HEADER = # Note: Only use a user-defined footer if you know what you are doing! # This tag requires that the tag GENERATE_LATEX is set to YES. -LATEX_FOOTER = +LATEX_FOOTER = # The LATEX_EXTRA_FILES tag can be used to specify one or more extra images or # other source files which should be copied to the LATEX_OUTPUT output @@ -1635,7 +1635,7 @@ LATEX_FOOTER = # markers available. # This tag requires that the tag GENERATE_LATEX is set to YES. -LATEX_EXTRA_FILES = +LATEX_EXTRA_FILES = # If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated is # prepared for conversion to PDF (using ps2pdf or pdflatex). The PDF file will @@ -1735,14 +1735,14 @@ RTF_HYPERLINKS = NO # default style sheet that doxygen normally uses. # This tag requires that the tag GENERATE_RTF is set to YES. -RTF_STYLESHEET_FILE = +RTF_STYLESHEET_FILE = # Set optional variables used in the generation of an RTF document. Syntax is # similar to doxygen's config file. A template extensions file can be generated # using doxygen -e rtf extensionFile. # This tag requires that the tag GENERATE_RTF is set to YES. -RTF_EXTENSIONS_FILE = +RTF_EXTENSIONS_FILE = #--------------------------------------------------------------------------- # Configuration options related to the man page output @@ -1803,13 +1803,13 @@ XML_OUTPUT = xml # validating XML parser to check the syntax of the XML files. # This tag requires that the tag GENERATE_XML is set to YES. -XML_SCHEMA = +XML_SCHEMA = # The XML_DTD tag can be used to specify a XML DTD, which can be used by a # validating XML parser to check the syntax of the XML files. # This tag requires that the tag GENERATE_XML is set to YES. -XML_DTD = +XML_DTD = # If the XML_PROGRAMLISTING tag is set to YES doxygen will dump the program # listings (including syntax highlighting and cross-referencing information) to @@ -1886,7 +1886,7 @@ PERLMOD_PRETTY = YES # overwrite each other's variables. # This tag requires that the tag GENERATE_PERLMOD is set to YES. -PERLMOD_MAKEVAR_PREFIX = +PERLMOD_MAKEVAR_PREFIX = #--------------------------------------------------------------------------- # Configuration options related to the preprocessor @@ -1927,7 +1927,7 @@ SEARCH_INCLUDES = YES # preprocessor. # This tag requires that the tag SEARCH_INCLUDES is set to YES. -INCLUDE_PATH = +INCLUDE_PATH = # You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard # patterns (like *.h and *.hpp) to filter out the header-files in the @@ -1935,7 +1935,7 @@ INCLUDE_PATH = # used. # This tag requires that the tag ENABLE_PREPROCESSING is set to YES. -INCLUDE_FILE_PATTERNS = +INCLUDE_FILE_PATTERNS = # The PREDEFINED tag can be used to specify one or more macro names that are # defined before the preprocessor is started (similar to the -D option of e.g. @@ -1945,7 +1945,7 @@ INCLUDE_FILE_PATTERNS = # recursively expanded use the := operator instead of the = operator. # This tag requires that the tag ENABLE_PREPROCESSING is set to YES. -PREDEFINED = +PREDEFINED = # If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then this # tag can be used to specify a list of macro names that should be expanded. The @@ -1954,7 +1954,7 @@ PREDEFINED = # definition found in the source code. # This tag requires that the tag ENABLE_PREPROCESSING is set to YES. -EXPAND_AS_DEFINED = +EXPAND_AS_DEFINED = # If the SKIP_FUNCTION_MACROS tag is set to YES then doxygen's preprocessor will # remove all references to function-like macros that are alone on a line, have an @@ -1983,13 +1983,13 @@ SKIP_FUNCTION_MACROS = YES # the path). If a tag file is not located in the directory in which doxygen is # run, you must also specify the path to the tagfile here. -TAGFILES = +TAGFILES = # When a file name is specified after GENERATE_TAGFILE, doxygen will create a # tag file that is based on the input files it reads. See section "Linking to # external documentation" for more information about the usage of tag files. -GENERATE_TAGFILE = +GENERATE_TAGFILE = # If the ALLEXTERNALS tag is set to YES all external class will be listed in the # class index. If set to NO only the inherited external classes will be listed. @@ -2037,14 +2037,14 @@ CLASS_DIAGRAMS = YES # the mscgen tool resides. If left empty the tool is assumed to be found in the # default search path. -MSCGEN_PATH = +MSCGEN_PATH = # You can include diagrams made with dia in doxygen documentation. Doxygen will # then run dia to produce the diagram and insert it in the documentation. The # DIA_PATH tag allows you to specify the directory where the dia binary resides. # If left empty dia is assumed to be found in the default search path. -DIA_PATH = +DIA_PATH = # If set to YES, the inheritance and collaboration graphs will hide inheritance # and usage relations if the target is undocumented or is not a class. @@ -2093,7 +2093,7 @@ DOT_FONTSIZE = 10 # the path where dot can find it using this tag. # This tag requires that the tag HAVE_DOT is set to YES. -DOT_FONTPATH = +DOT_FONTPATH = # If the CLASS_GRAPH tag is set to YES then doxygen will generate a graph for # each documented class showing the direct and indirect inheritance relations. @@ -2231,26 +2231,26 @@ INTERACTIVE_SVG = NO # found. If left blank, it is assumed the dot tool can be found in the path. # This tag requires that the tag HAVE_DOT is set to YES. -DOT_PATH = +DOT_PATH = # The DOTFILE_DIRS tag can be used to specify one or more directories that # contain dot files that are included in the documentation (see the \dotfile # command). # This tag requires that the tag HAVE_DOT is set to YES. -DOTFILE_DIRS = +DOTFILE_DIRS = # The MSCFILE_DIRS tag can be used to specify one or more directories that # contain msc files that are included in the documentation (see the \mscfile # command). -MSCFILE_DIRS = +MSCFILE_DIRS = # The DIAFILE_DIRS tag can be used to specify one or more directories that # contain dia files that are included in the documentation (see the \diafile # command). -DIAFILE_DIRS = +DIAFILE_DIRS = # The DOT_GRAPH_MAX_NODES tag can be used to set the maximum number of nodes # that will be shown in the graph. If the number of nodes in a graph becomes diff --git a/modules/openapi-generator/src/main/resources/cpp-ue4/api-header.mustache b/modules/openapi-generator/src/main/resources/cpp-ue4/api-header.mustache index b6059901809..4f2bec0027a 100644 --- a/modules/openapi-generator/src/main/resources/cpp-ue4/api-header.mustache +++ b/modules/openapi-generator/src/main/resources/cpp-ue4/api-header.mustache @@ -5,7 +5,7 @@ #include "{{modelNamePrefix}}BaseModel.h" {{#cppNamespaceDeclarations}} -namespace {{this}} +namespace {{this}} { {{/cppNamespaceDeclarations}} @@ -15,16 +15,16 @@ public: {{classname}}(); ~{{classname}}(); - /* Sets the URL Endpoint. + /* Sets the URL Endpoint. * Note: several fallback endpoints can be configured in request retry policies, see Request::SetShouldRetry */ void SetURL(const FString& Url); /* Adds global header params to all requests */ void AddHeaderParam(const FString& Key, const FString& Value); void ClearHeaderParams(); - + /* Sets the retry manager to the user-defined retry manager. User must manage the lifetime of the retry manager. - * If no retry manager is specified and a request needs retries, a default retry manager will be used. + * If no retry manager is specified and a request needs retries, a default retry manager will be used. * See also: Request::SetShouldRetry */ void SetHttpRetryManager(FHttpRetrySystem::FManager& RetryManager); FHttpRetrySystem::FManager& GetHttpRetryManager(); @@ -34,7 +34,7 @@ public: {{/operation}}{{/operations}} {{#operations}}{{#operation}}DECLARE_DELEGATE_OneParam(F{{operationIdCamelCase}}Delegate, const {{operationIdCamelCase}}Response&); {{/operation}}{{/operations}} - {{#operations}}{{#operation}}{{#description}}/* {{{description}}} */ + {{#operations}}{{#operation}}{{#description}}/* {{{.}}} */ {{/description}}FHttpRequestPtr {{operationIdCamelCase}}(const {{operationIdCamelCase}}Request& Request, const F{{operationIdCamelCase}}Delegate& Delegate = F{{operationIdCamelCase}}Delegate()) const; {{/operation}}{{/operations}} private: @@ -49,7 +49,7 @@ private: mutable FHttpRetrySystem::FManager* RetryManager = nullptr; mutable TUniquePtr DefaultRetryManager; }; - + {{#cppNamespaceDeclarations}} } {{/cppNamespaceDeclarations}} diff --git a/modules/openapi-generator/src/main/resources/cpp-ue4/api-operations-header.mustache b/modules/openapi-generator/src/main/resources/cpp-ue4/api-operations-header.mustache index f4810ba5888..99b57ea20ae 100644 --- a/modules/openapi-generator/src/main/resources/cpp-ue4/api-operations-header.mustache +++ b/modules/openapi-generator/src/main/resources/cpp-ue4/api-operations-header.mustache @@ -8,7 +8,7 @@ {{/imports}} {{#cppNamespaceDeclarations}} -namespace {{this}} +namespace {{this}} { {{/cppNamespaceDeclarations}} @@ -16,7 +16,7 @@ namespace {{this}} {{#operation}} /* {{summary}} {{#notes}} * - * {{notes}}{{/notes}} + * {{.}}{{/notes}} */ class {{dllapi}} {{classname}}::{{operationIdCamelCase}}Request : public Request { @@ -24,7 +24,7 @@ public: virtual ~{{operationIdCamelCase}}Request() {} void SetupHttpRequest(const FHttpRequestRef& HttpRequest) const final; FString ComputePath() const final; - + {{#allParams}} {{#isEnum}} {{#allowableValues}} @@ -38,12 +38,12 @@ public: static FString EnumToString(const {{{enumName}}}& EnumValue); static bool EnumFromString(const FString& EnumAsString, {{{enumName}}}& EnumValue); - {{#description}}/* {{{description}}} */ - {{/description}}{{^required}}TOptional<{{/required}}{{{datatypeWithEnum}}}{{^required}}>{{/required}} {{paramName}}{{#required}}{{#defaultValue}} = {{{defaultValue}}}{{/defaultValue}}{{/required}}; + {{#description}}/* {{{.}}} */ + {{/description}}{{^required}}TOptional<{{/required}}{{{datatypeWithEnum}}}{{^required}}>{{/required}} {{paramName}}{{#required}}{{#defaultValue}} = {{{.}}}{{/defaultValue}}{{/required}}; {{/isEnum}} {{^isEnum}} - {{#description}}/* {{{description}}} */ - {{/description}}{{^required}}TOptional<{{/required}}{{{dataType}}}{{^required}}>{{/required}} {{paramName}}{{#required}}{{#defaultValue}} = {{{defaultValue}}}{{/defaultValue}}{{/required}}; + {{#description}}/* {{{.}}} */ + {{/description}}{{^required}}TOptional<{{/required}}{{{dataType}}}{{^required}}>{{/required}} {{paramName}}{{#required}}{{#defaultValue}} = {{{.}}}{{/defaultValue}}{{/required}}; {{/isEnum}} {{/allParams}} }; @@ -56,8 +56,8 @@ public: void SetHttpResponseCode(EHttpResponseCodes::Type InHttpResponseCode) final; {{/responses.0}} bool FromJson(const TSharedPtr& JsonValue) final; - - {{#returnType}}{{{returnType}}} Content;{{/returnType}} + + {{#returnType}}{{{.}}} Content;{{/returnType}} }; {{/operation}} diff --git a/modules/openapi-generator/src/main/resources/cpp-ue4/api-operations-source.mustache b/modules/openapi-generator/src/main/resources/cpp-ue4/api-operations-source.mustache index 4d262483e1f..30ed25d2658 100644 --- a/modules/openapi-generator/src/main/resources/cpp-ue4/api-operations-source.mustache +++ b/modules/openapi-generator/src/main/resources/cpp-ue4/api-operations-source.mustache @@ -10,7 +10,7 @@ #include "PlatformHttp.h" {{#cppNamespaceDeclarations}} -namespace {{this}} +namespace {{this}} { {{/cppNamespaceDeclarations}} {{#operations}}{{#operation}} @@ -28,7 +28,7 @@ inline FString ToString(const {{classname}}::{{operationIdCamelCase}}Request::{{ } {{/allowableValues}} - UE_LOG(Log{{unrealModuleName}}, Error, TEXT("Invalid {{classname}}::{{operationIdCamelCase}}Request::{{{enumName}}} Value (%d)"), (int)Value); + UE_LOG(Log{{unrealModuleName}}, Error, TEXT("Invalid {{classname}}::{{operationIdCamelCase}}Request::{{{enumName}}} Value (%d)"), (int)Value); return TEXT(""); } @@ -46,7 +46,7 @@ inline bool FromString(const FString& EnumAsString, {{classname}}::{{operationId if(Found) Value = *Found; - return Found != nullptr; + return Found != nullptr; } bool {{classname}}::{{operationIdCamelCase}}Request::EnumFromString(const FString& EnumAsString, {{classname}}::{{operationIdCamelCase}}Request::{{{enumName}}}& EnumValue) @@ -89,9 +89,9 @@ FString {{classname}}::{{operationIdCamelCase}}Request::ComputePath() const { TEXT("{{baseName}}"), ToStringFormatArg({{paramName}}) }{{^-last}},{{/-last}}{{/pathParams}} }; FString Path = FString::Format(TEXT("{{{path}}}"), PathParams); - + {{/pathParams.0}} - {{#queryParams.0}} + {{#queryParams.0}} TArray QueryParams; {{#queryParams}} {{#required}} @@ -143,7 +143,7 @@ void {{classname}}::{{operationIdCamelCase}}Request::SetupHttpRequest(const FHtt HttpRequest->SetHeader(TEXT("{{baseName}}"), {{paramName}}.GetValue()); } {{/required}} - {{/headerParams}} + {{/headerParams}} {{/headerParams.0}} // Default to Json Body request @@ -178,7 +178,7 @@ void {{classname}}::{{operationIdCamelCase}}Request::SetupHttpRequest(const FHtt } else if (Consumes.Contains(TEXT("multipart/form-data"))) { - {{#formParams.0}} + {{#formParams.0}} HttpMultipartFormData FormData; {{#formParams}} {{#isContainer}} @@ -227,7 +227,7 @@ void {{classname}}::{{operationIdCamelCase}}Request::SetupHttpRequest(const FHtt } else if (Consumes.Contains(TEXT("application/x-www-form-urlencoded"))) { - {{#formParams.0}} + {{#formParams.0}} TArray FormParams; {{#formParams}} {{#isContainer}} @@ -250,7 +250,7 @@ void {{classname}}::{{operationIdCamelCase}}Request::SetupHttpRequest(const FHtt {{/isContainer}} {{/isFile}} {{/formParams}} - + HttpRequest->SetHeader(TEXT("Content-Type"), TEXT("application/x-www-form-urlencoded; charset=utf-8")); HttpRequest->SetContentAsString(FString::Join(FormParams, TEXT("&"))); {{/formParams.0}} diff --git a/modules/openapi-generator/src/main/resources/cpp-ue4/api-source.mustache b/modules/openapi-generator/src/main/resources/cpp-ue4/api-source.mustache index 2ab5b0db9cd..d2821b2daaa 100644 --- a/modules/openapi-generator/src/main/resources/cpp-ue4/api-source.mustache +++ b/modules/openapi-generator/src/main/resources/cpp-ue4/api-source.mustache @@ -8,11 +8,11 @@ #include "Serialization/JsonSerializer.h" {{#cppNamespaceDeclarations}} -namespace {{this}} +namespace {{this}} { {{/cppNamespaceDeclarations}} -{{classname}}::{{classname}}() +{{classname}}::{{classname}}() : Url(TEXT("{{basePath}}")) { } @@ -139,7 +139,7 @@ FHttpRequestPtr {{classname}}::{{operationIdCamelCase}}(const {{operationIdCamel } Request.SetupHttpRequest(HttpRequest); - + HttpRequest->OnProcessRequestComplete().BindRaw(this, &{{classname}}::On{{operationIdCamelCase}}Response, Delegate); HttpRequest->ProcessRequest(); return HttpRequest; diff --git a/modules/openapi-generator/src/main/resources/cpp-ue4/helpers-header.mustache b/modules/openapi-generator/src/main/resources/cpp-ue4/helpers-header.mustache index cdbf87653d6..c584eadee58 100644 --- a/modules/openapi-generator/src/main/resources/cpp-ue4/helpers-header.mustache +++ b/modules/openapi-generator/src/main/resources/cpp-ue4/helpers-header.mustache @@ -11,7 +11,7 @@ class IHttpRequest; {{#cppNamespaceDeclarations}} -namespace {{this}} +namespace {{this}} { {{/cppNamespaceDeclarations}} diff --git a/modules/openapi-generator/src/main/resources/cpp-ue4/helpers-source.mustache b/modules/openapi-generator/src/main/resources/cpp-ue4/helpers-source.mustache index b2dc14f3578..6c7842d825a 100644 --- a/modules/openapi-generator/src/main/resources/cpp-ue4/helpers-source.mustache +++ b/modules/openapi-generator/src/main/resources/cpp-ue4/helpers-source.mustache @@ -9,7 +9,7 @@ #include "Misc/Paths.h" {{#cppNamespaceDeclarations}} -namespace {{this}} +namespace {{this}} { {{/cppNamespaceDeclarations}} diff --git a/modules/openapi-generator/src/main/resources/cpp-ue4/licenseInfo.mustache b/modules/openapi-generator/src/main/resources/cpp-ue4/licenseInfo.mustache index 147bb985790..b0182eea28a 100644 --- a/modules/openapi-generator/src/main/resources/cpp-ue4/licenseInfo.mustache +++ b/modules/openapi-generator/src/main/resources/cpp-ue4/licenseInfo.mustache @@ -2,8 +2,8 @@ * {{{appName}}} * {{{appDescription}}} * - * {{#version}}OpenAPI spec version: {{{version}}}{{/version}} - * {{#infoEmail}}Contact: {{{infoEmail}}}{{/infoEmail}} + * {{#version}}OpenAPI spec version: {{{.}}}{{/version}} + * {{#infoEmail}}Contact: {{{.}}}{{/infoEmail}} * * NOTE: This class is auto generated by OpenAPI Generator * https://github.com/OpenAPITools/openapi-generator diff --git a/modules/openapi-generator/src/main/resources/cpp-ue4/model-base-header.mustache b/modules/openapi-generator/src/main/resources/cpp-ue4/model-base-header.mustache index 2f5b6255f54..7f083d7e26a 100644 --- a/modules/openapi-generator/src/main/resources/cpp-ue4/model-base-header.mustache +++ b/modules/openapi-generator/src/main/resources/cpp-ue4/model-base-header.mustache @@ -9,7 +9,7 @@ #include "Containers/Ticker.h" {{#cppNamespaceDeclarations}} -namespace {{this}} +namespace {{this}} { {{/cppNamespaceDeclarations}} @@ -41,7 +41,7 @@ struct {{dllapi}} HttpRetryParams }; class {{dllapi}} Model -{ +{ public: virtual ~Model() {} virtual void WriteJson(JsonWriter& Writer) const = 0; diff --git a/modules/openapi-generator/src/main/resources/cpp-ue4/model-base-source.mustache b/modules/openapi-generator/src/main/resources/cpp-ue4/model-base-source.mustache index 57dc4fb4151..1a551ca5315 100644 --- a/modules/openapi-generator/src/main/resources/cpp-ue4/model-base-source.mustache +++ b/modules/openapi-generator/src/main/resources/cpp-ue4/model-base-source.mustache @@ -2,7 +2,7 @@ #include "{{modelNamePrefix}}BaseModel.h" {{#cppNamespaceDeclarations}} -namespace {{this}} +namespace {{this}} { {{/cppNamespaceDeclarations}} @@ -12,10 +12,10 @@ bool HttpRetryManager::Tick(float DeltaTime) return true; } -HttpRetryParams::HttpRetryParams(const FRetryLimitCountSetting& InRetryLimitCountOverride /*= FRetryLimitCountSetting()*/, - const FRetryTimeoutRelativeSecondsSetting& InRetryTimeoutRelativeSecondsOverride /*= FRetryTimeoutRelativeSecondsSetting()*/, - const FRetryResponseCodes& InRetryResponseCodes /*= FRetryResponseCodes()*/, - const FRetryVerbs& InRetryVerbs /*= FRetryVerbs()*/, +HttpRetryParams::HttpRetryParams(const FRetryLimitCountSetting& InRetryLimitCountOverride /*= FRetryLimitCountSetting()*/, + const FRetryTimeoutRelativeSecondsSetting& InRetryTimeoutRelativeSecondsOverride /*= FRetryTimeoutRelativeSecondsSetting()*/, + const FRetryResponseCodes& InRetryResponseCodes /*= FRetryResponseCodes()*/, + const FRetryVerbs& InRetryVerbs /*= FRetryVerbs()*/, const FRetryDomainsPtr& InRetryDomains /*= FRetryDomainsPtr() */) : RetryLimitCountOverride(InRetryLimitCountOverride) , RetryTimeoutRelativeSecondsOverride(InRetryTimeoutRelativeSecondsOverride) diff --git a/modules/openapi-generator/src/main/resources/cpp-ue4/model-header.mustache b/modules/openapi-generator/src/main/resources/cpp-ue4/model-header.mustache index 8742ad7a85f..ee709e587e3 100644 --- a/modules/openapi-generator/src/main/resources/cpp-ue4/model-header.mustache +++ b/modules/openapi-generator/src/main/resources/cpp-ue4/model-header.mustache @@ -6,7 +6,7 @@ {{/imports}} {{#cppNamespaceDeclarations}} -namespace {{this}} +namespace {{this}} { {{/cppNamespaceDeclarations}} {{#models}} @@ -34,14 +34,14 @@ public: {{/enumVars}} }; - Values Value{{#defaultValue}} = {{{defaultValue}}}{{/defaultValue}}; + Values Value{{#defaultValue}} = {{{.}}}{{/defaultValue}}; {{/allowableValues}} static FString EnumToString(const Values& EnumValue); static bool EnumFromString(const FString& EnumAsString, Values& EnumValue); {{/isEnum}} {{^isEnum}} - FString Value{{#defaultValue}} = {{{defaultValue}}}{{/defaultValue}}; + FString Value{{#defaultValue}} = {{{.}}}{{/defaultValue}}; {{/isEnum}} {{/isString}} {{#vars}} @@ -54,15 +54,15 @@ public: {{/enumVars}} }; {{/allowableValues}} - + static FString EnumToString(const {{{enumName}}}& EnumValue); static bool EnumFromString(const FString& EnumAsString, {{{enumName}}}& EnumValue); - {{#description}}/* {{{description}}} */ - {{/description}}{{^required}}TOptional<{{/required}}{{{datatypeWithEnum}}}{{^required}}>{{/required}} {{name}}{{#required}}{{#defaultValue}} = {{{defaultValue}}}{{/defaultValue}}{{/required}}; + {{#description}}/* {{{.}}} */ + {{/description}}{{^required}}TOptional<{{/required}}{{{datatypeWithEnum}}}{{^required}}>{{/required}} {{name}}{{#required}}{{#defaultValue}} = {{{.}}}{{/defaultValue}}{{/required}}; {{/isEnum}} {{^isEnum}} - {{#description}}/* {{{description}}} */ - {{/description}}{{^required}}TOptional<{{/required}}{{{datatype}}}{{^required}}>{{/required}} {{name}}{{#required}}{{#defaultValue}} = {{{defaultValue}}}{{/defaultValue}}{{/required}}; + {{#description}}/* {{{.}}} */ + {{/description}}{{^required}}TOptional<{{/required}}{{{datatype}}}{{^required}}>{{/required}} {{name}}{{#required}}{{#defaultValue}} = {{{.}}}{{/defaultValue}}{{/required}}; {{/isEnum}} {{/vars}} }; diff --git a/modules/openapi-generator/src/main/resources/cpp-ue4/model-source.mustache b/modules/openapi-generator/src/main/resources/cpp-ue4/model-source.mustache index 3022a7a935d..d75b9dfa0d9 100644 --- a/modules/openapi-generator/src/main/resources/cpp-ue4/model-source.mustache +++ b/modules/openapi-generator/src/main/resources/cpp-ue4/model-source.mustache @@ -7,7 +7,7 @@ #include "Templates/SharedPointer.h" {{#cppNamespaceDeclarations}} -namespace {{this}} +namespace {{this}} { {{/cppNamespaceDeclarations}} {{#models}}{{#model}} @@ -24,7 +24,7 @@ inline FString ToString(const {{classname}}::Values& Value) } {{/allowableValues}} - UE_LOG(Log{{unrealModuleName}}, Error, TEXT("Invalid {{classname}}::Values Value (%d)"), (int)Value); + UE_LOG(Log{{unrealModuleName}}, Error, TEXT("Invalid {{classname}}::Values Value (%d)"), (int)Value); return TEXT(""); } @@ -89,7 +89,7 @@ inline FString ToString(const {{classname}}::{{{enumName}}}& Value) } {{/allowableValues}} - UE_LOG(Log{{unrealModuleName}}, Error, TEXT("Invalid {{classname}}::{{{enumName}}} Value (%d)"), (int)Value); + UE_LOG(Log{{unrealModuleName}}, Error, TEXT("Invalid {{classname}}::{{{enumName}}} Value (%d)"), (int)Value); return TEXT(""); } @@ -155,7 +155,7 @@ void {{classname}}::WriteJson(JsonWriter& Writer) const {{^required}} if ({{name}}.IsSet()) { - Writer->WriteIdentifierPrefix(TEXT("{{baseName}}")); WriteJsonValue(Writer, {{name}}.GetValue()); + Writer->WriteIdentifierPrefix(TEXT("{{baseName}}")); WriteJsonValue(Writer, {{name}}.GetValue()); } {{/required}} {{/vars}} diff --git a/modules/openapi-generator/src/main/resources/cpp-ue4/module-source.mustache b/modules/openapi-generator/src/main/resources/cpp-ue4/module-source.mustache index 676633ea0d9..e89bb28ed08 100644 --- a/modules/openapi-generator/src/main/resources/cpp-ue4/module-source.mustache +++ b/modules/openapi-generator/src/main/resources/cpp-ue4/module-source.mustache @@ -11,4 +11,3 @@ void {{unrealModuleName}}Module::StartupModule() void {{unrealModuleName}}Module::ShutdownModule() { } - diff --git a/modules/openapi-generator/src/main/resources/crystal/README.mustache b/modules/openapi-generator/src/main/resources/crystal/README.mustache index 56a8bbf09d8..5a385b6bb45 100644 --- a/modules/openapi-generator/src/main/resources/crystal/README.mustache +++ b/modules/openapi-generator/src/main/resources/crystal/README.mustache @@ -3,7 +3,7 @@ The Crystal module for the {{appName}} {{#appDescriptionWithNewLines}} -{{{appDescriptionWithNewLines}}} +{{{.}}} {{/appDescriptionWithNewLines}} This SDK is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: @@ -27,7 +27,7 @@ Add the following to shard.yaml ```yaml dependencies: {{{shardName}}}: - github: {{#gitUserId}}{{.}}{{/gitUserId}}{{^gitUserId}}YOUR_GIT_USERNAME{{/gitUserId}}/{{#gitRepoId}}{{.}}{{/gitRepoId}}{{^gitRepoId}}YOUR_GIT_REPO{{/gitRepoId}} + github: {{gitUserId}}{{^gitUserId}}YOUR_GIT_USERNAME{{/gitUserId}}/{{gitRepoId}}{{^gitRepoId}}YOUR_GIT_REPO{{/gitRepoId}} version: ~> {{shardVersion}} ``` diff --git a/modules/openapi-generator/src/main/resources/crystal/api.mustache b/modules/openapi-generator/src/main/resources/crystal/api.mustache index 787189be854..81af036027e 100644 --- a/modules/openapi-generator/src/main/resources/crystal/api.mustache +++ b/modules/openapi-generator/src/main/resources/crystal/api.mustache @@ -12,34 +12,34 @@ module {{moduleName}} end {{#operation}} {{#summary}} - # {{{summary}}} + # {{{.}}} {{/summary}} {{#notes}} - # {{{notes}}} + # {{{.}}} {{/notes}} {{#allParams}} {{#required}} # @param {{paramName}} [{{{dataType}}}{{^required}}?{{/required}}] {{description}} {{/required}} {{/allParams}} - # @return [{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}nil{{/returnType}}] + # @return [{{{returnType}}}{{^returnType}}nil{{/returnType}}] def {{operationId}}({{#allParams}}{{paramName}} : {{{dataType}}}{{^required}}?{{/required}}{{^-last}}, {{/-last}}{{/allParams}}) {{#returnType}}data, _status_code, _headers = {{/returnType}}{{operationId}}_with_http_info({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}) {{#returnType}}data{{/returnType}}{{^returnType}}nil{{/returnType}} end {{#summary}} - # {{summary}} + # {{.}} {{/summary}} {{#notes}} - # {{notes}} + # {{.}} {{/notes}} {{#allParams}} {{#required}} # @param {{paramName}} [{{{dataType}}}{{^required}}?{{/required}}] {{description}} {{/required}} {{/allParams}} - # @return [Array<({{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}nil{{/returnType}}, Integer, Hash)>] {{#returnType}}{{{returnType}}} data{{/returnType}}{{^returnType}}nil{{/returnType}}, response status code and response headers + # @return [Array<({{{returnType}}}{{^returnType}}nil{{/returnType}}, Integer, Hash)>] {{#returnType}}{{{.}}} data{{/returnType}}{{^returnType}}nil{{/returnType}}, response status code and response headers def {{operationId}}_with_http_info({{#allParams}}{{paramName}} : {{{dataType}}}{{^required}}?{{/required}}{{^-last}}, {{/-last}}{{/allParams}}) if @api_client.config.debugging Log.debug {"Calling API: {{classname}}.{{operationId}} ..."} diff --git a/modules/openapi-generator/src/main/resources/crystal/api_client.mustache b/modules/openapi-generator/src/main/resources/crystal/api_client.mustache index 9852faa90f9..a22a0b196d9 100644 --- a/modules/openapi-generator/src/main/resources/crystal/api_client.mustache +++ b/modules/openapi-generator/src/main/resources/crystal/api_client.mustache @@ -16,7 +16,7 @@ module {{moduleName}} # Initializes the ApiClient # @option config [Configuration] Configuration for initializing the object, default to Configuration.default def initialize(@config = Configuration.default) - @user_agent = "{{#httpUserAgent}}{{{.}}}{{/httpUserAgent}}{{^httpUserAgent}}OpenAPI-Generator/#{VERSION}/crystal{{/httpUserAgent}}" + @user_agent = "{{{httpUserAgent}}}{{^httpUserAgent}}OpenAPI-Generator/#{VERSION}/crystal{{/httpUserAgent}}" @default_headers = { "User-Agent" => @user_agent } diff --git a/modules/openapi-generator/src/main/resources/crystal/api_doc.mustache b/modules/openapi-generator/src/main/resources/crystal/api_doc.mustache index bdeeb568912..e02ac96a0bd 100644 --- a/modules/openapi-generator/src/main/resources/crystal/api_doc.mustache +++ b/modules/openapi-generator/src/main/resources/crystal/api_doc.mustache @@ -1,6 +1,6 @@ # {{moduleName}}::{{classname}}{{#description}} -{{description}}{{/description}} +{{.}}{{/description}} All URIs are relative to *{{basePath}}* @@ -8,7 +8,7 @@ All URIs are relative to *{{basePath}}* | ------ | ------------ | ----------- | {{#operations}} {{#operation}} -| [**{{operationId}}**]({{classname}}.md#{{operationId}}) | **{{httpMethod}}** {{path}} | {{#summary}}{{summary}}{{/summary}} | +| [**{{operationId}}**]({{classname}}.md#{{operationId}}) | **{{httpMethod}}** {{path}} | {{summary}} | {{/operation}} {{/operations}} @@ -21,7 +21,7 @@ All URIs are relative to *{{basePath}}* {{{summary}}}{{#notes}} -{{{notes}}}{{/notes}} +{{{.}}}{{/notes}} ### Examples @@ -98,7 +98,7 @@ This endpoint does not need any parameter. | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | {{/-first}} -| **{{paramName}}** | {{#isPrimitiveType}}**{{dataType}}**{{/isPrimitiveType}}{{^isPrimitiveType}}{{#isFile}}**{{dataType}}**{{/isFile}}{{^isFile}}[**{{dataType}}**]({{baseType}}.md){{/isFile}}{{/isPrimitiveType}} | {{description}} | {{^required}}[optional]{{/required}}{{#defaultValue}}[default to {{defaultValue}}]{{/defaultValue}} | +| **{{paramName}}** | {{#isPrimitiveType}}**{{dataType}}**{{/isPrimitiveType}}{{^isPrimitiveType}}{{#isFile}}**{{dataType}}**{{/isFile}}{{^isFile}}[**{{dataType}}**]({{baseType}}.md){{/isFile}}{{/isPrimitiveType}} | {{description}} | {{^required}}[optional]{{/required}}{{#defaultValue}}[default to {{.}}]{{/defaultValue}} | {{/allParams}} ### Return type diff --git a/modules/openapi-generator/src/main/resources/crystal/api_info.mustache b/modules/openapi-generator/src/main/resources/crystal/api_info.mustache index 1b3f9cb5ac4..272f72624d5 100644 --- a/modules/openapi-generator/src/main/resources/crystal/api_info.mustache +++ b/modules/openapi-generator/src/main/resources/crystal/api_info.mustache @@ -1,12 +1,12 @@ {{#appName}} -#{{{appName}}} +#{{{.}}} {{/appName}} {{#appDescription}} -#{{{appDescription}}} +#{{{.}}} {{/appDescription}} -{{#version}}The version of the OpenAPI document: {{version}}{{/version}} -{{#infoEmail}}Contact: {{{infoEmail}}}{{/infoEmail}} +{{#version}}The version of the OpenAPI document: {{.}}{{/version}} +{{#infoEmail}}Contact: {{{.}}}{{/infoEmail}} Generated by: https://openapi-generator.tech OpenAPI Generator version: {{{generatorVersion}}} diff --git a/modules/openapi-generator/src/main/resources/crystal/api_test.mustache b/modules/openapi-generator/src/main/resources/crystal/api_test.mustache index f4e0eb49e64..71d88915868 100644 --- a/modules/openapi-generator/src/main/resources/crystal/api_test.mustache +++ b/modules/openapi-generator/src/main/resources/crystal/api_test.mustache @@ -18,15 +18,15 @@ require "time" {{#operation}} # unit tests for {{operationId}} {{#summary}} - # {{summary}} + # {{.}} {{/summary}} {{#notes}} - # {{notes}} + # {{.}} {{/notes}} {{#allParams}}{{#required}} # @param {{paramName}} {{description}} {{/required}}{{/allParams}} # @param [Hash] opts the optional parameters {{#allParams}}{{^required}} # @option opts [{{{dataType}}}] :{{paramName}} {{description}} -{{/required}}{{/allParams}} # @return [{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}nil{{/returnType}}] +{{/required}}{{/allParams}} # @return [{{{returnType}}}{{^returnType}}nil{{/returnType}}] describe "{{operationId}} test" do it "should work" do # assertion here. ref: https://crystal-lang.org/reference/guides/testing.html diff --git a/modules/openapi-generator/src/main/resources/crystal/git_push.sh.mustache b/modules/openapi-generator/src/main/resources/crystal/git_push.sh.mustache index 8b3f689c912..f0bed5bd841 100755 --- a/modules/openapi-generator/src/main/resources/crystal/git_push.sh.mustache +++ b/modules/openapi-generator/src/main/resources/crystal/git_push.sh.mustache @@ -55,4 +55,3 @@ git pull origin master # Pushes (Forces) the changes in the local repository up to the remote repository echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" git push origin master 2>&1 | grep -v 'To https' - diff --git a/modules/openapi-generator/src/main/resources/crystal/partial_model_generic.mustache b/modules/openapi-generator/src/main/resources/crystal/partial_model_generic.mustache index eaf47753fba..3109cec7914 100644 --- a/modules/openapi-generator/src/main/resources/crystal/partial_model_generic.mustache +++ b/modules/openapi-generator/src/main/resources/crystal/partial_model_generic.mustache @@ -1,12 +1,12 @@ {{#description}} - # {{{description}}} + # {{{.}}} {{/description}} class {{classname}}{{#parent}} < {{{.}}}{{/parent}} include JSON::Serializable {{#vars}} {{#description}} - # {{{description}}} + # {{{.}}} {{/description}} @[JSON::Field(key: {{{baseName}}}, type: {{{dataType}}}{{#default}}, default: {{{.}}}{{/default}}{{#isNullable}}, nilable: true, emit_null: true{{/isNullable}})] property {{{name}}} : {{{dataType}}} diff --git a/modules/openapi-generator/src/main/resources/crystal/partial_model_generic_doc.mustache b/modules/openapi-generator/src/main/resources/crystal/partial_model_generic_doc.mustache index f188dd23e6e..95bdb7107c2 100644 --- a/modules/openapi-generator/src/main/resources/crystal/partial_model_generic_doc.mustache +++ b/modules/openapi-generator/src/main/resources/crystal/partial_model_generic_doc.mustache @@ -5,7 +5,7 @@ | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | {{#vars}} -| **{{name}}** | {{#isPrimitiveType}}**{{dataType}}**{{/isPrimitiveType}}{{^isPrimitiveType}}[**{{dataType}}**]({{complexType}}.md){{/isPrimitiveType}} | {{description}} | {{^required}}[optional]{{/required}}{{#isReadOnly}}[readonly]{{/isReadOnly}}{{#defaultValue}}[default to {{defaultValue}}]{{/defaultValue}} | +| **{{name}}** | {{#isPrimitiveType}}**{{dataType}}**{{/isPrimitiveType}}{{^isPrimitiveType}}[**{{dataType}}**]({{complexType}}.md){{/isPrimitiveType}} | {{description}} | {{^required}}[optional]{{/required}}{{#isReadOnly}}[readonly]{{/isReadOnly}}{{#defaultValue}}[default to {{.}}]{{/defaultValue}} | {{/vars}} ## Example diff --git a/modules/openapi-generator/src/main/resources/crystal/partial_oneof_module.mustache b/modules/openapi-generator/src/main/resources/crystal/partial_oneof_module.mustache index 18c0a0cffdb..024071e45a3 100644 --- a/modules/openapi-generator/src/main/resources/crystal/partial_oneof_module.mustache +++ b/modules/openapi-generator/src/main/resources/crystal/partial_oneof_module.mustache @@ -1,5 +1,5 @@ {{#description}} - # {{{description}}} + # {{{.}}} {{/description}} module {{classname}} class << self diff --git a/modules/openapi-generator/src/main/resources/csharp-dotnet2/README.mustache b/modules/openapi-generator/src/main/resources/csharp-dotnet2/README.mustache index 064df8eeafd..16bd2ca86fe 100644 --- a/modules/openapi-generator/src/main/resources/csharp-dotnet2/README.mustache +++ b/modules/openapi-generator/src/main/resources/csharp-dotnet2/README.mustache @@ -1,7 +1,7 @@ # {{packageName}} - the C# library for the {{appName}} {{#appDescriptionWithNewLines}} -{{{appDescriptionWithNewLines}}} +{{{.}}} {{/appDescriptionWithNewLines}} This C# SDK is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: @@ -117,7 +117,7 @@ All URIs are relative to *{{{basePath}}}* Class | Method | HTTP request | Description ------------ | ------------- | ------------- | ------------- -{{#apiInfo}}{{#apis}}{{#operations}}{{#operation}}*{{classname}}* | [**{{operationId}}**]({{apiDocPath}}{{classname}}.md#{{operationIdLowerCase}}) | **{{httpMethod}}** {{path}} | {{#summary}}{{{summary}}}{{/summary}} +{{#apiInfo}}{{#apis}}{{#operations}}{{#operation}}*{{classname}}* | [**{{operationId}}**]({{apiDocPath}}{{classname}}.md#{{operationIdLowerCase}}) | **{{httpMethod}}** {{path}} | {{{summary}}} {{/operation}}{{/operations}}{{/apis}}{{/apiInfo}} diff --git a/modules/openapi-generator/src/main/resources/csharp-dotnet2/api.mustache b/modules/openapi-generator/src/main/resources/csharp-dotnet2/api.mustache index 5990a0fbbd8..40e59a1ffb6 100644 --- a/modules/openapi-generator/src/main/resources/csharp-dotnet2/api.mustache +++ b/modules/openapi-generator/src/main/resources/csharp-dotnet2/api.mustache @@ -18,11 +18,11 @@ namespace {{apiPackage}} /// {{summary}} {{notes}} /// {{#allParams}}/// {{description}}{{#isDeprecated}} (deprecated){{/isDeprecated}} - {{/allParams}}/// {{#returnType}}{{returnType}}{{/returnType}} + {{/allParams}}/// {{returnType}} {{#isDeprecated}} [Obsolete] {{/isDeprecated}} - {{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}void{{/returnType}} {{nickname}} ({{#allParams}}{{{dataType}}} {{paramName}}{{^-last}}, {{/-last}}{{/allParams}}); + {{{returnType}}}{{^returnType}}void{{/returnType}} {{nickname}} ({{#allParams}}{{{dataType}}} {{paramName}}{{^-last}}, {{/-last}}{{/allParams}}); {{/operation}} } @@ -84,11 +84,11 @@ namespace {{apiPackage}} /// {{summary}} {{notes}} /// {{#allParams}}/// {{description}}{{#isDeprecated}} (deprecated){{/isDeprecated}} - {{/allParams}}/// {{#returnType}}{{returnType}}{{/returnType}} + {{/allParams}}/// {{returnType}} {{#isDeprecated}} [Obsolete] {{/isDeprecated}} - public {{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}void{{/returnType}} {{nickname}} ({{#allParams}}{{{dataType}}} {{paramName}}{{^-last}}, {{/-last}}{{/allParams}}) + public {{{returnType}}}{{^returnType}}void{{/returnType}} {{nickname}} ({{#allParams}}{{{dataType}}} {{paramName}}{{^-last}}, {{/-last}}{{/allParams}}) { {{#allParams}}{{#required}} // verify the required parameter '{{paramName}}' is set diff --git a/modules/openapi-generator/src/main/resources/csharp-dotnet2/api_doc.mustache b/modules/openapi-generator/src/main/resources/csharp-dotnet2/api_doc.mustache index 4b1e7d263b9..ea459620cdc 100644 --- a/modules/openapi-generator/src/main/resources/csharp-dotnet2/api_doc.mustache +++ b/modules/openapi-generator/src/main/resources/csharp-dotnet2/api_doc.mustache @@ -1,22 +1,22 @@ # {{apiPackage}}.{{classname}}{{#description}} -{{description}}{{/description}} +{{.}}{{/description}} All URIs are relative to *{{{basePath}}}* Method | HTTP request | Description ------------- | ------------- | ------------- -{{#operations}}{{#operation}}[**{{operationId}}**]({{classname}}.md#{{operationIdLowerCase}}) | **{{httpMethod}}** {{path}} | {{#summary}}{{summary}}{{/summary}} +{{#operations}}{{#operation}}[**{{operationId}}**]({{classname}}.md#{{operationIdLowerCase}}) | **{{httpMethod}}** {{path}} | {{summary}} {{/operation}}{{/operations}} {{#operations}} {{#operation}} # **{{{operationId}}}** -> {{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}void{{/returnType}} {{operationId}} ({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = null{{/optionalMethodArgument}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}) +> {{{returnType}}}{{^returnType}}void{{/returnType}} {{operationId}} ({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = null{{/optionalMethodArgument}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}) {{{summary}}}{{#notes}} -{{{notes}}}{{/notes}} +{{{.}}}{{/notes}} ### Example ```csharp @@ -78,7 +78,7 @@ namespace Example {{#summary}} // {{{.}}} {{/summary}} - {{#returnType}}{{returnType}} result = {{/returnType}}apiInstance.{{{operationId}}}({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}});{{#returnType}} + {{#returnType}}{{.}} result = {{/returnType}}apiInstance.{{{operationId}}}({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}});{{#returnType}} Debug.WriteLine(result);{{/returnType}} } catch (Exception e) @@ -94,7 +94,7 @@ namespace Example {{^allParams}}This endpoint does not need any parameter.{{/allParams}}{{#allParams}}{{#-last}} Name | Type | Description | Notes ------------- | ------------- | ------------- | -------------{{/-last}}{{/allParams}} -{{#allParams}} **{{paramName}}** | {{#isPrimitiveType}}**{{{dataType}}}**{{/isPrimitiveType}}{{^isPrimitiveType}}[**{{{dataType}}}**]({{baseType}}.md){{/isPrimitiveType}}| {{description}} | {{^required}}[optional] {{/required}}{{#defaultValue}}[default to {{defaultValue}}]{{/defaultValue}} +{{#allParams}} **{{paramName}}** | {{#isPrimitiveType}}**{{{dataType}}}**{{/isPrimitiveType}}{{^isPrimitiveType}}[**{{{dataType}}}**]({{baseType}}.md){{/isPrimitiveType}}| {{description}} | {{^required}}[optional] {{/required}}{{#defaultValue}}[default to {{.}}]{{/defaultValue}} {{/allParams}} ### Return type diff --git a/modules/openapi-generator/src/main/resources/csharp-dotnet2/model.mustache b/modules/openapi-generator/src/main/resources/csharp-dotnet2/model.mustache index f9e13ed8f3c..4a642e80e42 100644 --- a/modules/openapi-generator/src/main/resources/csharp-dotnet2/model.mustache +++ b/modules/openapi-generator/src/main/resources/csharp-dotnet2/model.mustache @@ -13,12 +13,12 @@ namespace {{modelPackage}} { /// {{description}} /// [DataContract] - public class {{classname}}{{#parent}} : {{{parent}}}{{/parent}} { + public class {{classname}}{{#parent}} : {{{.}}}{{/parent}} { {{#vars}} /// - /// {{^description}}Gets or Sets {{{name}}}{{/description}}{{#description}}{{{description}}}{{/description}} + /// {{^description}}Gets or Sets {{{name}}}{{/description}}{{{description}}} /// {{#description}} - /// {{{description}}}{{/description}} + /// {{{.}}}{{/description}} [DataMember(Name="{{baseName}}", EmitDefaultValue=false)] [JsonProperty(PropertyName = "{{baseName}}")] {{#deprecated}} diff --git a/modules/openapi-generator/src/main/resources/csharp-nancyfx/Project.mustache b/modules/openapi-generator/src/main/resources/csharp-nancyfx/Project.mustache index 8ff5398633d..0b24e4c020a 100644 --- a/modules/openapi-generator/src/main/resources/csharp-nancyfx/Project.mustache +++ b/modules/openapi-generator/src/main/resources/csharp-nancyfx/Project.mustache @@ -59,7 +59,7 @@ ..\..\packages\{{dependency}}.{{dependencyVersion}}\lib\{{dependencyFramework}}\{{dependency}}.dll True - {{/dependencies}} + {{/dependencies}} @@ -77,4 +77,3 @@ - diff --git a/modules/openapi-generator/src/main/resources/csharp-nancyfx/api.mustache b/modules/openapi-generator/src/main/resources/csharp-nancyfx/api.mustache index eb34a7fd50e..c680c47a114 100644 --- a/modules/openapi-generator/src/main/resources/csharp-nancyfx/api.mustache +++ b/modules/openapi-generator/src/main/resources/csharp-nancyfx/api.mustache @@ -46,11 +46,11 @@ namespace {{packageName}}.{{packageContext}}.Modules /// /// Context of request {{#allParams}}/// {{description}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}}{{#isDeprecated}} (deprecated){{/isDeprecated}} - {{/allParams}}/// {{#returnType}}{{returnType}}{{/returnType}} + {{/allParams}}/// {{returnType}} {{#isDeprecated}} [Obsolete] {{/isDeprecated}} - {{#asyncServer}}{{#returnType}}Task<{{{returnType}}}>{{/returnType}}{{^returnType}}Task{{/returnType}}{{/asyncServer}}{{^asyncServer}}{{#returnType}}{{&returnType}}{{/returnType}}{{^returnType}}void{{/returnType}}{{/asyncServer}} {{operationId}}(NancyContext context{{#allParams.0}}, {{/allParams.0}}{{>paramsList}});{{^-last}} + {{#asyncServer}}{{#returnType}}Task<{{{.}}}>{{/returnType}}{{^returnType}}Task{{/returnType}}{{/asyncServer}}{{^asyncServer}}{{#returnType}}{{&returnType}}{{/returnType}}{{^returnType}}void{{/returnType}}{{/asyncServer}} {{operationId}}(NancyContext context{{#allParams.0}}, {{/allParams.0}}{{>paramsList}});{{^-last}} {{/-last}}{{/operation}} } @@ -61,7 +61,7 @@ namespace {{packageName}}.{{packageContext}}.Modules public abstract class Abstract{{classname}}Service: {{interfacePrefix}}{{classname}}Service { {{#operation}}{{#isDeprecated}}[Obsolete] - {{/isDeprecated}}public virtual {{#asyncServer}}{{#returnType}}Task<{{{returnType}}}>{{/returnType}}{{^returnType}}Task{{/returnType}}{{/asyncServer}}{{^asyncServer}}{{#returnType}}{{&returnType}}{{/returnType}}{{^returnType}}void{{/returnType}}{{/asyncServer}} {{operationId}}(NancyContext context{{#allParams.0}}, {{/allParams.0}}{{>paramsList}}) + {{/isDeprecated}}public virtual {{#asyncServer}}{{#returnType}}Task<{{{.}}}>{{/returnType}}{{^returnType}}Task{{/returnType}}{{/asyncServer}}{{^asyncServer}}{{#returnType}}{{&returnType}}{{/returnType}}{{^returnType}}void{{/returnType}}{{/asyncServer}} {{operationId}}(NancyContext context{{#allParams.0}}, {{/allParams.0}}{{>paramsList}}) { {{^asyncServer}}{{#returnType}}return {{/returnType}}{{/asyncServer}}{{#asyncServer}}return {{/asyncServer}}{{operationId}}({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}); }{{^-last}} @@ -69,7 +69,7 @@ namespace {{packageName}}.{{packageContext}}.Modules {{/-last}}{{/operation}} {{#operation}}{{#isDeprecated}}[Obsolete] - {{/isDeprecated}}protected abstract {{#asyncServer}}{{#returnType}}Task<{{{returnType}}}>{{/returnType}}{{^returnType}}Task{{/returnType}}{{/asyncServer}}{{^asyncServer}}{{#returnType}}{{&returnType}}{{/returnType}}{{^returnType}}void{{/returnType}}{{/asyncServer}} {{operationId}}({{>paramsList}});{{^-last}} + {{/isDeprecated}}protected abstract {{#asyncServer}}{{#returnType}}Task<{{{.}}}>{{/returnType}}{{^returnType}}Task{{/returnType}}{{/asyncServer}}{{^asyncServer}}{{#returnType}}{{&returnType}}{{/returnType}}{{^returnType}}void{{/returnType}}{{/asyncServer}} {{operationId}}({{>paramsList}});{{^-last}} {{/-last}}{{/operation}} } diff --git a/modules/openapi-generator/src/main/resources/csharp-nancyfx/innerApiEnum.mustache b/modules/openapi-generator/src/main/resources/csharp-nancyfx/innerApiEnum.mustache index 586b0e423c7..eb456ababf9 100644 --- a/modules/openapi-generator/src/main/resources/csharp-nancyfx/innerApiEnum.mustache +++ b/modules/openapi-generator/src/main/resources/csharp-nancyfx/innerApiEnum.mustache @@ -1,5 +1,5 @@ /// - /// {{#description}}{{.}}{{/description}}{{^description}}{{classname}}{{/description}} + /// {{description}}{{^description}}{{classname}}{{/description}} /// public enum {{>innerApiEnumName}} { diff --git a/modules/openapi-generator/src/main/resources/csharp-nancyfx/innerModelEnum.mustache b/modules/openapi-generator/src/main/resources/csharp-nancyfx/innerModelEnum.mustache index 19e4731f2cf..3fd8e401dcf 100644 --- a/modules/openapi-generator/src/main/resources/csharp-nancyfx/innerModelEnum.mustache +++ b/modules/openapi-generator/src/main/resources/csharp-nancyfx/innerModelEnum.mustache @@ -1 +1 @@ -public enum {{#datatypeWithEnum}}{{.}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}} { {{#allowableValues}}{{#enumVars}}{{{name}}}{{^-last}}, {{/-last}}{{/enumVars}}{{/allowableValues}} }; \ No newline at end of file +public enum {{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}} { {{#allowableValues}}{{#enumVars}}{{{name}}}{{^-last}}, {{/-last}}{{/enumVars}}{{/allowableValues}} }; \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/csharp-nancyfx/localDateConverter.mustache b/modules/openapi-generator/src/main/resources/csharp-nancyfx/localDateConverter.mustache index f8495d6fadd..d709c22cc1b 100644 --- a/modules/openapi-generator/src/main/resources/csharp-nancyfx/localDateConverter.mustache +++ b/modules/openapi-generator/src/main/resources/csharp-nancyfx/localDateConverter.mustache @@ -8,8 +8,8 @@ using System.Collections.Generic; namespace {{packageName}}.{{packageContext}}.Utils { /// - /// (De)serializes a to a string using - /// the RFC3339 + /// (De)serializes a to a string using + /// the RFC3339 /// full-date format. /// public class LocalDateConverter : JavaScriptPrimitiveConverter, IApplicationStartup diff --git a/modules/openapi-generator/src/main/resources/csharp-nancyfx/modelEnum.mustache b/modules/openapi-generator/src/main/resources/csharp-nancyfx/modelEnum.mustache index 303e4c71c26..01c5ec32aa1 100644 --- a/modules/openapi-generator/src/main/resources/csharp-nancyfx/modelEnum.mustache +++ b/modules/openapi-generator/src/main/resources/csharp-nancyfx/modelEnum.mustache @@ -1,10 +1,10 @@ /// - /// {{^description}}Defines {{{name}}}{{/description}}{{#description}}{{description}}{{/description}} + /// {{description}}{{^description}}Defines {{{name}}}{{/description}} /// {{#description}} - /// {{description}} + /// {{.}} {{/description}} - public enum {{#datatypeWithEnum}}{{.}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}} + public enum {{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}} { {{#allowableValues}}{{#enumVars}} /// diff --git a/modules/openapi-generator/src/main/resources/csharp-nancyfx/modelGeneric.mustache b/modules/openapi-generator/src/main/resources/csharp-nancyfx/modelGeneric.mustache index cb217c51c55..8bb564a7971 100644 --- a/modules/openapi-generator/src/main/resources/csharp-nancyfx/modelGeneric.mustache +++ b/modules/openapi-generator/src/main/resources/csharp-nancyfx/modelGeneric.mustache @@ -1,10 +1,10 @@ /// - /// {{#description}}{{.}}{{/description}}{{^description}}{{classname}}{{/description}} + /// {{description}}{{^description}}{{classname}}{{/description}} /// - public {{^hasChildren}}sealed {{/hasChildren}}class {{classname}}: {{#parent}}{{{parent}}}, {{/parent}} IEquatable<{{classname}}> + public {{^hasChildren}}sealed {{/hasChildren}}class {{classname}}: {{#parent}}{{{.}}}, {{/parent}} IEquatable<{{classname}}> { {{#vars}}{{^isInherited}} /// - /// {{^description}}{{{name}}}{{/description}}{{#description}}{{description}}{{/description}} + /// {{description}}{{^description}}{{{name}}}{{/description}} /// public {{>nullableDataType}} {{name}} { get; private set; } {{/isInherited}}{{/vars}} @@ -118,7 +118,7 @@ /// /// Sets value for {{classname}}.{{{name}}} property. /// - /// {{^description}}{{{name}}}{{/description}}{{#description}}{{description}}{{/description}} + /// {{description}}{{^description}}{{{name}}}{{/description}} public {{classname}}Builder {{name}}({{>nullableDataType}} value) { _{{name}} = value; diff --git a/modules/openapi-generator/src/main/resources/csharp-nancyfx/modelMutable.mustache b/modules/openapi-generator/src/main/resources/csharp-nancyfx/modelMutable.mustache index a9ef6c90bd3..3ab64e3b06e 100644 --- a/modules/openapi-generator/src/main/resources/csharp-nancyfx/modelMutable.mustache +++ b/modules/openapi-generator/src/main/resources/csharp-nancyfx/modelMutable.mustache @@ -15,12 +15,12 @@ namespace {{packageName}}.{{packageContext}}.Models {{#items}}{{>innerModelEnum}}{{/items}}{{/items.isEnum}}{{/vars}} /// - /// {{#description}}{{.}}{{/description}}{{^description}}{{classname}}{{/description}} + /// {{description}}{{^description}}{{classname}}{{/description}} /// - public {{^hasChildren}}sealed {{/hasChildren}}class {{classname}}: {{#parent}}{{{parent}}}, {{/parent}} IEquatable<{{classname}}> + public {{^hasChildren}}sealed {{/hasChildren}}class {{classname}}: {{#parent}}{{{.}}}, {{/parent}} IEquatable<{{classname}}> { {{#vars}}{{^isInherited}} /// - /// {{^description}}{{{name}}}{{/description}}{{#description}}{{description}}{{/description}} + /// {{description}}{{^description}}{{{name}}}{{/description}} /// public {{>nullableDataType}} {{name}} { get; set; } {{/isInherited}}{{/vars}} diff --git a/modules/openapi-generator/src/main/resources/csharp-nancyfx/nuspec.mustache b/modules/openapi-generator/src/main/resources/csharp-nancyfx/nuspec.mustache index 3ef4c7bbe26..65912590d19 100644 --- a/modules/openapi-generator/src/main/resources/csharp-nancyfx/nuspec.mustache +++ b/modules/openapi-generator/src/main/resources/csharp-nancyfx/nuspec.mustache @@ -8,7 +8,7 @@ openapi-generator false NancyFx {{packageName}} API{{#termsOfService}} - {{termsOfService}}{{/termsOfService}}{{#licenseUrl}} - {{licenseUrl}}{{/licenseUrl}} + {{.}}{{/termsOfService}}{{#licenseUrl}} + {{.}}{{/licenseUrl}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/csharp-netcore/Configuration.mustache b/modules/openapi-generator/src/main/resources/csharp-netcore/Configuration.mustache index ead56414441..fe7eeb0b580 100644 --- a/modules/openapi-generator/src/main/resources/csharp-netcore/Configuration.mustache +++ b/modules/openapi-generator/src/main/resources/csharp-netcore/Configuration.mustache @@ -111,7 +111,7 @@ namespace {{packageName}}.Client public Configuration() { Proxy = null; - UserAgent = "{{#httpUserAgent}}{{.}}{{/httpUserAgent}}{{^httpUserAgent}}OpenAPI-Generator/{{packageVersion}}/csharp{{/httpUserAgent}}"; + UserAgent = "{{httpUserAgent}}{{^httpUserAgent}}OpenAPI-Generator/{{packageVersion}}/csharp{{/httpUserAgent}}"; BasePath = "{{{basePath}}}"; DefaultHeaders = new {{^net35}}Concurrent{{/net35}}Dictionary(); ApiKey = new {{^net35}}Concurrent{{/net35}}Dictionary(); diff --git a/modules/openapi-generator/src/main/resources/csharp-netcore/README.mustache b/modules/openapi-generator/src/main/resources/csharp-netcore/README.mustache index b15d2a25bf1..1d1a37e16ae 100644 --- a/modules/openapi-generator/src/main/resources/csharp-netcore/README.mustache +++ b/modules/openapi-generator/src/main/resources/csharp-netcore/README.mustache @@ -1,7 +1,7 @@ # {{packageName}} - the C# library for the {{appName}} {{#appDescriptionWithNewLines}} -{{{appDescriptionWithNewLines}}} +{{{.}}} {{/appDescriptionWithNewLines}} This C# SDK is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: @@ -114,7 +114,7 @@ HttpClient yourHttpClient = new HttpClient(yourHandler); var api = new YourApiClass(yourHttpClient, yourHandler); ``` -If you want to use an HttpClient and don't have access to the handler, for example in a DI context in Asp.net Core when using IHttpClientFactory. +If you want to use an HttpClient and don't have access to the handler, for example in a DI context in Asp.net Core when using IHttpClientFactory. ```csharp HttpClient yourHttpClient = new HttpClient(); @@ -125,7 +125,7 @@ You'll loose some configuration settings, the features affected are: Setting and Here an example of DI setup in a sample web project: ```csharp -services.AddHttpClient(httpClient => +services.AddHttpClient(httpClient => new PetApi(httpClient)); ``` @@ -200,7 +200,7 @@ namespace Example {{#summary}} // {{{.}}} {{/summary}} - {{#returnType}}{{{returnType}}} result = {{/returnType}}apiInstance.{{{operationId}}}({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}});{{#returnType}} + {{#returnType}}{{{.}}} result = {{/returnType}}apiInstance.{{{operationId}}}({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}});{{#returnType}} Debug.WriteLine(result);{{/returnType}} } catch (ApiException e) @@ -222,7 +222,7 @@ All URIs are relative to *{{{basePath}}}* Class | Method | HTTP request | Description ------------ | ------------- | ------------- | ------------- -{{#apiInfo}}{{#apis}}{{#operations}}{{#operation}}*{{classname}}* | [**{{operationId}}**]({{apiDocPath}}{{classname}}.md#{{operationIdLowerCase}}) | **{{httpMethod}}** {{path}} | {{#summary}}{{{summary}}}{{/summary}} +{{#apiInfo}}{{#apis}}{{#operations}}{{#operation}}*{{classname}}* | [**{{operationId}}**]({{apiDocPath}}{{classname}}.md#{{operationIdLowerCase}}) | **{{httpMethod}}** {{path}} | {{{summary}}} {{/operation}}{{/operations}}{{/apis}}{{/apiInfo}} diff --git a/modules/openapi-generator/src/main/resources/csharp-netcore/TestProject.mustache b/modules/openapi-generator/src/main/resources/csharp-netcore/TestProject.mustache index b1a50ae778e..57e1455087f 100644 --- a/modules/openapi-generator/src/main/resources/csharp-netcore/TestProject.mustache +++ b/modules/openapi-generator/src/main/resources/csharp-netcore/TestProject.mustache @@ -1,15 +1,15 @@ @@ -33,4 +33,3 @@ - diff --git a/modules/openapi-generator/src/main/resources/csharp-netcore/api.mustache b/modules/openapi-generator/src/main/resources/csharp-netcore/api.mustache index bb4894411bc..237a14f92b7 100644 --- a/modules/openapi-generator/src/main/resources/csharp-netcore/api.mustache +++ b/modules/openapi-generator/src/main/resources/csharp-netcore/api.mustache @@ -26,16 +26,16 @@ namespace {{packageName}}.{{apiPackage}} /// {{#notes}} /// - /// {{notes}} + /// {{.}} /// {{/notes}} /// Thrown when fails to make API call {{#allParams}}/// {{description}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}}{{#isDeprecated}} (deprecated){{/isDeprecated}} - {{/allParams}}/// {{#returnType}}{{returnType}}{{/returnType}} + {{/allParams}}/// {{returnType}} {{#isDeprecated}} [Obsolete] {{/isDeprecated}} - {{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}void{{/returnType}} {{operationId}}({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = default({{{dataType}}}){{/optionalMethodArgument}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}); + {{{returnType}}}{{^returnType}}void{{/returnType}} {{operationId}}({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = default({{{dataType}}}){{/optionalMethodArgument}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}); /// /// {{summary}} @@ -45,11 +45,11 @@ namespace {{packageName}}.{{apiPackage}} /// /// Thrown when fails to make API call {{#allParams}}/// {{description}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}}{{#isDeprecated}} (deprecated){{/isDeprecated}} - {{/allParams}}/// ApiResponse of {{#returnType}}{{returnType}}{{/returnType}}{{^returnType}}Object(void){{/returnType}} + {{/allParams}}/// ApiResponse of {{returnType}}{{^returnType}}Object(void){{/returnType}} {{#isDeprecated}} [Obsolete] {{/isDeprecated}} - ApiResponse<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}Object{{/returnType}}> {{operationId}}WithHttpInfo({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = default({{{dataType}}}){{/optionalMethodArgument}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}); + ApiResponse<{{{returnType}}}{{^returnType}}Object{{/returnType}}> {{operationId}}WithHttpInfo({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = default({{{dataType}}}){{/optionalMethodArgument}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}); {{/operation}} #endregion Synchronous Operations } @@ -73,11 +73,11 @@ namespace {{packageName}}.{{apiPackage}} /// {{description}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}}{{#isDeprecated}} (deprecated){{/isDeprecated}} {{/allParams}} /// Cancellation Token to cancel the request. - /// Task of {{#returnType}}{{returnType}}{{/returnType}}{{^returnType}}void{{/returnType}} + /// Task of {{returnType}}{{^returnType}}void{{/returnType}} {{#isDeprecated}} [Obsolete] {{/isDeprecated}} - {{#returnType}}System.Threading.Tasks.Task<{{{returnType}}}>{{/returnType}}{{^returnType}}System.Threading.Tasks.Task{{/returnType}} {{operationId}}Async({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = default({{{dataType}}}){{/optionalMethodArgument}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}{{#allParams.0}}, {{/allParams.0}}System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + {{#returnType}}System.Threading.Tasks.Task<{{{.}}}>{{/returnType}}{{^returnType}}System.Threading.Tasks.Task{{/returnType}} {{operationId}}Async({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = default({{{dataType}}}){{/optionalMethodArgument}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}{{#allParams.0}}, {{/allParams.0}}System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// {{summary}} @@ -90,11 +90,11 @@ namespace {{packageName}}.{{apiPackage}} /// {{description}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}}{{#isDeprecated}} (deprecated){{/isDeprecated}} {{/allParams}} /// Cancellation Token to cancel the request. - /// Task of ApiResponse{{#returnType}} ({{returnType}}){{/returnType}} + /// Task of ApiResponse{{#returnType}} ({{.}}){{/returnType}} {{#isDeprecated}} [Obsolete] {{/isDeprecated}} - System.Threading.Tasks.Task> {{operationId}}WithHttpInfoAsync({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = default({{{dataType}}}){{/optionalMethodArgument}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}{{#allParams.0}}, {{/allParams.0}}System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> {{operationId}}WithHttpInfoAsync({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = default({{{dataType}}}){{/optionalMethodArgument}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}{{#allParams.0}}, {{/allParams.0}}System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); {{/operation}} #endregion Asynchronous Operations } @@ -233,11 +233,11 @@ namespace {{packageName}}.{{apiPackage}} /// /// Thrown when fails to make API call {{#allParams}}/// {{description}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}}{{#isDeprecated}} (deprecated){{/isDeprecated}} - {{/allParams}}/// {{#returnType}}{{returnType}}{{/returnType}} + {{/allParams}}/// {{returnType}} {{#isDeprecated}} [Obsolete] {{/isDeprecated}} - public {{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}void{{/returnType}} {{operationId}}({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = default({{{dataType}}}){{/optionalMethodArgument}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}) + public {{{returnType}}}{{^returnType}}void{{/returnType}} {{operationId}}({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = default({{{dataType}}}){{/optionalMethodArgument}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}) { {{#returnType}}{{packageName}}.Client.ApiResponse<{{{returnType}}}> localVarResponse = {{operationId}}WithHttpInfo({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}); return localVarResponse.Data;{{/returnType}}{{^returnType}}{{operationId}}WithHttpInfo({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}});{{/returnType}} @@ -248,11 +248,11 @@ namespace {{packageName}}.{{apiPackage}} /// /// Thrown when fails to make API call {{#allParams}}/// {{description}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}}{{#isDeprecated}} (deprecated){{/isDeprecated}} - {{/allParams}}/// ApiResponse of {{#returnType}}{{returnType}}{{/returnType}}{{^returnType}}Object(void){{/returnType}} + {{/allParams}}/// ApiResponse of {{returnType}}{{^returnType}}Object(void){{/returnType}} {{#isDeprecated}} [Obsolete] {{/isDeprecated}} - public {{packageName}}.Client.ApiResponse<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}Object{{/returnType}}> {{operationId}}WithHttpInfo({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = default({{{dataType}}}){{/optionalMethodArgument}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}) + public {{packageName}}.Client.ApiResponse<{{{returnType}}}{{^returnType}}Object{{/returnType}}> {{operationId}}WithHttpInfo({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = default({{{dataType}}}){{/optionalMethodArgument}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}) { {{#allParams}} {{#required}} @@ -300,14 +300,14 @@ namespace {{packageName}}.{{apiPackage}} {{#required}} {{#isDeepObject}} {{#items.vars}} - localVarRequestOptions.QueryParameters.Add({{packageName}}.Client.ClientUtils.ParameterToMultiMap("{{#collectionFormat}}{{collectionFormat}}{{/collectionFormat}}", "{{baseName}}", {{paramName}}.{{name}})); + localVarRequestOptions.QueryParameters.Add({{packageName}}.Client.ClientUtils.ParameterToMultiMap("{{collectionFormat}}", "{{baseName}}", {{paramName}}.{{name}})); {{/items.vars}} {{^items}} localVarRequestOptions.QueryParameters.Add({{packageName}}.Client.ClientUtils.ParameterToMultiMap("deepObject", "{{baseName}}", {{paramName}})); {{/items}} {{/isDeepObject}} {{^isDeepObject}} - localVarRequestOptions.QueryParameters.Add({{packageName}}.Client.ClientUtils.ParameterToMultiMap("{{#collectionFormat}}{{collectionFormat}}{{/collectionFormat}}", "{{baseName}}", {{paramName}})); + localVarRequestOptions.QueryParameters.Add({{packageName}}.Client.ClientUtils.ParameterToMultiMap("{{collectionFormat}}", "{{baseName}}", {{paramName}})); {{/isDeepObject}} {{/required}} {{^required}} @@ -317,7 +317,7 @@ namespace {{packageName}}.{{apiPackage}} {{#items.vars}} if ({{paramName}}.{{name}} != null) { - localVarRequestOptions.QueryParameters.Add({{packageName}}.Client.ClientUtils.ParameterToMultiMap("{{#collectionFormat}}{{collectionFormat}}{{/collectionFormat}}", "{{baseName}}", {{paramName}}.{{name}})); + localVarRequestOptions.QueryParameters.Add({{packageName}}.Client.ClientUtils.ParameterToMultiMap("{{collectionFormat}}", "{{baseName}}", {{paramName}}.{{name}})); } {{/items.vars}} {{^items}} @@ -325,7 +325,7 @@ namespace {{packageName}}.{{apiPackage}} {{/items}} {{/isDeepObject}} {{^isDeepObject}} - localVarRequestOptions.QueryParameters.Add({{packageName}}.Client.ClientUtils.ParameterToMultiMap("{{#collectionFormat}}{{collectionFormat}}{{/collectionFormat}}", "{{baseName}}", {{paramName}})); + localVarRequestOptions.QueryParameters.Add({{packageName}}.Client.ClientUtils.ParameterToMultiMap("{{collectionFormat}}", "{{baseName}}", {{paramName}})); {{/isDeepObject}} } {{/required}} @@ -430,7 +430,7 @@ namespace {{packageName}}.{{apiPackage}} {{/authMethods}} // make the HTTP request - var localVarResponse = this.Client.{{#lambda.titlecase}}{{#lambda.lowercase}}{{httpMethod}}{{/lambda.lowercase}}{{/lambda.titlecase}}<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}Object{{/returnType}}>("{{{path}}}", localVarRequestOptions, this.Configuration); + var localVarResponse = this.Client.{{#lambda.titlecase}}{{#lambda.lowercase}}{{httpMethod}}{{/lambda.lowercase}}{{/lambda.titlecase}}<{{{returnType}}}{{^returnType}}Object{{/returnType}}>("{{{path}}}", localVarRequestOptions, this.Configuration); if (this.ExceptionFactory != null) { @@ -450,11 +450,11 @@ namespace {{packageName}}.{{apiPackage}} /// {{description}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}}{{#isDeprecated}} (deprecated){{/isDeprecated}} {{/allParams}} /// Cancellation Token to cancel the request. - /// Task of {{#returnType}}{{returnType}}{{/returnType}}{{^returnType}}void{{/returnType}} + /// Task of {{returnType}}{{^returnType}}void{{/returnType}} {{#isDeprecated}} [Obsolete] {{/isDeprecated}} - {{#returnType}}public async System.Threading.Tasks.Task<{{{returnType}}}>{{/returnType}}{{^returnType}}public async System.Threading.Tasks.Task{{/returnType}} {{operationId}}Async({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = default({{{dataType}}}){{/optionalMethodArgument}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}{{#allParams.0}}, {{/allParams.0}}System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + {{#returnType}}public async System.Threading.Tasks.Task<{{{.}}}>{{/returnType}}{{^returnType}}public async System.Threading.Tasks.Task{{/returnType}} {{operationId}}Async({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = default({{{dataType}}}){{/optionalMethodArgument}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}{{#allParams.0}}, {{/allParams.0}}System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { {{#returnType}}{{packageName}}.Client.ApiResponse<{{{returnType}}}> localVarResponse = await {{operationId}}WithHttpInfoAsync({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}{{#allParams.0}}, {{/allParams.0}}cancellationToken).ConfigureAwait(false); return localVarResponse.Data;{{/returnType}}{{^returnType}}await {{operationId}}WithHttpInfoAsync({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}{{#allParams.0}}, {{/allParams.0}}cancellationToken).ConfigureAwait(false);{{/returnType}} @@ -468,11 +468,11 @@ namespace {{packageName}}.{{apiPackage}} /// {{description}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}}{{#isDeprecated}} (deprecated){{/isDeprecated}} {{/allParams}} /// Cancellation Token to cancel the request. - /// Task of ApiResponse{{#returnType}} ({{returnType}}){{/returnType}} + /// Task of ApiResponse{{#returnType}} ({{.}}){{/returnType}} {{#isDeprecated}} [Obsolete] {{/isDeprecated}} - public async System.Threading.Tasks.Task<{{packageName}}.Client.ApiResponse<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}Object{{/returnType}}>> {{operationId}}WithHttpInfoAsync({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = default({{{dataType}}}){{/optionalMethodArgument}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}{{#allParams.0}}, {{/allParams.0}}System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task<{{packageName}}.Client.ApiResponse<{{{returnType}}}{{^returnType}}Object{{/returnType}}>> {{operationId}}WithHttpInfoAsync({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = default({{{dataType}}}){{/optionalMethodArgument}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}{{#allParams.0}}, {{/allParams.0}}System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { {{#allParams}} {{#required}} @@ -520,12 +520,12 @@ namespace {{packageName}}.{{apiPackage}} {{/pathParams}} {{#queryParams}} {{#required}} - localVarRequestOptions.QueryParameters.Add({{packageName}}.Client.ClientUtils.ParameterToMultiMap("{{#collectionFormat}}{{collectionFormat}}{{/collectionFormat}}", "{{baseName}}", {{paramName}})); + localVarRequestOptions.QueryParameters.Add({{packageName}}.Client.ClientUtils.ParameterToMultiMap("{{collectionFormat}}", "{{baseName}}", {{paramName}})); {{/required}} {{^required}} if ({{paramName}} != null) { - localVarRequestOptions.QueryParameters.Add({{packageName}}.Client.ClientUtils.ParameterToMultiMap("{{#collectionFormat}}{{collectionFormat}}{{/collectionFormat}}", "{{baseName}}", {{paramName}})); + localVarRequestOptions.QueryParameters.Add({{packageName}}.Client.ClientUtils.ParameterToMultiMap("{{collectionFormat}}", "{{baseName}}", {{paramName}})); } {{/required}} {{/queryParams}} @@ -632,7 +632,7 @@ namespace {{packageName}}.{{apiPackage}} // make the HTTP request - var localVarResponse = await this.AsynchronousClient.{{#lambda.titlecase}}{{#lambda.lowercase}}{{httpMethod}}{{/lambda.lowercase}}{{/lambda.titlecase}}Async<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}Object{{/returnType}}>("{{{path}}}", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + var localVarResponse = await this.AsynchronousClient.{{#lambda.titlecase}}{{#lambda.lowercase}}{{httpMethod}}{{/lambda.lowercase}}{{/lambda.titlecase}}Async<{{{returnType}}}{{^returnType}}Object{{/returnType}}>("{{{path}}}", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); if (this.ExceptionFactory != null) { diff --git a/modules/openapi-generator/src/main/resources/csharp-netcore/api_doc.mustache b/modules/openapi-generator/src/main/resources/csharp-netcore/api_doc.mustache index d12ee22ea38..1286829ad40 100644 --- a/modules/openapi-generator/src/main/resources/csharp-netcore/api_doc.mustache +++ b/modules/openapi-generator/src/main/resources/csharp-netcore/api_doc.mustache @@ -1,22 +1,22 @@ # {{packageName}}.{{apiPackage}}.{{classname}}{{#description}} -{{description}}{{/description}} +{{.}}{{/description}} All URIs are relative to *{{{basePath}}}* Method | HTTP request | Description ------------- | ------------- | ------------- -{{#operations}}{{#operation}}[**{{operationId}}**]({{classname}}.md#{{operationIdLowerCase}}) | **{{httpMethod}}** {{path}} | {{#summary}}{{summary}}{{/summary}} +{{#operations}}{{#operation}}[**{{operationId}}**]({{classname}}.md#{{operationIdLowerCase}}) | **{{httpMethod}}** {{path}} | {{summary}} {{/operation}}{{/operations}} {{#operations}} {{#operation}} # **{{{operationId}}}** -> {{#returnType}}{{returnType}}{{/returnType}}{{^returnType}}void{{/returnType}} {{operationId}} ({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = null{{/optionalMethodArgument}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}) +> {{returnType}}{{^returnType}}void{{/returnType}} {{operationId}} ({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = null{{/optionalMethodArgument}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}) {{{summary}}}{{#notes}} -{{{notes}}}{{/notes}} +{{{.}}}{{/notes}} ### Example ```csharp @@ -84,7 +84,7 @@ namespace Example {{#summary}} // {{{.}}} {{/summary}} - {{#returnType}}{{{returnType}}} result = {{/returnType}}apiInstance.{{{operationId}}}({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}});{{#returnType}} + {{#returnType}}{{{.}}} result = {{/returnType}}apiInstance.{{{operationId}}}({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}});{{#returnType}} Debug.WriteLine(result);{{/returnType}} } catch (ApiException e) @@ -102,7 +102,7 @@ namespace Example {{^allParams}}This endpoint does not need any parameter.{{/allParams}}{{#allParams}}{{#-last}} Name | Type | Description | Notes ------------- | ------------- | ------------- | -------------{{/-last}}{{/allParams}} -{{#allParams}} **{{paramName}}** | {{#isFile}}**{{dataType}}**{{/isFile}}{{#isPrimitiveType}}**{{dataType}}**{{/isPrimitiveType}}{{^isPrimitiveType}}{{^isFile}}[**{{dataType}}**]({{#isContainer}}{{baseType}}{{/isContainer}}{{^isContainer}}{{dataType}}{{/isContainer}}.md){{/isFile}}{{/isPrimitiveType}}| {{description}} | {{^required}}[optional] {{/required}}{{#defaultValue}}[default to {{defaultValue}}]{{/defaultValue}} +{{#allParams}} **{{paramName}}** | {{#isFile}}**{{dataType}}**{{/isFile}}{{#isPrimitiveType}}**{{dataType}}**{{/isPrimitiveType}}{{^isPrimitiveType}}{{^isFile}}[**{{dataType}}**]({{#isContainer}}{{baseType}}{{/isContainer}}{{^isContainer}}{{dataType}}{{/isContainer}}.md){{/isFile}}{{/isPrimitiveType}}| {{description}} | {{^required}}[optional] {{/required}}{{#defaultValue}}[default to {{.}}]{{/defaultValue}} {{/allParams}} ### Return type diff --git a/modules/openapi-generator/src/main/resources/csharp-netcore/api_test.mustache b/modules/openapi-generator/src/main/resources/csharp-netcore/api_test.mustache index 02ca26b5f16..3f2f1de5bb3 100644 --- a/modules/openapi-generator/src/main/resources/csharp-netcore/api_test.mustache +++ b/modules/openapi-generator/src/main/resources/csharp-netcore/api_test.mustache @@ -64,7 +64,7 @@ namespace {{packageName}}.Test.Api {{/allParams}} //{{#returnType}}var response = {{/returnType}}instance.{{operationId}}({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}); {{#returnType}} - //Assert.IsType<{{{returnType}}}>(response); + //Assert.IsType<{{{.}}}>(response); {{/returnType}} } {{/operation}} diff --git a/modules/openapi-generator/src/main/resources/csharp-netcore/git_push.sh.mustache b/modules/openapi-generator/src/main/resources/csharp-netcore/git_push.sh.mustache index 8b3f689c912..f0bed5bd841 100644 --- a/modules/openapi-generator/src/main/resources/csharp-netcore/git_push.sh.mustache +++ b/modules/openapi-generator/src/main/resources/csharp-netcore/git_push.sh.mustache @@ -55,4 +55,3 @@ git pull origin master # Pushes (Forces) the changes in the local repository up to the remote repository echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" git push origin master 2>&1 | grep -v 'To https' - diff --git a/modules/openapi-generator/src/main/resources/csharp-netcore/libraries/httpclient/ApiClient.mustache b/modules/openapi-generator/src/main/resources/csharp-netcore/libraries/httpclient/ApiClient.mustache index 027fc537743..fcc73e2ff8e 100644 --- a/modules/openapi-generator/src/main/resources/csharp-netcore/libraries/httpclient/ApiClient.mustache +++ b/modules/openapi-generator/src/main/resources/csharp-netcore/libraries/httpclient/ApiClient.mustache @@ -169,7 +169,7 @@ namespace {{packageName}}.Client private readonly string _baseUrl; private readonly HttpClientHandler _httpClientHandler; - private readonly HttpClient _httpClient; + private readonly HttpClient _httpClient; private readonly bool _disposeClient; /// @@ -196,9 +196,9 @@ namespace {{packageName}}.Client /// public ApiClient() : this({{packageName}}.Client.GlobalConfiguration.Instance.BasePath) - { + { } - + /// /// Initializes a new instance of the . /// **IMPORTANT** This will also create an istance of HttpClient, which is less than ideal. @@ -207,7 +207,7 @@ namespace {{packageName}}.Client /// The target service's base path in URL format. /// public ApiClient(string basePath) - { + { if (string.IsNullOrEmpty(basePath)) throw new ArgumentException("basePath cannot be empty"); _httpClientHandler = new HttpClientHandler(); @@ -215,7 +215,7 @@ namespace {{packageName}}.Client _disposeClient = true; _baseUrl = basePath; } - + /// /// Initializes a new instance of the , defaulting to the global configurations' base url. /// @@ -228,9 +228,9 @@ namespace {{packageName}}.Client /// public ApiClient(HttpClient client, HttpClientHandler handler = null) : this(client, {{packageName}}.Client.GlobalConfiguration.Instance.BasePath, handler) - { + { } - + /// /// Initializes a new instance of the . /// @@ -244,10 +244,10 @@ namespace {{packageName}}.Client /// The features affected are: Setting and Retrieving Cookies, Client Certificates, Proxy settings. /// public ApiClient(HttpClient client, string basePath, HttpClientHandler handler = null) - { + { if (client == null) throw new ArgumentNullException("client cannot be null"); if (string.IsNullOrEmpty(basePath)) throw new ArgumentException("basePath cannot be empty"); - + _httpClientHandler = handler; _httpClient = client; _baseUrl = basePath; @@ -509,7 +509,7 @@ namespace {{packageName}}.Client { return await ToApiResponse(response, default(T), req.RequestUri); } - + object responseData = await deserializer.Deserialize(response); // if the response type is oneOf/anyOf, call FromJSON to deserialize the data diff --git a/modules/openapi-generator/src/main/resources/csharp-netcore/libraries/httpclient/api.mustache b/modules/openapi-generator/src/main/resources/csharp-netcore/libraries/httpclient/api.mustache index bf3e4377995..7f85a719ddf 100644 --- a/modules/openapi-generator/src/main/resources/csharp-netcore/libraries/httpclient/api.mustache +++ b/modules/openapi-generator/src/main/resources/csharp-netcore/libraries/httpclient/api.mustache @@ -27,16 +27,16 @@ namespace {{packageName}}.{{apiPackage}} /// {{#notes}} /// - /// {{notes}} + /// {{.}} /// {{/notes}} /// Thrown when fails to make API call {{#allParams}}/// {{description}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}}{{#isDeprecated}} (deprecated){{/isDeprecated}} - {{/allParams}}/// {{#returnType}}{{returnType}}{{/returnType}} + {{/allParams}}/// {{returnType}} {{#isDeprecated}} [Obsolete] {{/isDeprecated}} - {{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}void{{/returnType}} {{operationId}}({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = default({{{dataType}}}){{/optionalMethodArgument}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}); + {{{returnType}}}{{^returnType}}void{{/returnType}} {{operationId}}({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = default({{{dataType}}}){{/optionalMethodArgument}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}); /// /// {{summary}} @@ -46,11 +46,11 @@ namespace {{packageName}}.{{apiPackage}} /// /// Thrown when fails to make API call {{#allParams}}/// {{description}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}}{{#isDeprecated}} (deprecated){{/isDeprecated}} - {{/allParams}}/// ApiResponse of {{#returnType}}{{returnType}}{{/returnType}}{{^returnType}}Object(void){{/returnType}} + {{/allParams}}/// ApiResponse of {{returnType}}{{^returnType}}Object(void){{/returnType}} {{#isDeprecated}} [Obsolete] {{/isDeprecated}} - ApiResponse<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}Object{{/returnType}}> {{operationId}}WithHttpInfo({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = default({{{dataType}}}){{/optionalMethodArgument}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}); + ApiResponse<{{{returnType}}}{{^returnType}}Object{{/returnType}}> {{operationId}}WithHttpInfo({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = default({{{dataType}}}){{/optionalMethodArgument}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}); {{/operation}} #endregion Synchronous Operations } @@ -74,11 +74,11 @@ namespace {{packageName}}.{{apiPackage}} /// {{description}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}}{{#isDeprecated}} (deprecated){{/isDeprecated}} {{/allParams}} /// Cancellation Token to cancel the request. - /// Task of {{#returnType}}{{returnType}}{{/returnType}}{{^returnType}}void{{/returnType}} + /// Task of {{returnType}}{{^returnType}}void{{/returnType}} {{#isDeprecated}} [Obsolete] {{/isDeprecated}} - {{#returnType}}System.Threading.Tasks.Task<{{{returnType}}}>{{/returnType}}{{^returnType}}System.Threading.Tasks.Task{{/returnType}} {{operationId}}Async({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = default({{{dataType}}}){{/optionalMethodArgument}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}{{#allParams.0}}, {{/allParams.0}}System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + {{#returnType}}System.Threading.Tasks.Task<{{{.}}}>{{/returnType}}{{^returnType}}System.Threading.Tasks.Task{{/returnType}} {{operationId}}Async({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = default({{{dataType}}}){{/optionalMethodArgument}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}{{#allParams.0}}, {{/allParams.0}}System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// {{summary}} @@ -91,11 +91,11 @@ namespace {{packageName}}.{{apiPackage}} /// {{description}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}}{{#isDeprecated}} (deprecated){{/isDeprecated}} {{/allParams}} /// Cancellation Token to cancel the request. - /// Task of ApiResponse{{#returnType}} ({{returnType}}){{/returnType}} + /// Task of ApiResponse{{#returnType}} ({{.}}){{/returnType}} {{#isDeprecated}} [Obsolete] {{/isDeprecated}} - System.Threading.Tasks.Task> {{operationId}}WithHttpInfoAsync({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = default({{{dataType}}}){{/optionalMethodArgument}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}{{#allParams.0}}, {{/allParams.0}}System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> {{operationId}}WithHttpInfoAsync({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = default({{{dataType}}}){{/optionalMethodArgument}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}{{#allParams.0}}, {{/allParams.0}}System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); {{/operation}} #endregion Asynchronous Operations } @@ -331,11 +331,11 @@ namespace {{packageName}}.{{apiPackage}} /// /// Thrown when fails to make API call {{#allParams}}/// {{description}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}}{{#isDeprecated}} (deprecated){{/isDeprecated}} - {{/allParams}}/// {{#returnType}}{{returnType}}{{/returnType}} + {{/allParams}}/// {{returnType}} {{#isDeprecated}} [Obsolete] {{/isDeprecated}} - public {{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}void{{/returnType}} {{operationId}}({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = default({{{dataType}}}){{/optionalMethodArgument}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}) + public {{{returnType}}}{{^returnType}}void{{/returnType}} {{operationId}}({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = default({{{dataType}}}){{/optionalMethodArgument}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}) { {{#returnType}}{{packageName}}.Client.ApiResponse<{{{returnType}}}> localVarResponse = {{operationId}}WithHttpInfo({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}); return localVarResponse.Data;{{/returnType}}{{^returnType}}{{operationId}}WithHttpInfo({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}});{{/returnType}} @@ -346,11 +346,11 @@ namespace {{packageName}}.{{apiPackage}} /// /// Thrown when fails to make API call {{#allParams}}/// {{description}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}}{{#isDeprecated}} (deprecated){{/isDeprecated}} - {{/allParams}}/// ApiResponse of {{#returnType}}{{returnType}}{{/returnType}}{{^returnType}}Object(void){{/returnType}} + {{/allParams}}/// ApiResponse of {{returnType}}{{^returnType}}Object(void){{/returnType}} {{#isDeprecated}} [Obsolete] {{/isDeprecated}} - public {{packageName}}.Client.ApiResponse<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}Object{{/returnType}}> {{operationId}}WithHttpInfo({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = default({{{dataType}}}){{/optionalMethodArgument}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}) + public {{packageName}}.Client.ApiResponse<{{{returnType}}}{{^returnType}}Object{{/returnType}}> {{operationId}}WithHttpInfo({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = default({{{dataType}}}){{/optionalMethodArgument}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}) { {{#allParams}} {{#required}} @@ -398,14 +398,14 @@ namespace {{packageName}}.{{apiPackage}} {{#required}} {{#isDeepObject}} {{#items.vars}} - localVarRequestOptions.QueryParameters.Add({{packageName}}.Client.ClientUtils.ParameterToMultiMap("{{#collectionFormat}}{{collectionFormat}}{{/collectionFormat}}", "{{baseName}}", {{paramName}}.{{name}})); + localVarRequestOptions.QueryParameters.Add({{packageName}}.Client.ClientUtils.ParameterToMultiMap("{{collectionFormat}}", "{{baseName}}", {{paramName}}.{{name}})); {{/items.vars}} {{^items}} localVarRequestOptions.QueryParameters.Add({{packageName}}.Client.ClientUtils.ParameterToMultiMap("deepObject", "{{baseName}}", {{paramName}})); {{/items}} {{/isDeepObject}} {{^isDeepObject}} - localVarRequestOptions.QueryParameters.Add({{packageName}}.Client.ClientUtils.ParameterToMultiMap("{{#collectionFormat}}{{collectionFormat}}{{/collectionFormat}}", "{{baseName}}", {{paramName}})); + localVarRequestOptions.QueryParameters.Add({{packageName}}.Client.ClientUtils.ParameterToMultiMap("{{collectionFormat}}", "{{baseName}}", {{paramName}})); {{/isDeepObject}} {{/required}} {{^required}} @@ -415,7 +415,7 @@ namespace {{packageName}}.{{apiPackage}} {{#items.vars}} if ({{paramName}}.{{name}} != null) { - localVarRequestOptions.QueryParameters.Add({{packageName}}.Client.ClientUtils.ParameterToMultiMap("{{#collectionFormat}}{{collectionFormat}}{{/collectionFormat}}", "{{baseName}}", {{paramName}}.{{name}})); + localVarRequestOptions.QueryParameters.Add({{packageName}}.Client.ClientUtils.ParameterToMultiMap("{{collectionFormat}}", "{{baseName}}", {{paramName}}.{{name}})); } {{/items.vars}} {{^items}} @@ -423,7 +423,7 @@ namespace {{packageName}}.{{apiPackage}} {{/items}} {{/isDeepObject}} {{^isDeepObject}} - localVarRequestOptions.QueryParameters.Add({{packageName}}.Client.ClientUtils.ParameterToMultiMap("{{#collectionFormat}}{{collectionFormat}}{{/collectionFormat}}", "{{baseName}}", {{paramName}})); + localVarRequestOptions.QueryParameters.Add({{packageName}}.Client.ClientUtils.ParameterToMultiMap("{{collectionFormat}}", "{{baseName}}", {{paramName}})); {{/isDeepObject}} } {{/required}} @@ -528,7 +528,7 @@ namespace {{packageName}}.{{apiPackage}} {{/authMethods}} // make the HTTP request - var localVarResponse = this.Client.{{#lambda.titlecase}}{{#lambda.lowercase}}{{httpMethod}}{{/lambda.lowercase}}{{/lambda.titlecase}}<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}Object{{/returnType}}>("{{{path}}}", localVarRequestOptions, this.Configuration); + var localVarResponse = this.Client.{{#lambda.titlecase}}{{#lambda.lowercase}}{{httpMethod}}{{/lambda.lowercase}}{{/lambda.titlecase}}<{{{returnType}}}{{^returnType}}Object{{/returnType}}>("{{{path}}}", localVarRequestOptions, this.Configuration); if (this.ExceptionFactory != null) { @@ -548,11 +548,11 @@ namespace {{packageName}}.{{apiPackage}} /// {{description}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}}{{#isDeprecated}} (deprecated){{/isDeprecated}} {{/allParams}} /// Cancellation Token to cancel the request. - /// Task of {{#returnType}}{{returnType}}{{/returnType}}{{^returnType}}void{{/returnType}} + /// Task of {{returnType}}{{^returnType}}void{{/returnType}} {{#isDeprecated}} [Obsolete] {{/isDeprecated}} - {{#returnType}}public async System.Threading.Tasks.Task<{{{returnType}}}>{{/returnType}}{{^returnType}}public async System.Threading.Tasks.Task{{/returnType}} {{operationId}}Async({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = default({{{dataType}}}){{/optionalMethodArgument}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}{{#allParams.0}}, {{/allParams.0}}System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + {{#returnType}}public async System.Threading.Tasks.Task<{{{.}}}>{{/returnType}}{{^returnType}}public async System.Threading.Tasks.Task{{/returnType}} {{operationId}}Async({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = default({{{dataType}}}){{/optionalMethodArgument}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}{{#allParams.0}}, {{/allParams.0}}System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { {{#returnType}}{{packageName}}.Client.ApiResponse<{{{returnType}}}> localVarResponse = await {{operationId}}WithHttpInfoAsync({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}{{#allParams.0}}, {{/allParams.0}}cancellationToken).ConfigureAwait(false); return localVarResponse.Data;{{/returnType}}{{^returnType}}await {{operationId}}WithHttpInfoAsync({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}{{#allParams.0}}, {{/allParams.0}}cancellationToken).ConfigureAwait(false);{{/returnType}} @@ -566,11 +566,11 @@ namespace {{packageName}}.{{apiPackage}} /// {{description}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}}{{#isDeprecated}} (deprecated){{/isDeprecated}} {{/allParams}} /// Cancellation Token to cancel the request. - /// Task of ApiResponse{{#returnType}} ({{returnType}}){{/returnType}} + /// Task of ApiResponse{{#returnType}} ({{.}}){{/returnType}} {{#isDeprecated}} [Obsolete] {{/isDeprecated}} - public async System.Threading.Tasks.Task<{{packageName}}.Client.ApiResponse<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}Object{{/returnType}}>> {{operationId}}WithHttpInfoAsync({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = default({{{dataType}}}){{/optionalMethodArgument}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}{{#allParams.0}}, {{/allParams.0}}System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task<{{packageName}}.Client.ApiResponse<{{{returnType}}}{{^returnType}}Object{{/returnType}}>> {{operationId}}WithHttpInfoAsync({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = default({{{dataType}}}){{/optionalMethodArgument}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}{{#allParams.0}}, {{/allParams.0}}System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { {{#allParams}} {{#required}} @@ -618,12 +618,12 @@ namespace {{packageName}}.{{apiPackage}} {{/pathParams}} {{#queryParams}} {{#required}} - localVarRequestOptions.QueryParameters.Add({{packageName}}.Client.ClientUtils.ParameterToMultiMap("{{#collectionFormat}}{{collectionFormat}}{{/collectionFormat}}", "{{baseName}}", {{paramName}})); + localVarRequestOptions.QueryParameters.Add({{packageName}}.Client.ClientUtils.ParameterToMultiMap("{{collectionFormat}}", "{{baseName}}", {{paramName}})); {{/required}} {{^required}} if ({{paramName}} != null) { - localVarRequestOptions.QueryParameters.Add({{packageName}}.Client.ClientUtils.ParameterToMultiMap("{{#collectionFormat}}{{collectionFormat}}{{/collectionFormat}}", "{{baseName}}", {{paramName}})); + localVarRequestOptions.QueryParameters.Add({{packageName}}.Client.ClientUtils.ParameterToMultiMap("{{collectionFormat}}", "{{baseName}}", {{paramName}})); } {{/required}} {{/queryParams}} @@ -730,7 +730,7 @@ namespace {{packageName}}.{{apiPackage}} // make the HTTP request - var localVarResponse = await this.AsynchronousClient.{{#lambda.titlecase}}{{#lambda.lowercase}}{{httpMethod}}{{/lambda.lowercase}}{{/lambda.titlecase}}Async<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}Object{{/returnType}}>("{{{path}}}", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); + var localVarResponse = await this.AsynchronousClient.{{#lambda.titlecase}}{{#lambda.lowercase}}{{httpMethod}}{{/lambda.lowercase}}{{/lambda.titlecase}}Async<{{{returnType}}}{{^returnType}}Object{{/returnType}}>("{{{path}}}", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); if (this.ExceptionFactory != null) { diff --git a/modules/openapi-generator/src/main/resources/csharp-netcore/modelAnyOf.mustache b/modules/openapi-generator/src/main/resources/csharp-netcore/modelAnyOf.mustache index c1b96657ae0..807aa3b47ef 100644 --- a/modules/openapi-generator/src/main/resources/csharp-netcore/modelAnyOf.mustache +++ b/modules/openapi-generator/src/main/resources/csharp-netcore/modelAnyOf.mustache @@ -1,9 +1,9 @@ /// - /// {{#description}}{{.}}{{/description}}{{^description}}{{classname}}{{/description}} + /// {{description}}{{^description}}{{classname}}{{/description}} /// [JsonConverter(typeof({{classname}}JsonConverter))] [DataContract(Name = "{{{name}}}")] - {{>visibility}} partial class {{classname}} : AbstractOpenAPISchema, {{#parent}}{{{parent}}}, {{/parent}}IEquatable<{{classname}}>{{#validatable}}, IValidatableObject{{/validatable}} + {{>visibility}} partial class {{classname}} : AbstractOpenAPISchema, {{#parent}}{{{.}}}, {{/parent}}IEquatable<{{classname}}>{{#validatable}}, IValidatableObject{{/validatable}} { {{#isNullable}} /// diff --git a/modules/openapi-generator/src/main/resources/csharp-netcore/modelEnum.mustache b/modules/openapi-generator/src/main/resources/csharp-netcore/modelEnum.mustache index c977374019f..d781952b4e0 100644 --- a/modules/openapi-generator/src/main/resources/csharp-netcore/modelEnum.mustache +++ b/modules/openapi-generator/src/main/resources/csharp-netcore/modelEnum.mustache @@ -1,8 +1,8 @@ /// - /// {{^description}}Defines {{{name}}}{{/description}}{{#description}}{{description}}{{/description}} + /// {{description}}{{^description}}Defines {{{name}}}{{/description}} /// {{#description}} - /// {{description}} + /// {{.}} {{/description}} {{#allowableValues}} {{#enumVars}} @@ -13,7 +13,7 @@ {{/-first}} {{/enumVars}} {{/allowableValues}} - {{>visibility}} enum {{#datatypeWithEnum}}{{.}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}{{#vendorExtensions.x-enum-byte}}: byte{{/vendorExtensions.x-enum-byte}} + {{>visibility}} enum {{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}{{#vendorExtensions.x-enum-byte}}: byte{{/vendorExtensions.x-enum-byte}} { {{#allowableValues}} {{#enumVars}} diff --git a/modules/openapi-generator/src/main/resources/csharp-netcore/modelGeneric.mustache b/modules/openapi-generator/src/main/resources/csharp-netcore/modelGeneric.mustache index ad65a3b8361..aaff4be3e25 100644 --- a/modules/openapi-generator/src/main/resources/csharp-netcore/modelGeneric.mustache +++ b/modules/openapi-generator/src/main/resources/csharp-netcore/modelGeneric.mustache @@ -1,5 +1,5 @@ /// - /// {{#description}}{{.}}{{/description}}{{^description}}{{classname}}{{/description}} + /// {{description}}{{^description}}{{classname}}{{/description}} /// [DataContract(Name = "{{{name}}}")] {{#discriminator}} @@ -8,7 +8,7 @@ [JsonSubtypes.KnownSubType(typeof({{{modelName}}}), "{{^vendorExtensions.x-discriminator-value}}{{{mappingName}}}{{/vendorExtensions.x-discriminator-value}}{{#vendorExtensions.x-discriminator-value}}{{{.}}}{{/vendorExtensions.x-discriminator-value}}")] {{/mappedModels}} {{/discriminator}} - {{>visibility}} partial class {{classname}} : {{#parent}}{{{parent}}}, {{/parent}}IEquatable<{{classname}}>{{#validatable}}, IValidatableObject{{/validatable}} + {{>visibility}} partial class {{classname}} : {{#parent}}{{{.}}}, {{/parent}}IEquatable<{{classname}}>{{#validatable}}, IValidatableObject{{/validatable}} { {{#vars}} {{#items.isEnum}} @@ -26,17 +26,17 @@ {{#isEnum}} /// - /// {{^description}}Gets or Sets {{{name}}}{{/description}}{{#description}}{{description}}{{/description}} + /// {{description}}{{^description}}Gets or Sets {{{name}}}{{/description}} /// {{#description}} - /// {{description}} + /// {{.}} {{/description}} {{^conditionalSerialization}} [DataMember(Name = "{{baseName}}"{{#required}}, IsRequired = true{{/required}}, EmitDefaultValue = {{#vendorExtensions.x-emit-default-value}}true{{/vendorExtensions.x-emit-default-value}}{{^vendorExtensions.x-emit-default-value}}{{#isBoolean}}true{{/isBoolean}}{{^isBoolean}}{{#isNullable}}true{{/isNullable}}{{^isNullable}}false{{/isNullable}}{{/isBoolean}}{{/vendorExtensions.x-emit-default-value}})] {{#deprecated}} [Obsolete] {{/deprecated}} - public {{#complexType}}{{{complexType}}}{{/complexType}}{{^complexType}}{{{datatypeWithEnum}}}{{/complexType}}{{^isContainer}}{{^required}}?{{/required}}{{/isContainer}} {{name}} { get; set; } + public {{{complexType}}}{{^complexType}}{{{datatypeWithEnum}}}{{/complexType}}{{^isContainer}}{{^required}}?{{/required}}{{/isContainer}} {{name}} { get; set; } {{#isReadOnly}} /// @@ -55,8 +55,8 @@ {{#deprecated}} [Obsolete] {{/deprecated}} - public {{#complexType}}{{{complexType}}}{{/complexType}}{{^complexType}}{{{datatypeWithEnum}}}{{/complexType}}{{^isContainer}}{{^required}}?{{/required}}{{/isContainer}} {{name}} { get; set; } - + public {{{complexType}}}{{^complexType}}{{{datatypeWithEnum}}}{{/complexType}}{{^isContainer}}{{^required}}?{{/required}}{{/isContainer}} {{name}} { get; set; } + /// /// Returns false as {{name}} should not be serialized given that it's read-only. @@ -67,14 +67,14 @@ return false; } {{/isReadOnly}} - + {{^isReadOnly}} [DataMember(Name = "{{baseName}}"{{#required}}, IsRequired = true{{/required}}, EmitDefaultValue = {{#vendorExtensions.x-emit-default-value}}true{{/vendorExtensions.x-emit-default-value}}{{^vendorExtensions.x-emit-default-value}}{{#isBoolean}}true{{/isBoolean}}{{^isBoolean}}{{#isNullable}}true{{/isNullable}}{{^isNullable}}false{{/isNullable}}{{/isBoolean}}{{/vendorExtensions.x-emit-default-value}})] {{#deprecated}} [Obsolete] {{/deprecated}} - public {{#complexType}}{{{complexType}}}{{/complexType}}{{^complexType}}{{{datatypeWithEnum}}}{{/complexType}}{{^isContainer}}{{^required}}?{{/required}}{{/isContainer}} {{name}} - { + public {{{complexType}}}{{^complexType}}{{{datatypeWithEnum}}}{{/complexType}}{{^isContainer}}{{^required}}?{{/required}}{{/isContainer}} {{name}} + { get{ return _{{name}};} set { @@ -82,7 +82,7 @@ _flag{{name}} = true; } } - private {{#complexType}}{{{complexType}}}{{/complexType}}{{^complexType}}{{{datatypeWithEnum}}}{{/complexType}}{{^isContainer}}{{^required}}?{{/required}}{{/isContainer}} _{{name}}; + private {{{complexType}}}{{^complexType}}{{{datatypeWithEnum}}}{{/complexType}}{{^isContainer}}{{^required}}?{{/required}}{{/isContainer}} _{{name}}; private bool _flag{{name}}; /// @@ -118,7 +118,7 @@ /// Initializes a new instance of the class. /// {{#readWriteVars}} - /// {{#description}}{{description}}{{/description}}{{^description}}{{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}}{{/description}}{{#required}} (required){{/required}}{{#defaultValue}} (default to {{defaultValue}}){{/defaultValue}}. + /// {{description}}{{^description}}{{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}}{{/description}}{{#required}} (required){{/required}}{{#defaultValue}} (default to {{.}}){{/defaultValue}}. {{/readWriteVars}} {{#hasOnlyReadOnly}} [JsonConstructorAttribute] @@ -185,9 +185,9 @@ {{^isInherited}} {{^isEnum}} /// - /// {{^description}}Gets or Sets {{{name}}}{{/description}}{{#description}}{{description}}{{/description}} + /// {{description}}{{^description}}Gets or Sets {{{name}}}{{/description}} /// {{#description}} - /// {{description}}{{/description}} + /// {{.}}{{/description}} {{^conditionalSerialization}} [DataMember(Name = "{{baseName}}"{{#required}}, IsRequired = true{{/required}}, EmitDefaultValue = {{#vendorExtensions.x-emit-default-value}}true{{/vendorExtensions.x-emit-default-value}}{{^vendorExtensions.x-emit-default-value}}{{#isBoolean}}true{{/isBoolean}}{{^isBoolean}}{{#isNullable}}true{{/isNullable}}{{^isNullable}}false{{/isNullable}}{{/isBoolean}}{{/vendorExtensions.x-emit-default-value}})] {{#isDate}} @@ -219,7 +219,7 @@ [Obsolete] {{/deprecated}} public {{{dataType}}} {{name}} { get; private set; } - + /// /// Returns false as {{name}} should not be serialized given that it's read-only. /// @@ -238,13 +238,13 @@ [Obsolete] {{/deprecated}} public {{{dataType}}} {{name}} - { + { get{ return _{{name}};} set { _{{name}} = value; _flag{{name}} = true; - } + } } private {{{dataType}}} _{{name}}; private bool _flag{{name}}; diff --git a/modules/openapi-generator/src/main/resources/csharp-netcore/modelInnerEnum.mustache b/modules/openapi-generator/src/main/resources/csharp-netcore/modelInnerEnum.mustache index 90090fea8c9..6af921832af 100644 --- a/modules/openapi-generator/src/main/resources/csharp-netcore/modelInnerEnum.mustache +++ b/modules/openapi-generator/src/main/resources/csharp-netcore/modelInnerEnum.mustache @@ -1,14 +1,14 @@ {{^isContainer}} /// - /// {{^description}}Defines {{{name}}}{{/description}}{{#description}}{{description}}{{/description}} + /// {{description}}{{^description}}Defines {{{name}}}{{/description}} /// {{#description}} - /// {{description}} + /// {{.}} {{/description}} {{#isString}} [JsonConverter(typeof(StringEnumConverter))] {{/isString}} - {{>visibility}} enum {{#datatypeWithEnum}}{{.}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}{{#vendorExtensions.x-enum-byte}}: byte{{/vendorExtensions.x-enum-byte}} + {{>visibility}} enum {{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}{{#vendorExtensions.x-enum-byte}}: byte{{/vendorExtensions.x-enum-byte}} { {{#allowableValues}} {{#enumVars}} diff --git a/modules/openapi-generator/src/main/resources/csharp-netcore/modelOneOf.mustache b/modules/openapi-generator/src/main/resources/csharp-netcore/modelOneOf.mustache index 59e2dbf19eb..9d8247195b6 100644 --- a/modules/openapi-generator/src/main/resources/csharp-netcore/modelOneOf.mustache +++ b/modules/openapi-generator/src/main/resources/csharp-netcore/modelOneOf.mustache @@ -1,9 +1,9 @@ /// - /// {{#description}}{{.}}{{/description}}{{^description}}{{classname}}{{/description}} + /// {{description}}{{^description}}{{classname}}{{/description}} /// [JsonConverter(typeof({{classname}}JsonConverter))] [DataContract(Name = "{{{name}}}")] - {{>visibility}} partial class {{classname}} : AbstractOpenAPISchema, {{#parent}}{{{parent}}}, {{/parent}}IEquatable<{{classname}}>{{#validatable}}, IValidatableObject{{/validatable}} + {{>visibility}} partial class {{classname}} : AbstractOpenAPISchema, {{#parent}}{{{.}}}, {{/parent}}IEquatable<{{classname}}>{{#validatable}}, IValidatableObject{{/validatable}} { {{#isNullable}} /// diff --git a/modules/openapi-generator/src/main/resources/csharp-netcore/netcore_project.mustache b/modules/openapi-generator/src/main/resources/csharp-netcore/netcore_project.mustache index 4f29dcf3d34..3be35749bea 100644 --- a/modules/openapi-generator/src/main/resources/csharp-netcore/netcore_project.mustache +++ b/modules/openapi-generator/src/main/resources/csharp-netcore/netcore_project.mustache @@ -14,11 +14,11 @@ {{packageName}} {{packageVersion}} bin\$(Configuration)\$(TargetFramework)\{{packageName}}.xml{{#licenseId}} - {{licenseId}}{{/licenseId}} + {{.}}{{/licenseId}} https://{{{gitHost}}}/{{{gitUserId}}}/{{{gitRepoId}}}.git git{{#releaseNote}} - {{releaseNote}}{{/releaseNote}}{{#packageTags}} - {{{packageTags}}}{{/packageTags}} + {{.}}{{/releaseNote}}{{#packageTags}} + {{{.}}}{{/packageTags}} {{#nullableReferenceTypes}} annotations {{/nullableReferenceTypes}} diff --git a/modules/openapi-generator/src/main/resources/csharp-netcore/nuspec.mustache b/modules/openapi-generator/src/main/resources/csharp-netcore/nuspec.mustache index 66254acffd4..9370bb01d64 100644 --- a/modules/openapi-generator/src/main/resources/csharp-netcore/nuspec.mustache +++ b/modules/openapi-generator/src/main/resources/csharp-netcore/nuspec.mustache @@ -21,10 +21,10 @@ nuget.org gallery uses information you add in the portal. --> {{packageDescription}} {{#termsOfService}} - {{termsOfService}} + {{.}} {{/termsOfService}} {{#licenseUrl}} - {{licenseUrl}} + {{.}} {{/licenseUrl}} diff --git a/modules/openapi-generator/src/main/resources/csharp-netcore/partial_header.mustache b/modules/openapi-generator/src/main/resources/csharp-netcore/partial_header.mustache index 755e937d23b..1562058ad8a 100644 --- a/modules/openapi-generator/src/main/resources/csharp-netcore/partial_header.mustache +++ b/modules/openapi-generator/src/main/resources/csharp-netcore/partial_header.mustache @@ -1,17 +1,17 @@ /* {{#appName}} - * {{{appName}}} + * {{{.}}} * {{/appName}} {{#appDescription}} - * {{{appDescription}}} + * {{{.}}} * {{/appDescription}} {{#version}} - * The version of the OpenAPI document: {{{version}}} + * The version of the OpenAPI document: {{{.}}} {{/version}} {{#infoEmail}} - * Contact: {{{infoEmail}}} + * Contact: {{{.}}} {{/infoEmail}} * Generated by: https://github.com/openapitools/openapi-generator.git */ diff --git a/modules/openapi-generator/src/main/resources/csharp/Configuration.mustache b/modules/openapi-generator/src/main/resources/csharp/Configuration.mustache index 65f1de6a8d8..b21c370a043 100644 --- a/modules/openapi-generator/src/main/resources/csharp/Configuration.mustache +++ b/modules/openapi-generator/src/main/resources/csharp/Configuration.mustache @@ -107,7 +107,7 @@ namespace {{packageName}}.Client /// public Configuration() { - UserAgent = "{{#httpUserAgent}}{{.}}{{/httpUserAgent}}{{^httpUserAgent}}OpenAPI-Generator/{{packageVersion}}/csharp{{/httpUserAgent}}"; + UserAgent = "{{httpUserAgent}}{{^httpUserAgent}}OpenAPI-Generator/{{packageVersion}}/csharp{{/httpUserAgent}}"; BasePath = "{{{basePath}}}"; DefaultHeader = new {{^net35}}Concurrent{{/net35}}Dictionary(); ApiKey = new {{^net35}}Concurrent{{/net35}}Dictionary(); @@ -180,7 +180,7 @@ namespace {{packageName}}.Client string tempFolderPath = null, string dateTimeFormat = null, int timeout = 100000, - string userAgent = "{{#httpUserAgent}}{{.}}{{/httpUserAgent}}{{^httpUserAgent}}OpenAPI-Generator/{{packageVersion}}/csharp{{/httpUserAgent}}" + string userAgent = "{{httpUserAgent}}{{^httpUserAgent}}OpenAPI-Generator/{{packageVersion}}/csharp{{/httpUserAgent}}" // ReSharper restore UnusedParameter.Local ) { diff --git a/modules/openapi-generator/src/main/resources/csharp/Project.mustache b/modules/openapi-generator/src/main/resources/csharp/Project.mustache index c1862f7cb8c..04458a3d168 100644 --- a/modules/openapi-generator/src/main/resources/csharp/Project.mustache +++ b/modules/openapi-generator/src/main/resources/csharp/Project.mustache @@ -1,15 +1,15 @@ @@ -118,4 +118,3 @@ {{/netStandard}} - diff --git a/modules/openapi-generator/src/main/resources/csharp/README.mustache b/modules/openapi-generator/src/main/resources/csharp/README.mustache index 4b0d636d62c..19fdde43db5 100644 --- a/modules/openapi-generator/src/main/resources/csharp/README.mustache +++ b/modules/openapi-generator/src/main/resources/csharp/README.mustache @@ -1,7 +1,7 @@ # {{packageName}} - the C# library for the {{appName}} {{#appDescriptionWithNewLines}} -{{{appDescriptionWithNewLines}}} +{{{.}}} {{/appDescriptionWithNewLines}} This C# SDK is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: @@ -178,7 +178,7 @@ All URIs are relative to *{{{basePath}}}* Class | Method | HTTP request | Description ------------ | ------------- | ------------- | ------------- -{{#apiInfo}}{{#apis}}{{#operations}}{{#operation}}*{{classname}}* | [**{{operationId}}**]({{apiDocPath}}{{classname}}.md#{{operationIdLowerCase}}) | **{{httpMethod}}** {{path}} | {{#summary}}{{{summary}}}{{/summary}} +{{#apiInfo}}{{#apis}}{{#operations}}{{#operation}}*{{classname}}* | [**{{operationId}}**]({{apiDocPath}}{{classname}}.md#{{operationIdLowerCase}}) | **{{httpMethod}}** {{path}} | {{{summary}}} {{/operation}}{{/operations}}{{/apis}}{{/apiInfo}} ## Documentation for Models diff --git a/modules/openapi-generator/src/main/resources/csharp/TestProject.mustache b/modules/openapi-generator/src/main/resources/csharp/TestProject.mustache index 3e850f2f3ac..1068f8db247 100644 --- a/modules/openapi-generator/src/main/resources/csharp/TestProject.mustache +++ b/modules/openapi-generator/src/main/resources/csharp/TestProject.mustache @@ -1,15 +1,15 @@ @@ -98,4 +98,3 @@ - diff --git a/modules/openapi-generator/src/main/resources/csharp/api.mustache b/modules/openapi-generator/src/main/resources/csharp/api.mustache index 8e80b857ad5..d2dda8824f6 100644 --- a/modules/openapi-generator/src/main/resources/csharp/api.mustache +++ b/modules/openapi-generator/src/main/resources/csharp/api.mustache @@ -32,11 +32,11 @@ namespace {{packageName}}.{{apiPackage}} /// /// Thrown when fails to make API call {{#allParams}}/// {{description}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}}{{#isDeprecated}} (deprecated){{/isDeprecated}} - {{/allParams}}/// {{#returnType}}{{returnType}}{{/returnType}} + {{/allParams}}/// {{returnType}} {{#isDeprecated}} [Obsolete] {{/isDeprecated}} - {{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}void{{/returnType}} {{operationId}} ({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = default({{{dataType}}}){{/optionalMethodArgument}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}); + {{{returnType}}}{{^returnType}}void{{/returnType}} {{operationId}} ({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = default({{{dataType}}}){{/optionalMethodArgument}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}); /// /// {{summary}} @@ -46,11 +46,11 @@ namespace {{packageName}}.{{apiPackage}} /// /// Thrown when fails to make API call {{#allParams}}/// {{description}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}}{{#isDeprecated}} (deprecated){{/isDeprecated}} - {{/allParams}}/// ApiResponse of {{#returnType}}{{returnType}}{{/returnType}}{{^returnType}}Object(void){{/returnType}} + {{/allParams}}/// ApiResponse of {{returnType}}{{^returnType}}Object(void){{/returnType}} {{#isDeprecated}} [Obsolete] {{/isDeprecated}} - ApiResponse<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}Object{{/returnType}}> {{operationId}}WithHttpInfo ({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = default({{{dataType}}}){{/optionalMethodArgument}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}); + ApiResponse<{{{returnType}}}{{^returnType}}Object{{/returnType}}> {{operationId}}WithHttpInfo ({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = default({{{dataType}}}){{/optionalMethodArgument}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}); {{/operation}} #endregion Synchronous Operations {{#supportsAsync}} @@ -65,11 +65,11 @@ namespace {{packageName}}.{{apiPackage}} /// Thrown when fails to make API call {{#allParams}}/// {{description}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}}{{#isDeprecated}} (deprecated){{/isDeprecated}} {{/allParams}}/// Cancellation Token to cancel request (optional) - /// Task of {{#returnType}}{{returnType}}{{/returnType}}{{^returnType}}void{{/returnType}} + /// Task of {{returnType}}{{^returnType}}void{{/returnType}} {{#isDeprecated}} [Obsolete] {{/isDeprecated}} - {{#returnType}}System.Threading.Tasks.Task<{{{returnType}}}>{{/returnType}}{{^returnType}}System.Threading.Tasks.Task{{/returnType}} {{operationId}}Async ({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = default({{{dataType}}}){{/optionalMethodArgument}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}{{#allParams.0}}, {{/allParams.0}}CancellationToken cancellationToken = default(CancellationToken)); + {{#returnType}}System.Threading.Tasks.Task<{{{.}}}>{{/returnType}}{{^returnType}}System.Threading.Tasks.Task{{/returnType}} {{operationId}}Async ({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = default({{{dataType}}}){{/optionalMethodArgument}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}{{#allParams.0}}, {{/allParams.0}}CancellationToken cancellationToken = default(CancellationToken)); /// /// {{summary}} @@ -80,11 +80,11 @@ namespace {{packageName}}.{{apiPackage}} /// Thrown when fails to make API call {{#allParams}}/// {{description}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}}{{#isDeprecated}} (deprecated){{/isDeprecated}} {{/allParams}}/// Cancellation Token to cancel request (optional) - /// Task of ApiResponse{{#returnType}} ({{returnType}}){{/returnType}} + /// Task of ApiResponse{{#returnType}} ({{.}}){{/returnType}} {{#isDeprecated}} [Obsolete] {{/isDeprecated}} - System.Threading.Tasks.Task> {{operationId}}WithHttpInfoAsync ({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = default({{{dataType}}}){{/optionalMethodArgument}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}{{#allParams.0}}, {{/allParams.0}}CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> {{operationId}}WithHttpInfoAsync ({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = default({{{dataType}}}){{/optionalMethodArgument}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}{{#allParams.0}}, {{/allParams.0}}CancellationToken cancellationToken = default(CancellationToken)); {{/operation}} #endregion Asynchronous Operations {{/supportsAsync}} @@ -204,11 +204,11 @@ namespace {{packageName}}.{{apiPackage}} /// /// Thrown when fails to make API call {{#allParams}}/// {{description}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}}{{#isDeprecated}} (deprecated){{/isDeprecated}} - {{/allParams}}/// {{#returnType}}{{returnType}}{{/returnType}} + {{/allParams}}/// {{returnType}} {{#isDeprecated}} [Obsolete] {{/isDeprecated}} - public {{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}void{{/returnType}} {{operationId}} ({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = default({{{dataType}}}){{/optionalMethodArgument}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}) + public {{{returnType}}}{{^returnType}}void{{/returnType}} {{operationId}} ({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = default({{{dataType}}}){{/optionalMethodArgument}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}) { {{#returnType}}ApiResponse<{{{returnType}}}> localVarResponse = {{operationId}}WithHttpInfo({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}); return localVarResponse.Data;{{/returnType}}{{^returnType}}{{operationId}}WithHttpInfo({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}});{{/returnType}} @@ -219,11 +219,11 @@ namespace {{packageName}}.{{apiPackage}} /// /// Thrown when fails to make API call {{#allParams}}/// {{description}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}}{{#isDeprecated}} (deprecated){{/isDeprecated}} - {{/allParams}}/// ApiResponse of {{#returnType}}{{returnType}}{{/returnType}}{{^returnType}}Object(void){{/returnType}} + {{/allParams}}/// ApiResponse of {{returnType}}{{^returnType}}Object(void){{/returnType}} {{#isDeprecated}} [Obsolete] {{/isDeprecated}} - public ApiResponse<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}Object{{/returnType}}> {{operationId}}WithHttpInfo ({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = default({{{dataType}}}){{/optionalMethodArgument}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}) + public ApiResponse<{{{returnType}}}{{^returnType}}Object{{/returnType}}> {{operationId}}WithHttpInfo ({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = default({{{dataType}}}){{/optionalMethodArgument}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}) { {{#allParams}} {{#required}} @@ -263,7 +263,7 @@ namespace {{packageName}}.{{apiPackage}} if ({{paramName}} != null) localVarPathParams.Add("{{baseName}}", this.Configuration.ApiClient.ParameterToString({{paramName}})); // path parameter {{/pathParams}} {{#queryParams}} - if ({{paramName}} != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("{{#collectionFormat}}{{collectionFormat}}{{/collectionFormat}}", "{{baseName}}", {{paramName}})); // query parameter + if ({{paramName}} != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("{{collectionFormat}}", "{{baseName}}", {{paramName}})); // query parameter {{/queryParams}} {{#headerParams}} if ({{paramName}} != null) localVarHeaderParams.Add("{{baseName}}", this.Configuration.ApiClient.ParameterToString({{paramName}})); // header parameter @@ -339,7 +339,7 @@ namespace {{packageName}}.{{apiPackage}} {{#returnType}} return new ApiResponse<{{{returnType}}}>(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.{{^netStandard}}Name{{/netStandard}}{{#netStandard}}Key{{/netStandard}}, x => string.Join(",", x.Value){{#caseInsensitiveResponseHeaders}}, StringComparer.OrdinalIgnoreCase{{/caseInsensitiveResponseHeaders}}), - ({{{returnType}}}) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof({{#returnContainer}}{{{returnContainer}}}{{/returnContainer}}{{^returnContainer}}{{{returnType}}}{{/returnContainer}}))); + ({{{returnType}}}) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof({{{returnContainer}}}{{^returnContainer}}{{{returnType}}}{{/returnContainer}}))); {{/returnType}} {{^returnType}} return new ApiResponse(localVarStatusCode, @@ -355,11 +355,11 @@ namespace {{packageName}}.{{apiPackage}} /// Thrown when fails to make API call {{#allParams}}/// {{description}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}}{{#isDeprecated}} (deprecated){{/isDeprecated}} {{/allParams}}/// Cancellation Token to cancel request (optional) - /// Task of {{#returnType}}{{returnType}}{{/returnType}}{{^returnType}}void{{/returnType}} + /// Task of {{returnType}}{{^returnType}}void{{/returnType}} {{#isDeprecated}} [Obsolete] {{/isDeprecated}} - {{#returnType}}public async System.Threading.Tasks.Task<{{{returnType}}}>{{/returnType}}{{^returnType}}public async System.Threading.Tasks.Task{{/returnType}} {{operationId}}Async ({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = default({{{dataType}}}){{/optionalMethodArgument}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}{{#allParams.0}}, {{/allParams.0}}CancellationToken cancellationToken = default(CancellationToken)) + {{#returnType}}public async System.Threading.Tasks.Task<{{{.}}}>{{/returnType}}{{^returnType}}public async System.Threading.Tasks.Task{{/returnType}} {{operationId}}Async ({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = default({{{dataType}}}){{/optionalMethodArgument}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}{{#allParams.0}}, {{/allParams.0}}CancellationToken cancellationToken = default(CancellationToken)) { {{#returnType}}ApiResponse<{{{returnType}}}> localVarResponse = await {{operationId}}WithHttpInfoAsync({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}{{#allParams.0}}, {{/allParams.0}}cancellationToken); return localVarResponse.Data;{{/returnType}}{{^returnType}}await {{operationId}}WithHttpInfoAsync({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}{{#allParams.0}}, {{/allParams.0}}cancellationToken);{{/returnType}} @@ -372,11 +372,11 @@ namespace {{packageName}}.{{apiPackage}} /// Thrown when fails to make API call {{#allParams}}/// {{description}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}}{{#isDeprecated}} (deprecated){{/isDeprecated}} {{/allParams}}/// Cancellation Token to cancel request (optional) - /// Task of ApiResponse{{#returnType}} ({{returnType}}){{/returnType}} + /// Task of ApiResponse{{#returnType}} ({{.}}){{/returnType}} {{#isDeprecated}} [Obsolete] {{/isDeprecated}} - public async System.Threading.Tasks.Task> {{operationId}}WithHttpInfoAsync ({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = default({{{dataType}}}){{/optionalMethodArgument}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}{{#allParams.0}}, {{/allParams.0}}CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> {{operationId}}WithHttpInfoAsync ({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = default({{{dataType}}}){{/optionalMethodArgument}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}{{#allParams.0}}, {{/allParams.0}}CancellationToken cancellationToken = default(CancellationToken)) { {{#allParams}} {{#required}} @@ -416,7 +416,7 @@ namespace {{packageName}}.{{apiPackage}} if ({{paramName}} != null) localVarPathParams.Add("{{baseName}}", this.Configuration.ApiClient.ParameterToString({{paramName}})); // path parameter {{/pathParams}} {{#queryParams}} - if ({{paramName}} != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("{{#collectionFormat}}{{collectionFormat}}{{/collectionFormat}}", "{{baseName}}", {{paramName}})); // query parameter + if ({{paramName}} != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("{{collectionFormat}}", "{{baseName}}", {{paramName}})); // query parameter {{/queryParams}} {{#headerParams}} if ({{paramName}} != null) localVarHeaderParams.Add("{{baseName}}", this.Configuration.ApiClient.ParameterToString({{paramName}})); // header parameter @@ -492,7 +492,7 @@ namespace {{packageName}}.{{apiPackage}} {{#returnType}} return new ApiResponse<{{{returnType}}}>(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.{{^netStandard}}Name{{/netStandard}}{{#netStandard}}Key{{/netStandard}}, x => string.Join(",", x.Value){{#caseInsensitiveResponseHeaders}}, StringComparer.OrdinalIgnoreCase{{/caseInsensitiveResponseHeaders}}), - ({{{returnType}}}) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof({{#returnContainer}}{{{returnContainer}}}{{/returnContainer}}{{^returnContainer}}{{{returnType}}}{{/returnContainer}}))); + ({{{returnType}}}) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof({{{returnContainer}}}{{^returnContainer}}{{{returnType}}}{{/returnContainer}}))); {{/returnType}} {{^returnType}} return new ApiResponse(localVarStatusCode, diff --git a/modules/openapi-generator/src/main/resources/csharp/api_doc.mustache b/modules/openapi-generator/src/main/resources/csharp/api_doc.mustache index 5b1c686cd37..617e197006d 100644 --- a/modules/openapi-generator/src/main/resources/csharp/api_doc.mustache +++ b/modules/openapi-generator/src/main/resources/csharp/api_doc.mustache @@ -1,12 +1,12 @@ # {{packageName}}.{{apiPackage}}.{{classname}}{{#description}} -{{description}}{{/description}} +{{.}}{{/description}} All URIs are relative to *{{{basePath}}}* Method | HTTP request | Description ------------- | ------------- | ------------- -{{#operations}}{{#operation}}[**{{operationId}}**]({{classname}}.md#{{operationIdLowerCase}}) | **{{httpMethod}}** {{path}} | {{#summary}}{{summary}}{{/summary}} +{{#operations}}{{#operation}}[**{{operationId}}**]({{classname}}.md#{{operationIdLowerCase}}) | **{{httpMethod}}** {{path}} | {{summary}} {{/operation}}{{/operations}} {{#operations}} @@ -14,11 +14,11 @@ Method | HTTP request | Description ## {{{operationId}}} -> {{#returnType}}{{returnType}}{{/returnType}}{{^returnType}}void{{/returnType}} {{operationId}} ({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = null{{/optionalMethodArgument}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}) +> {{returnType}}{{^returnType}}void{{/returnType}} {{operationId}} ({{#allParams}}{{{dataType}}} {{paramName}}{{^required}}{{#optionalMethodArgument}} = null{{/optionalMethodArgument}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}) {{{summary}}}{{#notes}} -{{{notes}}}{{/notes}} +{{{.}}}{{/notes}} ### Example @@ -77,7 +77,7 @@ namespace Example {{#summary}} // {{{.}}} {{/summary}} - {{#returnType}}{{{returnType}}} result = {{/returnType}}apiInstance.{{{operationId}}}({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}});{{#returnType}} + {{#returnType}}{{{.}}} result = {{/returnType}}apiInstance.{{{operationId}}}({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}});{{#returnType}} Debug.WriteLine(result);{{/returnType}} } catch (ApiException e) @@ -96,7 +96,7 @@ namespace Example {{^allParams}}This endpoint does not need any parameter.{{/allParams}}{{#allParams}}{{#-last}} Name | Type | Description | Notes ------------- | ------------- | ------------- | -------------{{/-last}}{{/allParams}} -{{#allParams}} **{{paramName}}** | {{#isPrimitiveType}}**{{dataType}}**{{/isPrimitiveType}}{{^isPrimitiveType}}[**{{dataType}}**]({{#isContainer}}{{baseType}}{{/isContainer}}{{^isContainer}}{{dataType}}{{/isContainer}}.md){{/isPrimitiveType}}| {{description}} | {{^required}}[optional] {{/required}}{{#defaultValue}}[default to {{defaultValue}}]{{/defaultValue}} +{{#allParams}} **{{paramName}}** | {{#isPrimitiveType}}**{{dataType}}**{{/isPrimitiveType}}{{^isPrimitiveType}}[**{{dataType}}**]({{#isContainer}}{{baseType}}{{/isContainer}}{{^isContainer}}{{dataType}}{{/isContainer}}.md){{/isPrimitiveType}}| {{description}} | {{^required}}[optional] {{/required}}{{#defaultValue}}[default to {{.}}]{{/defaultValue}} {{/allParams}} ### Return type diff --git a/modules/openapi-generator/src/main/resources/csharp/compile.mustache b/modules/openapi-generator/src/main/resources/csharp/compile.mustache index f80911357fd..920ce2c2427 100644 --- a/modules/openapi-generator/src/main/resources/csharp/compile.mustache +++ b/modules/openapi-generator/src/main/resources/csharp/compile.mustache @@ -24,4 +24,3 @@ copy packages\PropertyChanged.Fody.{{propertychanged-fody.version}}\PropertyChan copy packages\PropertyChanged.Fody.{{propertychanged-fody.version}}\Lib\dotnet\PropertyChanged.dll bin\PropertyChanged.dll {{/generatePropertyChanged}} %CSCPATH%\csc /reference:bin\Newtonsoft.Json.dll;bin\JsonSubTypes.dll;bin\RestSharp.dll;System.ComponentModel.DataAnnotations.dll {{#generatePropertyChanged}}/r:bin\Fody.dll;bin\PropertyChanged.Fody.dll;bin\PropertyChanged.dll{{/generatePropertyChanged}} /target:library /out:bin\{{packageName}}.dll /recurse:src\{{packageName}}\*.cs /doc:bin\{{packageName}}.xml - diff --git a/modules/openapi-generator/src/main/resources/csharp/enumClass.mustache b/modules/openapi-generator/src/main/resources/csharp/enumClass.mustache index de8c602a14d..ee1d5a1885a 100644 --- a/modules/openapi-generator/src/main/resources/csharp/enumClass.mustache +++ b/modules/openapi-generator/src/main/resources/csharp/enumClass.mustache @@ -1,11 +1,11 @@ /// - /// {{^description}}Gets or Sets {{{name}}}{{/description}}{{#description}}{{description}}{{/description}} + /// {{description}}{{^description}}Gets or Sets {{{name}}}{{/description}} /// {{#description}} - /// {{description}} + /// {{.}} {{/description}} [JsonConverter(typeof(StringEnumConverter))] - {{>visibility}} enum {{#datatypeWithEnum}}{{.}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}} + {{>visibility}} enum {{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}} { {{#allowableValues}} {{#enumVars}} diff --git a/modules/openapi-generator/src/main/resources/csharp/git_push.sh.mustache b/modules/openapi-generator/src/main/resources/csharp/git_push.sh.mustache index 8b3f689c912..f0bed5bd841 100755 --- a/modules/openapi-generator/src/main/resources/csharp/git_push.sh.mustache +++ b/modules/openapi-generator/src/main/resources/csharp/git_push.sh.mustache @@ -55,4 +55,3 @@ git pull origin master # Pushes (Forces) the changes in the local repository up to the remote repository echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" git push origin master 2>&1 | grep -v 'To https' - diff --git a/modules/openapi-generator/src/main/resources/csharp/modelEnum.mustache b/modules/openapi-generator/src/main/resources/csharp/modelEnum.mustache index c1a70a37f2d..91be597da01 100644 --- a/modules/openapi-generator/src/main/resources/csharp/modelEnum.mustache +++ b/modules/openapi-generator/src/main/resources/csharp/modelEnum.mustache @@ -1,13 +1,13 @@ /// - /// {{^description}}Defines {{{name}}}{{/description}}{{#description}}{{description}}{{/description}} + /// {{description}}{{^description}}Defines {{{name}}}{{/description}} /// {{#description}} - /// {{description}} + /// {{.}} {{/description}} {{#allowableValues}}{{#enumVars}}{{#-first}}{{#isString}} [JsonConverter(typeof(StringEnumConverter))] {{/isString}}{{/-first}}{{/enumVars}}{{/allowableValues}} - {{>visibility}} enum {{#datatypeWithEnum}}{{.}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}{{#vendorExtensions.x-enum-byte}}: byte{{/vendorExtensions.x-enum-byte}} + {{>visibility}} enum {{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}{{#vendorExtensions.x-enum-byte}}: byte{{/vendorExtensions.x-enum-byte}} { {{#allowableValues}} {{#enumVars}} diff --git a/modules/openapi-generator/src/main/resources/csharp/modelGeneric.mustache b/modules/openapi-generator/src/main/resources/csharp/modelGeneric.mustache index 933ba0824ae..bf8b1de91b3 100644 --- a/modules/openapi-generator/src/main/resources/csharp/modelGeneric.mustache +++ b/modules/openapi-generator/src/main/resources/csharp/modelGeneric.mustache @@ -1,5 +1,5 @@ /// - /// {{#description}}{{.}}{{/description}}{{^description}}{{classname}}{{/description}} + /// {{description}}{{^description}}{{classname}}{{/description}} /// [DataContract] {{#discriminator}} @@ -9,7 +9,7 @@ {{#generatePropertyChanged}} [ImplementPropertyChanged] {{/generatePropertyChanged}} - {{>visibility}} partial class {{classname}} : {{#parent}}{{{parent}}}, {{/parent}} IEquatable<{{classname}}>{{^netStandard}}{{#validatable}}, IValidatableObject{{/validatable}}{{/netStandard}} + {{>visibility}} partial class {{classname}} : {{#parent}}{{{.}}}, {{/parent}} IEquatable<{{classname}}>{{^netStandard}}{{#validatable}}, IValidatableObject{{/validatable}}{{/netStandard}} { {{#vars}} {{#items.isEnum}} @@ -26,16 +26,16 @@ {{/isEnum}} {{#isEnum}} /// - /// {{^description}}Gets or Sets {{{name}}}{{/description}}{{#description}}{{description}}{{/description}} + /// {{description}}{{^description}}Gets or Sets {{{name}}}{{/description}} /// {{#description}} - /// {{description}} + /// {{.}} {{/description}} [DataMember(Name="{{baseName}}", EmitDefaultValue={{#vendorExtensions.x-emit-default-value}}true{{/vendorExtensions.x-emit-default-value}}{{^vendorExtensions.x-emit-default-value}}{{#isNullable}}true{{/isNullable}}{{^isNullable}}{{#required}}true{{/required}}{{^required}}false{{/required}}{{/isNullable}}{{/vendorExtensions.x-emit-default-value}})] {{#deprecated}} [Obsolete] {{/deprecated}} - public {{#complexType}}{{{complexType}}}{{/complexType}}{{^complexType}}{{{datatypeWithEnum}}}{{/complexType}}{{^isContainer}}{{^required}}?{{/required}}{{/isContainer}} {{name}} { get; set; } + public {{{complexType}}}{{^complexType}}{{{datatypeWithEnum}}}{{/complexType}}{{^isContainer}}{{^required}}?{{/required}}{{/isContainer}} {{name}} { get; set; } {{/isEnum}} {{/vars}} {{#hasRequired}} @@ -52,13 +52,13 @@ /// {{#vars}} {{^isReadOnly}} - /// {{#description}}{{description}}{{/description}}{{^description}}{{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}}{{/description}}{{#required}} (required){{/required}}{{#defaultValue}} (default to {{defaultValue}}){{/defaultValue}}. + /// {{description}}{{^description}}{{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}}{{/description}}{{#required}} (required){{/required}}{{#defaultValue}} (default to {{.}}){{/defaultValue}}. {{/isReadOnly}} {{/vars}} {{#hasOnlyReadOnly}} [JsonConstructorAttribute] {{/hasOnlyReadOnly}} - public {{classname}}({{#readWriteVars}}{{{datatypeWithEnum}}}{{#isEnum}}{{^isContainer}}{{^required}}?{{/required}}{{/isContainer}}{{/isEnum}} {{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}} = {{#defaultValue}}{{{defaultValue}}}{{/defaultValue}}{{^defaultValue}}default({{{datatypeWithEnum}}}{{#isEnum}}{{^isContainer}}{{^required}}?{{/required}}{{/isContainer}}{{/isEnum}}){{/defaultValue}}{{^-last}}, {{/-last}}{{/readWriteVars}}){{#parent}} : base({{#parentVars}}{{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}}{{^-last}}, {{/-last}}{{/parentVars}}){{/parent}} + public {{classname}}({{#readWriteVars}}{{{datatypeWithEnum}}}{{#isEnum}}{{^isContainer}}{{^required}}?{{/required}}{{/isContainer}}{{/isEnum}} {{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}} = {{{defaultValue}}}{{^defaultValue}}default({{{datatypeWithEnum}}}{{#isEnum}}{{^isContainer}}{{^required}}?{{/required}}{{/isContainer}}{{/isEnum}}){{/defaultValue}}{{^-last}}, {{/-last}}{{/readWriteVars}}){{#parent}} : base({{#parentVars}}{{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}}{{^-last}}, {{/-last}}{{/parentVars}}){{/parent}} { {{#vars}} {{^isInherited}} @@ -108,9 +108,9 @@ this.{{name}} = {{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}}; {{^isInherited}} {{^isEnum}} /// - /// {{^description}}Gets or Sets {{{name}}}{{/description}}{{#description}}{{description}}{{/description}} + /// {{description}}{{^description}}Gets or Sets {{{name}}}{{/description}} /// {{#description}} - /// {{description}}{{/description}} + /// {{.}}{{/description}} [DataMember(Name="{{baseName}}", EmitDefaultValue={{#vendorExtensions.x-emit-default-value}}true{{/vendorExtensions.x-emit-default-value}}{{^vendorExtensions.x-emit-default-value}}{{#isNullable}}true{{/isNullable}}{{^isNullable}}{{#required}}true{{/required}}{{^required}}false{{/required}}{{/isNullable}}{{/vendorExtensions.x-emit-default-value}})]{{#isDate}} [JsonConverter(typeof(OpenAPIDateConverter))]{{/isDate}} {{#deprecated}} @@ -302,7 +302,7 @@ this.{{name}} = {{#lambda.camelcase_param}}{{name}}{{/lambda.camelcase_param}}; } {{/minLength}} {{/isEnum}} - + {{#maximum}} // {{{name}}} ({{{dataType}}}) maximum if(this.{{{name}}} > ({{{dataType}}}){{maximum}}) diff --git a/modules/openapi-generator/src/main/resources/csharp/modelInnerEnum.mustache b/modules/openapi-generator/src/main/resources/csharp/modelInnerEnum.mustache index d9e96dccdb3..4187d95bd04 100644 --- a/modules/openapi-generator/src/main/resources/csharp/modelInnerEnum.mustache +++ b/modules/openapi-generator/src/main/resources/csharp/modelInnerEnum.mustache @@ -1,14 +1,14 @@ {{^isContainer}} /// - /// {{^description}}Defines {{{name}}}{{/description}}{{#description}}{{description}}{{/description}} + /// {{description}}{{^description}}Defines {{{name}}}{{/description}} /// {{#description}} - /// {{description}} + /// {{.}} {{/description}} {{#isString}} [JsonConverter(typeof(StringEnumConverter))] {{/isString}} - {{>visibility}} enum {{#datatypeWithEnum}}{{.}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}{{#vendorExtensions.x-enum-byte}}: byte{{/vendorExtensions.x-enum-byte}} + {{>visibility}} enum {{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}{{#vendorExtensions.x-enum-byte}}: byte{{/vendorExtensions.x-enum-byte}} { {{#allowableValues}} {{#enumVars}} diff --git a/modules/openapi-generator/src/main/resources/csharp/nuspec.mustache b/modules/openapi-generator/src/main/resources/csharp/nuspec.mustache index 45ba3381de6..623a37f9144 100644 --- a/modules/openapi-generator/src/main/resources/csharp/nuspec.mustache +++ b/modules/openapi-generator/src/main/resources/csharp/nuspec.mustache @@ -21,10 +21,10 @@ nuget.org gallery uses information you add in the portal. --> {{packageDescription}} {{#termsOfService}} - {{termsOfService}} + {{.}} {{/termsOfService}} {{#licenseUrl}} - {{licenseUrl}} + {{.}} {{/licenseUrl}} diff --git a/modules/openapi-generator/src/main/resources/csharp/partial_header.mustache b/modules/openapi-generator/src/main/resources/csharp/partial_header.mustache index 8c6a0fc032a..2c741c79595 100644 --- a/modules/openapi-generator/src/main/resources/csharp/partial_header.mustache +++ b/modules/openapi-generator/src/main/resources/csharp/partial_header.mustache @@ -1,13 +1,13 @@ /* {{#appName}} - * {{{appName}}} + * {{{.}}} * {{/appName}} {{#appDescription}} - * {{{appDescription}}} + * {{{.}}} * {{/appDescription}} - * {{#version}}The version of the OpenAPI document: {{{version}}}{{/version}} - * {{#infoEmail}}Contact: {{{infoEmail}}}{{/infoEmail}} + * {{#version}}The version of the OpenAPI document: {{{.}}}{{/version}} + * {{#infoEmail}}Contact: {{{.}}}{{/infoEmail}} * Generated by: https://github.com/openapitools/openapi-generator.git */ diff --git a/modules/openapi-generator/src/main/resources/dart-dio/README.mustache b/modules/openapi-generator/src/main/resources/dart-dio/README.mustache index 0b375af727d..e76a9e8b63a 100644 --- a/modules/openapi-generator/src/main/resources/dart-dio/README.mustache +++ b/modules/openapi-generator/src/main/resources/dart-dio/README.mustache @@ -1,13 +1,13 @@ # {{pubName}} {{#appDescriptionWithNewLines}} -{{{appDescriptionWithNewLines}}} +{{{.}}} {{/appDescriptionWithNewLines}} This Dart package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: - API version: {{appVersion}} {{#artifactVersion}} -- Package version: {{artifactVersion}} +- Package version: {{.}} {{/artifactVersion}} {{^hideGenerationTimestamp}} - Build date: {{generatedDate}} @@ -73,7 +73,7 @@ All URIs are relative to *{{basePath}}* Class | Method | HTTP request | Description ------------ | ------------- | ------------- | ------------- -{{#apiInfo}}{{#apis}}{{#operations}}{{#operation}}*{{classname}}* | [**{{operationId}}**]({{apiDocPath}}{{classname}}.md#{{operationIdLowerCase}}) | **{{httpMethod}}** {{path}} | {{#summary}}{{summary}}{{/summary}} +{{#apiInfo}}{{#apis}}{{#operations}}{{#operation}}*{{classname}}* | [**{{operationId}}**]({{apiDocPath}}{{classname}}.md#{{operationIdLowerCase}}) | **{{httpMethod}}** {{path}} | {{summary}} {{/operation}}{{/operations}}{{/apis}}{{/apiInfo}} ## Documentation For Models @@ -107,4 +107,3 @@ Class | Method | HTTP request | Description {{#apiInfo}}{{#apis}}{{#-last}}{{infoEmail}} {{/-last}}{{/apis}}{{/apiInfo}} - diff --git a/modules/openapi-generator/src/main/resources/dart-dio/api.mustache b/modules/openapi-generator/src/main/resources/dart-dio/api.mustache index 522815498c5..3feee916193 100644 --- a/modules/openapi-generator/src/main/resources/dart-dio/api.mustache +++ b/modules/openapi-generator/src/main/resources/dart-dio/api.mustache @@ -19,7 +19,7 @@ class {{classname}} { /// {{{summary}}} /// /// {{{notes}}} - Future> {{nickname}}({{^hasRequiredParams}}{ {{/hasRequiredParams}}{{#requiredParams}} + Future> {{nickname}}({{^hasRequiredParams}}{ {{/hasRequiredParams}}{{#requiredParams}} {{{dataType}}} {{paramName}},{{#-last}} { {{/-last}}{{/requiredParams}}{{#optionalParams}} {{{dataType}}} {{paramName}},{{/optionalParams}} CancelToken cancelToken, diff --git a/modules/openapi-generator/src/main/resources/dart-dio/api_doc.mustache b/modules/openapi-generator/src/main/resources/dart-dio/api_doc.mustache index 1e28b16012e..ff0dd731eeb 100644 --- a/modules/openapi-generator/src/main/resources/dart-dio/api_doc.mustache +++ b/modules/openapi-generator/src/main/resources/dart-dio/api_doc.mustache @@ -1,5 +1,5 @@ # {{pubName}}.api.{{classname}}{{#description}} -{{description}}{{/description}} +{{.}}{{/description}} ## Load the API package ```dart @@ -10,19 +10,19 @@ All URIs are relative to *{{basePath}}* Method | HTTP request | Description ------------- | ------------- | ------------- -{{#operations}}{{#operation}}[**{{operationId}}**]({{classname}}.md#{{operationIdLowerCase}}) | **{{httpMethod}}** {{path}} | {{#summary}}{{summary}}{{/summary}} +{{#operations}}{{#operation}}[**{{operationId}}**]({{classname}}.md#{{operationIdLowerCase}}) | **{{httpMethod}}** {{path}} | {{summary}} {{/operation}}{{/operations}} {{#operations}} {{#operation}} # **{{{operationId}}}** -> {{#returnType}}{{{returnType}}} {{/returnType}}{{{operationId}}}({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}) +> {{#returnType}}{{{.}}} {{/returnType}}{{{operationId}}}({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}) {{{summary}}}{{#notes}} -{{{notes}}}{{/notes}} +{{{.}}}{{/notes}} -### Example +### Example ```dart import 'package:{{pubName}}/api.dart'; {{#hasAuthMethods}} @@ -50,7 +50,7 @@ var api_instance = new {{classname}}(); var {{paramName}} = {{#isArray}}[{{/isArray}}{{#isBodyParam}}new {{{dataType}}}(){{/isBodyParam}}{{^isBodyParam}}{{{example}}}{{/isBodyParam}}{{#isArray}}]{{/isArray}}; // {{{dataType}}} | {{{description}}} {{/allParams}} -try { +try { {{#returnType}}var result = {{/returnType}}api_instance.{{{operationId}}}({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}); {{#returnType}} print(result); @@ -64,7 +64,7 @@ try { {{^allParams}}This endpoint does not need any parameter.{{/allParams}}{{#allParams}}{{#-last}} Name | Type | Description | Notes ------------- | ------------- | ------------- | -------------{{/-last}}{{/allParams}} -{{#allParams}} **{{paramName}}** | {{#isPrimitiveType}}**{{{dataType}}}**{{/isPrimitiveType}}{{^isPrimitiveType}}[**{{{dataType}}}**]({{baseType}}.md){{/isPrimitiveType}}| {{{description}}} | {{^required}}[optional] {{/required}}{{#defaultValue}}[default to {{{defaultValue}}}]{{/defaultValue}} +{{#allParams}} **{{paramName}}** | {{#isPrimitiveType}}**{{{dataType}}}**{{/isPrimitiveType}}{{^isPrimitiveType}}[**{{{dataType}}}**]({{baseType}}.md){{/isPrimitiveType}}| {{{description}}} | {{^required}}[optional] {{/required}}{{#defaultValue}}[default to {{{.}}}]{{/defaultValue}} {{/allParams}} ### Return type diff --git a/modules/openapi-generator/src/main/resources/dart-dio/api_test.mustache b/modules/openapi-generator/src/main/resources/dart-dio/api_test.mustache index f4dd8e65fad..2ea19b30c81 100644 --- a/modules/openapi-generator/src/main/resources/dart-dio/api_test.mustache +++ b/modules/openapi-generator/src/main/resources/dart-dio/api_test.mustache @@ -19,7 +19,7 @@ void main() { // {{{.}}} // {{/notes}} - //{{#returnType}}Future<{{{returnType}}}> {{/returnType}}{{^returnType}}Future {{/returnType}}{{{operationId}}}({{#allParams}}{{#required}}{{{dataType}}} {{{paramName}}}{{^-last}}, {{/-last}}{{/required}}{{/allParams}}{{#hasOptionalParams}}{ {{#allParams}}{{^required}}{{{dataType}}} {{{paramName}}}{{^-last}}, {{/-last}}{{/required}}{{/allParams}} }{{/hasOptionalParams}}) async + //{{#returnType}}Future<{{{.}}}> {{/returnType}}{{^returnType}}Future {{/returnType}}{{{operationId}}}({{#allParams}}{{#required}}{{{dataType}}} {{{paramName}}}{{^-last}}, {{/-last}}{{/required}}{{/allParams}}{{#hasOptionalParams}}{ {{#allParams}}{{^required}}{{{dataType}}} {{{paramName}}}{{^-last}}, {{/-last}}{{/required}}{{/allParams}} }{{/hasOptionalParams}}) async test('test {{{operationId}}}', () async { // TODO }); diff --git a/modules/openapi-generator/src/main/resources/dart-dio/class.mustache b/modules/openapi-generator/src/main/resources/dart-dio/class.mustache index 0fce16365a3..f4d2c1e4e76 100644 --- a/modules/openapi-generator/src/main/resources/dart-dio/class.mustache +++ b/modules/openapi-generator/src/main/resources/dart-dio/class.mustache @@ -7,7 +7,7 @@ abstract class {{classname}} implements Built<{{classname}}, {{classname}}Builde {{#vars}} {{#description}} - /// {{{description}}} + /// {{{.}}} {{/description}} {{! A field is @nullable in built_value when it is diff --git a/modules/openapi-generator/src/main/resources/dart-dio/enum.mustache b/modules/openapi-generator/src/main/resources/dart-dio/enum.mustache index 35049426b9e..16ab3eeb243 100644 --- a/modules/openapi-generator/src/main/resources/dart-dio/enum.mustache +++ b/modules/openapi-generator/src/main/resources/dart-dio/enum.mustache @@ -9,7 +9,7 @@ class {{classname}} extends EnumClass { {{#allowableValues}} {{#enumVars}} {{#description}} - /// {{{description}}} + /// {{{.}}} {{/description}} @BuiltValueEnumConst({{#isInteger}}wireNumber: {{{value}}}{{/isInteger}}{{^isInteger}}wireName: r{{#lambda.escapeBuiltValueEnum}}{{{value}}}{{/lambda.escapeBuiltValueEnum}}{{/isInteger}}) static const {{classname}} {{name}} = _${{name}}; diff --git a/modules/openapi-generator/src/main/resources/dart-dio/enum_inline.mustache b/modules/openapi-generator/src/main/resources/dart-dio/enum_inline.mustache index f18008d92bf..d9432ae28f0 100644 --- a/modules/openapi-generator/src/main/resources/dart-dio/enum_inline.mustache +++ b/modules/openapi-generator/src/main/resources/dart-dio/enum_inline.mustache @@ -3,7 +3,7 @@ class {{{enumName}}} extends EnumClass { {{#allowableValues}} {{#enumVars}} {{#description}} - /// {{{description}}} + /// {{{.}}} {{/description}} @BuiltValueEnumConst({{#isInteger}}wireNumber: {{{value}}}{{/isInteger}}{{^isInteger}}wireName: r{{#lambda.escapeBuiltValueEnum}}{{{value}}}{{/lambda.escapeBuiltValueEnum}}{{/isInteger}}) static const {{{enumName}}} {{name}} = _${{#lambda.camelcase}}{{{enumName}}}{{/lambda.camelcase}}_{{name}}; diff --git a/modules/openapi-generator/src/main/resources/dart-dio/gitignore.mustache b/modules/openapi-generator/src/main/resources/dart-dio/gitignore.mustache index 6d2ac22c0b4..4298cdcbd1a 100644 --- a/modules/openapi-generator/src/main/resources/dart-dio/gitignore.mustache +++ b/modules/openapi-generator/src/main/resources/dart-dio/gitignore.mustache @@ -10,7 +10,7 @@ build/ **/packages/ # Files created by dart2js -# (Most Dart developers will use pub build to compile Dart, use/modify these +# (Most Dart developers will use pub build to compile Dart, use/modify these # rules if you intend to use dart2js directly # Convention is to use extension '.dart.js' for Dart compiled to Javascript to # differentiate from explicit Javascript files) @@ -23,7 +23,7 @@ build/ # Directory created by dartdoc doc/api/ -# Don't commit pubspec lock file +# Don't commit pubspec lock file # (Library packages only! Remove pattern if developing an application package) pubspec.lock diff --git a/modules/openapi-generator/src/main/resources/dart-dio/model_test.mustache b/modules/openapi-generator/src/main/resources/dart-dio/model_test.mustache index e9aab10347e..9cd8f2a9c97 100644 --- a/modules/openapi-generator/src/main/resources/dart-dio/model_test.mustache +++ b/modules/openapi-generator/src/main/resources/dart-dio/model_test.mustache @@ -15,7 +15,7 @@ void main() { group({{{classname}}}, () { {{#vars}} {{#description}} - // {{{description}}} + // {{{.}}} {{/description}} // {{{dataType}}} {{{name}}}{{#defaultValue}} (default value: {{{.}}}){{/defaultValue}} test('to test the property `{{{name}}}`', () async { diff --git a/modules/openapi-generator/src/main/resources/dart-dio/object_doc.mustache b/modules/openapi-generator/src/main/resources/dart-dio/object_doc.mustache index f2a52db11a4..cb6505fcf4e 100644 --- a/modules/openapi-generator/src/main/resources/dart-dio/object_doc.mustache +++ b/modules/openapi-generator/src/main/resources/dart-dio/object_doc.mustache @@ -8,7 +8,7 @@ import 'package:{{pubName}}/api.dart'; ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -{{#vars}}**{{name}}** | {{#isPrimitiveType}}**{{{dataType}}}**{{/isPrimitiveType}}{{^isPrimitiveType}}[**{{{dataType}}}**]({{complexType}}.md){{/isPrimitiveType}} | {{{description}}} | {{^required}}[optional] {{/required}}{{#readOnly}}[readonly] {{/readOnly}}{{#defaultValue}}[default to {{{defaultValue}}}]{{/defaultValue}} +{{#vars}}**{{name}}** | {{#isPrimitiveType}}**{{{dataType}}}**{{/isPrimitiveType}}{{^isPrimitiveType}}[**{{{dataType}}}**]({{complexType}}.md){{/isPrimitiveType}} | {{{description}}} | {{^required}}[optional] {{/required}}{{#readOnly}}[readonly] {{/readOnly}}{{#defaultValue}}[default to {{{.}}}]{{/defaultValue}} {{/vars}} [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/modules/openapi-generator/src/main/resources/dart-jaguar/README.mustache b/modules/openapi-generator/src/main/resources/dart-jaguar/README.mustache index 3e2d427c4d4..9296cc85904 100644 --- a/modules/openapi-generator/src/main/resources/dart-jaguar/README.mustache +++ b/modules/openapi-generator/src/main/resources/dart-jaguar/README.mustache @@ -1,13 +1,13 @@ # {{pubName}} {{#appDescriptionWithNewLines}} -{{{appDescriptionWithNewLines}}} +{{{.}}} {{/appDescriptionWithNewLines}} This Dart package is automatically generated by the [Open API Codegen](https://github.com/OpenAPITools/openapi-generator) project: - API version: {{appVersion}} {{#artifactVersion}} -- Package version: {{artifactVersion}} +- Package version: {{.}} {{/artifactVersion}} {{^hideGenerationTimestamp}} - Build date: {{generatedDate}} @@ -105,7 +105,7 @@ All URIs are relative to *{{basePath}}* Class | Method | HTTP request | Description ------------ | ------------- | ------------- | ------------- -{{#apiInfo}}{{#apis}}{{#operations}}{{#operation}}*{{classname}}* | [**{{operationId}}**]({{apiDocPath}}/{{classname}}.md#{{operationIdLowerCase}}) | **{{httpMethod}}** {{path}} | {{#summary}}{{summary}}{{/summary}} +{{#apiInfo}}{{#apis}}{{#operations}}{{#operation}}*{{classname}}* | [**{{operationId}}**]({{apiDocPath}}/{{classname}}.md#{{operationIdLowerCase}}) | **{{httpMethod}}** {{path}} | {{summary}} {{/operation}}{{/operations}}{{/apis}}{{/apiInfo}} ## Documentation For Models @@ -139,4 +139,3 @@ Class | Method | HTTP request | Description {{#apiInfo}}{{#apis}}{{#-last}}{{infoEmail}} {{/-last}}{{/apis}}{{/apiInfo}} - diff --git a/modules/openapi-generator/src/main/resources/dart-jaguar/api.mustache b/modules/openapi-generator/src/main/resources/dart-jaguar/api.mustache index db992b6faf7..7aef336eda4 100644 --- a/modules/openapi-generator/src/main/resources/dart-jaguar/api.mustache +++ b/modules/openapi-generator/src/main/resources/dart-jaguar/api.mustache @@ -25,7 +25,7 @@ class {{classname}} extends ApiClient with _${{classname}}Client { /// /// {{notes}} @{{httpMethod}}Req(path: "{{path}}"{{#hasAuthMethods}}, metadata: {"auth": [{{#authMethods}} {"type": "{{type}}", "name": "{{name}}"{{#isApiKey}}, "keyName": "{{keyParamName}}", "where": "{{#isKeyInQuery}}query{{/isKeyInQuery}}{{#isKeyInHeader}}header{{/isKeyInHeader}}"{{/isApiKey}} }{{^-last}}, {{/-last}}{{/authMethods}}]}{{/hasAuthMethods}}) - Future<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}void{{/returnType}}> {{nickname}}( + Future<{{{returnType}}}{{^returnType}}void{{/returnType}}> {{nickname}}( {{#pathParams}} @PathParam("{{baseName}}") {{dataType}} {{paramName}}{{^-last}}, {{/-last}} {{/pathParams}} diff --git a/modules/openapi-generator/src/main/resources/dart-jaguar/api_doc.mustache b/modules/openapi-generator/src/main/resources/dart-jaguar/api_doc.mustache index 243e2486755..ad0c61a6673 100644 --- a/modules/openapi-generator/src/main/resources/dart-jaguar/api_doc.mustache +++ b/modules/openapi-generator/src/main/resources/dart-jaguar/api_doc.mustache @@ -1,5 +1,5 @@ # {{pubName}}.api.{{classname}}{{#description}} -{{description}}{{/description}} +{{.}}{{/description}} ## Load the API package ```dart @@ -10,19 +10,19 @@ All URIs are relative to *{{basePath}}* Method | HTTP request | Description ------------- | ------------- | ------------- -{{#operations}}{{#operation}}[**{{operationId}}**]({{classname}}.md#{{operationId}}) | **{{httpMethod}}** {{path}} | {{#summary}}{{summary}}{{/summary}} +{{#operations}}{{#operation}}[**{{operationId}}**]({{classname}}.md#{{operationId}}) | **{{httpMethod}}** {{path}} | {{summary}} {{/operation}}{{/operations}} {{#operations}} {{#operation}} # **{{{operationId}}}** -> {{#returnType}}{{{returnType}}} {{/returnType}}{{{operationId}}}({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}) +> {{#returnType}}{{{.}}} {{/returnType}}{{{operationId}}}({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}) {{{summary}}}{{#notes}} -{{{notes}}}{{/notes}} +{{{.}}}{{/notes}} -### Example +### Example ```dart import 'package:{{pubName}}/api.dart'; {{#hasAuthMethods}} @@ -50,7 +50,7 @@ var api_instance = new {{classname}}(); var {{paramName}} = {{#isArray}}[{{/isArray}}{{#isBodyParam}}new {{dataType}}(){{/isBodyParam}}{{^isBodyParam}}{{{example}}}{{/isBodyParam}}{{#isArray}}]{{/isArray}}; // {{{dataType}}} | {{{description}}} {{/allParams}} -try { +try { {{#returnType}}var result = {{/returnType}}api_instance.{{{operationId}}}({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}); {{#returnType}} print(result); @@ -64,7 +64,7 @@ try { {{^allParams}}This endpoint does not need any parameter.{{/allParams}}{{#allParams}}{{#-last}} Name | Type | Description | Notes ------------- | ------------- | ------------- | -------------{{/-last}}{{/allParams}} -{{#allParams}} **{{paramName}}** | {{#isFile}}**{{dataType}}**{{/isFile}}{{#isPrimitiveType}}**{{dataType}}**{{/isPrimitiveType}}{{^isPrimitiveType}}{{^isFile}}[**{{dataType}}**]({{baseType}}.md){{/isFile}}{{/isPrimitiveType}}| {{description}} | {{^required}}[optional] {{/required}}{{#defaultValue}}[default to {{defaultValue}}]{{/defaultValue}} +{{#allParams}} **{{paramName}}** | {{#isFile}}**{{dataType}}**{{/isFile}}{{#isPrimitiveType}}**{{dataType}}**{{/isPrimitiveType}}{{^isPrimitiveType}}{{^isFile}}[**{{dataType}}**]({{baseType}}.md){{/isFile}}{{/isPrimitiveType}}| {{description}} | {{^required}}[optional] {{/required}}{{#defaultValue}}[default to {{.}}]{{/defaultValue}} {{/allParams}} ### Return type diff --git a/modules/openapi-generator/src/main/resources/dart-jaguar/api_test.mustache b/modules/openapi-generator/src/main/resources/dart-jaguar/api_test.mustache index f5211efaff2..d44b5bdef2f 100644 --- a/modules/openapi-generator/src/main/resources/dart-jaguar/api_test.mustache +++ b/modules/openapi-generator/src/main/resources/dart-jaguar/api_test.mustache @@ -17,7 +17,7 @@ void main() { // {{{.}}} // {{/notes}} - //{{#returnType}}Future<{{{returnType}}}> {{/returnType}}{{^returnType}}Future {{/returnType}}{{operationId}}({{#allParams}}{{#required}}{{{dataType}}} {{paramName}}{{^-last}}, {{/-last}}{{/required}}{{/allParams}}{{#hasOptionalParams}}{ {{#allParams}}{{^required}}{{{dataType}}} {{paramName}}{{^-last}}, {{/-last}}{{/required}}{{/allParams}} }{{/hasOptionalParams}}) async + //{{#returnType}}Future<{{{.}}}> {{/returnType}}{{^returnType}}Future {{/returnType}}{{operationId}}({{#allParams}}{{#required}}{{{dataType}}} {{paramName}}{{^-last}}, {{/-last}}{{/required}}{{/allParams}}{{#hasOptionalParams}}{ {{#allParams}}{{^required}}{{{dataType}}} {{paramName}}{{^-last}}, {{/-last}}{{/required}}{{/allParams}} }{{/hasOptionalParams}}) async test('test {{operationId}}', () async { // TODO }); diff --git a/modules/openapi-generator/src/main/resources/dart-jaguar/class.mustache b/modules/openapi-generator/src/main/resources/dart-jaguar/class.mustache index 0bb3c106744..6178bba374f 100644 --- a/modules/openapi-generator/src/main/resources/dart-jaguar/class.mustache +++ b/modules/openapi-generator/src/main/resources/dart-jaguar/class.mustache @@ -9,7 +9,7 @@ message {{classname}} { part '{{classFilename}}.jser.dart'; class {{classname}} { - {{#vars}}{{#description}} /* {{{description}}} */{{/description}} + {{#vars}}{{#description}} /* {{{.}}} */{{/description}} @Alias('{{{baseName}}}', isNullable:{{#isNullable}} true{{/isNullable}}{{^isNullable}} false{{/isNullable}},{{#allowableValues}} {{^enumVars.empty}}{{^isString}}{{! isString because inline enums are not handled for now }} processor: const {{{datatype}}}FieldProcessor(), diff --git a/modules/openapi-generator/src/main/resources/dart-jaguar/enum.mustache b/modules/openapi-generator/src/main/resources/dart-jaguar/enum.mustache index ef2c35e2c2a..da8322afbe9 100644 --- a/modules/openapi-generator/src/main/resources/dart-jaguar/enum.mustache +++ b/modules/openapi-generator/src/main/resources/dart-jaguar/enum.mustache @@ -9,7 +9,7 @@ class {{classname}} { {{#allowableValues}} {{#enumVars}} {{#description}} - /// {{description}} + /// {{.}} {{/description}} static const {{classname}} {{{name}}} = const {{classname}}._internal({{{value}}}); {{/enumVars}} diff --git a/modules/openapi-generator/src/main/resources/dart-jaguar/git_push.sh.mustache b/modules/openapi-generator/src/main/resources/dart-jaguar/git_push.sh.mustache index 8b3f689c912..f0bed5bd841 100755 --- a/modules/openapi-generator/src/main/resources/dart-jaguar/git_push.sh.mustache +++ b/modules/openapi-generator/src/main/resources/dart-jaguar/git_push.sh.mustache @@ -55,4 +55,3 @@ git pull origin master # Pushes (Forces) the changes in the local repository up to the remote repository echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" git push origin master 2>&1 | grep -v 'To https' - diff --git a/modules/openapi-generator/src/main/resources/dart-jaguar/gitignore.mustache b/modules/openapi-generator/src/main/resources/dart-jaguar/gitignore.mustache index 7c280441649..8b7331fd822 100644 --- a/modules/openapi-generator/src/main/resources/dart-jaguar/gitignore.mustache +++ b/modules/openapi-generator/src/main/resources/dart-jaguar/gitignore.mustache @@ -9,7 +9,7 @@ build/ **/packages/ # Files created by dart2js -# (Most Dart developers will use pub build to compile Dart, use/modify these +# (Most Dart developers will use pub build to compile Dart, use/modify these # rules if you intend to use dart2js directly # Convention is to use extension '.dart.js' for Dart compiled to Javascript to # differentiate from explicit Javascript files) @@ -22,6 +22,6 @@ build/ # Directory created by dartdoc doc/api/ -# Don't commit pubspec lock file +# Don't commit pubspec lock file # (Library packages only! Remove pattern if developing an application package) pubspec.lock diff --git a/modules/openapi-generator/src/main/resources/dart-jaguar/model_test.mustache b/modules/openapi-generator/src/main/resources/dart-jaguar/model_test.mustache index b766bf143e7..8e36f3df9a2 100644 --- a/modules/openapi-generator/src/main/resources/dart-jaguar/model_test.mustache +++ b/modules/openapi-generator/src/main/resources/dart-jaguar/model_test.mustache @@ -10,7 +10,7 @@ void main() { group('test {{classname}}', () { {{#vars}} {{#description}} - // {{{description}}} + // {{{.}}} {{/description}} // {{{dataType}}} {{name}}{{#defaultValue}} (default value: {{{.}}}){{/defaultValue}} test('to test the property `{{name}}`', () async { diff --git a/modules/openapi-generator/src/main/resources/dart-jaguar/object_doc.mustache b/modules/openapi-generator/src/main/resources/dart-jaguar/object_doc.mustache index 793c8df8ae0..ee17fcd0227 100644 --- a/modules/openapi-generator/src/main/resources/dart-jaguar/object_doc.mustache +++ b/modules/openapi-generator/src/main/resources/dart-jaguar/object_doc.mustache @@ -8,7 +8,7 @@ import 'package:{{pubName}}/api.dart'; ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -{{#vars}}**{{name}}** | {{#isPrimitiveType}}**{{datatype}}**{{/isPrimitiveType}}{{^isPrimitiveType}}[**{{datatype}}**]({{complexType}}.md){{/isPrimitiveType}} | {{description}} | {{^required}}[optional] {{/required}}{{#isReadOnly}}[readonly] {{/isReadOnly}}{{#defaultValue}}[default to {{defaultValue}}]{{/defaultValue}} +{{#vars}}**{{name}}** | {{#isPrimitiveType}}**{{datatype}}**{{/isPrimitiveType}}{{^isPrimitiveType}}[**{{datatype}}**]({{complexType}}.md){{/isPrimitiveType}} | {{description}} | {{^required}}[optional] {{/required}}{{#isReadOnly}}[readonly] {{/isReadOnly}}{{#defaultValue}}[default to {{.}}]{{/defaultValue}} {{/vars}} [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/README.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/README.mustache index 69591ce24a3..3efaca1cb66 100644 --- a/modules/openapi-generator/src/main/resources/dart/libraries/dio/README.mustache +++ b/modules/openapi-generator/src/main/resources/dart/libraries/dio/README.mustache @@ -1,13 +1,13 @@ # {{pubName}} (EXPERIMENTAL) {{#appDescriptionWithNewLines}} -{{{appDescriptionWithNewLines}}} +{{{.}}} {{/appDescriptionWithNewLines}} This Dart package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: - API version: {{appVersion}} {{#artifactVersion}} -- Package version: {{artifactVersion}} +- Package version: {{.}} {{/artifactVersion}} {{^hideGenerationTimestamp}} - Build date: {{generatedDate}} @@ -82,7 +82,7 @@ All URIs are relative to *{{basePath}}* Class | Method | HTTP request | Description ------------ | ------------- | ------------- | ------------- -{{#apiInfo}}{{#apis}}{{#operations}}{{#operation}}[*{{classname}}*]({{modelDocPath}}{{{classname}}}.md) | [**{{operationId}}**]({{apiDocPath}}{{classname}}.md#{{operationIdLowerCase}}) | **{{httpMethod}}** {{path}} | {{#summary}}{{summary}}{{/summary}} +{{#apiInfo}}{{#apis}}{{#operations}}{{#operation}}[*{{classname}}*]({{modelDocPath}}{{{classname}}}.md) | [**{{operationId}}**]({{apiDocPath}}{{classname}}.md#{{operationIdLowerCase}}) | **{{httpMethod}}** {{path}} | {{summary}} {{/operation}}{{/operations}}{{/apis}}{{/apiInfo}} ## Documentation For Models @@ -116,4 +116,3 @@ Class | Method | HTTP request | Description {{#apiInfo}}{{#apis}}{{#-last}}{{infoEmail}} {{/-last}}{{/apis}}{{/apiInfo}} - diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/api.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/api.mustache index e0298000d77..01663cfd23c 100644 --- a/modules/openapi-generator/src/main/resources/dart/libraries/dio/api.mustache +++ b/modules/openapi-generator/src/main/resources/dart/libraries/dio/api.mustache @@ -19,7 +19,7 @@ class {{classname}} { const {{classname}}(this._dio{{#useBuiltValue}}, this._serializers{{/useBuiltValue}}); {{#operation}} - /// {{#summary}}{{.}}{{/summary}}{{^summary}}{{nickname}}{{/summary}} + /// {{summary}}{{^summary}}{{nickname}}{{/summary}} /// {{notes}} /// /// Parameters: @@ -33,7 +33,7 @@ class {{classname}} { /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress /// - /// Returns a [Future]{{#returnType}} containing a [Response] with a [{{{returnType}}}] as data{{/returnType}} + /// Returns a [Future]{{#returnType}} containing a [Response] with a [{{{.}}}] as data{{/returnType}} /// Throws [DioError] if API call or serialization fails {{#externalDocs}} /// {{description}} @@ -42,7 +42,7 @@ class {{classname}} { {{#isDeprecated}} @Deprecated('This operation has been deprecated') {{/isDeprecated}} - Future> {{nickname}}({ {{#allParams}}{{#isPathParam}} + Future> {{nickname}}({ {{#allParams}}{{#isPathParam}} required {{{dataType}}} {{paramName}},{{/isPathParam}}{{#isQueryParam}} {{#required}}{{^isNullable}}{{^defaultValue}}required {{/defaultValue}}{{/isNullable}}{{/required}}{{{dataType}}}{{#required}}{{#isNullable}}?{{/isNullable}}{{/required}}{{^required}}?{{/required}} {{paramName}}{{^isContainer}}{{#defaultValue}} = {{{.}}}{{/defaultValue}}{{/isContainer}},{{/isQueryParam}}{{#isHeaderParam}} {{#required}}{{^isNullable}}{{^defaultValue}}required {{/defaultValue}}{{/isNullable}}{{/required}}{{{dataType}}}{{#required}}{{#isNullable}}?{{/isNullable}}{{/required}}{{^required}}?{{/required}} {{paramName}}{{^isContainer}}{{#defaultValue}} = {{{.}}}{{/defaultValue}}{{/isContainer}},{{/isHeaderParam}}{{#isBodyParam}} @@ -74,7 +74,7 @@ class {{classname}} { 'secure': >[{{^hasAuthMethods}}],{{/hasAuthMethods}}{{#hasAuthMethods}} {{#authMethods}}{ 'type': '{{type}}',{{#scheme}} - 'scheme': '{{scheme}}',{{/scheme}} + 'scheme': '{{.}}',{{/scheme}} 'name': '{{name}}',{{#isApiKey}} 'keyName': '{{keyParamName}}', 'where': '{{#isKeyInQuery}}query{{/isKeyInQuery}}{{#isKeyInHeader}}header{{/isKeyInHeader}}',{{/isApiKey}} diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/api_doc.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/api_doc.mustache index 548c8b140ce..39e9163d75d 100644 --- a/modules/openapi-generator/src/main/resources/dart/libraries/dio/api_doc.mustache +++ b/modules/openapi-generator/src/main/resources/dart/libraries/dio/api_doc.mustache @@ -1,5 +1,5 @@ # {{pubName}}.api.{{classname}}{{#description}} -{{description}}{{/description}} +{{.}}{{/description}} ## Load the API package ```dart @@ -10,19 +10,19 @@ All URIs are relative to *{{basePath}}* Method | HTTP request | Description ------------- | ------------- | ------------- -{{#operations}}{{#operation}}[**{{operationId}}**]({{classname}}.md#{{operationIdLowerCase}}) | **{{httpMethod}}** {{path}} | {{#summary}}{{summary}}{{/summary}} +{{#operations}}{{#operation}}[**{{operationId}}**]({{classname}}.md#{{operationIdLowerCase}}) | **{{httpMethod}}** {{path}} | {{summary}} {{/operation}}{{/operations}} {{#operations}} {{#operation}} # **{{{operationId}}}** -> {{#returnType}}{{{returnType}}} {{/returnType}}{{{operationId}}}({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}) +> {{#returnType}}{{{.}}} {{/returnType}}{{{operationId}}}({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}) {{{summary}}}{{#notes}} -{{{notes}}}{{/notes}} +{{{.}}}{{/notes}} -### Example +### Example ```dart import 'package:{{pubName}}/api.dart'; {{#hasAuthMethods}} @@ -50,7 +50,7 @@ final api = {{clientName}}().get{{classname}}(); final {{{dataType}}} {{paramName}} = {{{example}}}; // {{{dataType}}} | {{{description}}} {{/allParams}} -try { +try { {{#returnType}}final response = {{/returnType}}api.{{{operationId}}}({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}); {{#returnType}} print(response); @@ -64,7 +64,7 @@ try { {{^allParams}}This endpoint does not need any parameter.{{/allParams}}{{#allParams}}{{#-last}} Name | Type | Description | Notes ------------- | ------------- | ------------- | -------------{{/-last}}{{/allParams}} -{{#allParams}} **{{paramName}}** | {{#isPrimitiveType}}**{{dataType}}**{{/isPrimitiveType}}{{^isPrimitiveType}}[**{{dataType}}**]({{baseType}}.md){{/isPrimitiveType}}| {{{description}}} | {{^required}}[optional] {{/required}}{{#defaultValue}}[default to {{{defaultValue}}}]{{/defaultValue}} +{{#allParams}} **{{paramName}}** | {{#isPrimitiveType}}**{{dataType}}**{{/isPrimitiveType}}{{^isPrimitiveType}}[**{{dataType}}**]({{baseType}}.md){{/isPrimitiveType}}| {{{description}}} | {{^required}}[optional] {{/required}}{{#defaultValue}}[default to {{{.}}}]{{/defaultValue}} {{/allParams}} ### Return type diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/api_test.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/api_test.mustache index 056920d91aa..8420ac5dfaf 100644 --- a/modules/openapi-generator/src/main/resources/dart/libraries/dio/api_test.mustache +++ b/modules/openapi-generator/src/main/resources/dart/libraries/dio/api_test.mustache @@ -17,7 +17,7 @@ void main() { // {{{.}}} // {{/notes}} - //{{#returnType}}Future<{{{returnType}}}> {{/returnType}}{{^returnType}}Future {{/returnType}}{{{operationId}}}({{#allParams}}{{#required}}{{{dataType}}} {{{paramName}}}{{^-last}}, {{/-last}}{{/required}}{{/allParams}}{{#hasOptionalParams}}{ {{#allParams}}{{^required}}{{{dataType}}} {{{paramName}}}{{^-last}}, {{/-last}}{{/required}}{{/allParams}} }{{/hasOptionalParams}}) async + //{{#returnType}}Future<{{{.}}}> {{/returnType}}{{^returnType}}Future {{/returnType}}{{{operationId}}}({{#allParams}}{{#required}}{{{dataType}}} {{{paramName}}}{{^-last}}, {{/-last}}{{/required}}{{/allParams}}{{#hasOptionalParams}}{ {{#allParams}}{{^required}}{{{dataType}}} {{{paramName}}}{{^-last}}, {{/-last}}{{/required}}{{/allParams}} }{{/hasOptionalParams}}) async test('test {{{operationId}}}', () async { // TODO }); diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/gitignore.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/gitignore.mustache index 6d2ac22c0b4..4298cdcbd1a 100644 --- a/modules/openapi-generator/src/main/resources/dart/libraries/dio/gitignore.mustache +++ b/modules/openapi-generator/src/main/resources/dart/libraries/dio/gitignore.mustache @@ -10,7 +10,7 @@ build/ **/packages/ # Files created by dart2js -# (Most Dart developers will use pub build to compile Dart, use/modify these +# (Most Dart developers will use pub build to compile Dart, use/modify these # rules if you intend to use dart2js directly # Convention is to use extension '.dart.js' for Dart compiled to Javascript to # differentiate from explicit Javascript files) @@ -23,7 +23,7 @@ build/ # Directory created by dartdoc doc/api/ -# Don't commit pubspec lock file +# Don't commit pubspec lock file # (Library packages only! Remove pattern if developing an application package) pubspec.lock diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/model_test.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/model_test.mustache index eaa57022a41..56686dc889a 100644 --- a/modules/openapi-generator/src/main/resources/dart/libraries/dio/model_test.mustache +++ b/modules/openapi-generator/src/main/resources/dart/libraries/dio/model_test.mustache @@ -14,7 +14,7 @@ void main() { group({{{classname}}}, () { {{#vars}} {{#description}} - // {{{description}}} + // {{{.}}} {{/description}} // {{{dataType}}} {{{name}}}{{#defaultValue}} (default value: {{{.}}}){{/defaultValue}} test('to test the property `{{{name}}}`', () async { diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/object_doc.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/object_doc.mustache index 84b70087bf4..9abc25d5123 100644 --- a/modules/openapi-generator/src/main/resources/dart/libraries/dio/object_doc.mustache +++ b/modules/openapi-generator/src/main/resources/dart/libraries/dio/object_doc.mustache @@ -8,7 +8,7 @@ import 'package:{{pubName}}/api.dart'; ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -{{#vars}}**{{name}}** | {{#isPrimitiveType}}**{{dataType}}**{{/isPrimitiveType}}{{^isPrimitiveType}}[**{{dataType}}**]({{complexType}}.md){{/isPrimitiveType}} | {{{description}}} | {{^required}}[optional] {{/required}}{{#readOnly}}[readonly] {{/readOnly}}{{#defaultValue}}[default to {{{defaultValue}}}]{{/defaultValue}} +{{#vars}}**{{name}}** | {{#isPrimitiveType}}**{{dataType}}**{{/isPrimitiveType}}{{^isPrimitiveType}}[**{{dataType}}**]({{complexType}}.md){{/isPrimitiveType}} | {{{description}}} | {{^required}}[optional] {{/required}}{{#readOnly}}[readonly] {{/readOnly}}{{#defaultValue}}[default to {{{.}}}]{{/defaultValue}} {{/vars}} [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/built_value/class.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/built_value/class.mustache index 816524bc73a..1c593709101 100644 --- a/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/built_value/class.mustache +++ b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/built_value/class.mustache @@ -11,7 +11,7 @@ part '{{classFilename}}.g.dart'; // ignore_for_file: unused_import {{/parentModel}} -/// {{#description}}{{{.}}}{{/description}}{{^description}}{{classname}}{{/description}} +/// {{{description}}}{{^description}}{{classname}}{{/description}} {{#hasVars}} /// /// Properties: @@ -22,7 +22,7 @@ part '{{classFilename}}.g.dart'; abstract class {{classname}} implements Built<{{classname}}, {{classname}}Builder> { {{#vars}} {{#description}} - /// {{{description}}} + /// {{{.}}} {{/description}} @BuiltValueField(wireName: r'{{baseName}}') {{{datatypeWithEnum}}}{{#isNullable}}?{{/isNullable}}{{^isNullable}}{{^required}}?{{/required}}{{/isNullable}} get {{name}}; diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/built_value/enum.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/built_value/enum.mustache index 4e299b1faa3..e3cc6755362 100644 --- a/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/built_value/enum.mustache +++ b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/built_value/enum.mustache @@ -9,7 +9,7 @@ class {{classname}} extends EnumClass { {{#allowableValues}} {{#enumVars}} {{#description}} - /// {{{description}}} + /// {{{.}}} {{/description}} @BuiltValueEnumConst({{#isInteger}}wireNumber: {{{value}}}{{/isInteger}}{{^isInteger}}wireName: r{{{value}}}{{/isInteger}}) static const {{classname}} {{name}} = _${{name}}; diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/built_value/enum_inline.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/built_value/enum_inline.mustache index 2d0c898cd3c..5f5dfd49913 100644 --- a/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/built_value/enum_inline.mustache +++ b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/built_value/enum_inline.mustache @@ -3,7 +3,7 @@ class {{{enumName}}} extends EnumClass { {{#allowableValues}} {{#enumVars}} {{#description}} - /// {{{description}}} + /// {{{.}}} {{/description}} @BuiltValueEnumConst({{#isInteger}}wireNumber: {{{value}}}{{/isInteger}}{{^isInteger}}wireName: r{{{value}}}{{/isInteger}}) static const {{{enumName}}} {{name}} = _${{#lambda.camelcase}}{{{enumName}}}{{/lambda.camelcase}}_{{name}}; diff --git a/modules/openapi-generator/src/main/resources/dart2/README.mustache b/modules/openapi-generator/src/main/resources/dart2/README.mustache index 01718999fd2..1b112915956 100644 --- a/modules/openapi-generator/src/main/resources/dart2/README.mustache +++ b/modules/openapi-generator/src/main/resources/dart2/README.mustache @@ -1,13 +1,13 @@ # {{{pubName}}} {{#appDescriptionWithNewLines}} -{{{appDescriptionWithNewLines}}} +{{{.}}} {{/appDescriptionWithNewLines}} This Dart package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: - API version: {{{appVersion}}} {{#artifactVersion}} -- Package version: {{{artifactVersion}}} +- Package version: {{{.}}} {{/artifactVersion}} {{^hideGenerationTimestamp}} - Build date: {{{generatedDate}}} @@ -102,7 +102,7 @@ All URIs are relative to *{{{basePath}}}* Class | Method | HTTP request | Description ------------ | ------------- | ------------- | ------------- -{{#apiInfo}}{{#apis}}{{#operations}}{{#operation}}*{{{classname}}}* | [**{{{operationId}}}**]({{{apiDocPath}}}/{{{classname}}}.md#{{{operationIdLowerCase}}}) | **{{{httpMethod}}}** {{{path}}} | {{#summary}}{{{summary}}}{{/summary}} +{{#apiInfo}}{{#apis}}{{#operations}}{{#operation}}*{{{classname}}}* | [**{{{operationId}}}**]({{{apiDocPath}}}/{{{classname}}}.md#{{{operationIdLowerCase}}}) | **{{{httpMethod}}}** {{{path}}} | {{{summary}}} {{/operation}}{{/operations}}{{/apis}}{{/apiInfo}} ## Documentation For Models @@ -142,4 +142,3 @@ Class | Method | HTTP request | Description {{#apiInfo}}{{#apis}}{{#-last}}{{{infoEmail}}} {{/-last}}{{/apis}}{{/apiInfo}} - diff --git a/modules/openapi-generator/src/main/resources/dart2/api.mustache b/modules/openapi-generator/src/main/resources/dart2/api.mustache index a7bb9289143..b86bdb02228 100644 --- a/modules/openapi-generator/src/main/resources/dart2/api.mustache +++ b/modules/openapi-generator/src/main/resources/dart2/api.mustache @@ -9,7 +9,7 @@ class {{{classname}}} { {{#operation}} {{#summary}} - /// {{{summary}}} + /// {{{.}}} {{/summary}} {{#notes}} {{#summary}} @@ -43,7 +43,7 @@ class {{{classname}}} { {{#allParams}} /// * [{{{dataType}}}] {{{paramName}}}{{#required}} (required){{/required}}{{#optional}} (optional){{/optional}}: {{#description}} - /// {{{description}}} + /// {{{.}}} {{/description}} {{^-last}} /// @@ -144,7 +144,7 @@ class {{{classname}}} { } {{#summary}} - /// {{{summary}}} + /// {{{.}}} {{/summary}} {{#notes}} {{#summary}} @@ -167,13 +167,13 @@ class {{{classname}}} { {{#allParams}} /// * [{{{dataType}}}] {{{paramName}}}{{#required}} (required){{/required}}{{#optional}} (optional){{/optional}}: {{#description}} - /// {{{description}}} + /// {{{.}}} {{/description}} {{^-last}} /// {{/-last}} {{/allParams}} - Future<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}void{{/returnType}}> {{{nickname}}}({{#allParams}}{{#required}}{{{dataType}}} {{{paramName}}}{{^-last}}, {{/-last}}{{/required}}{{/allParams}}{{#hasOptionalParams}}{ {{#allParams}}{{^required}}{{{dataType}}} {{{paramName}}}{{^-last}}, {{/-last}}{{/required}}{{/allParams}} }{{/hasOptionalParams}}) async { + Future<{{{returnType}}}{{^returnType}}void{{/returnType}}> {{{nickname}}}({{#allParams}}{{#required}}{{{dataType}}} {{{paramName}}}{{^-last}}, {{/-last}}{{/required}}{{/allParams}}{{#hasOptionalParams}}{ {{#allParams}}{{^required}}{{{dataType}}} {{{paramName}}}{{^-last}}, {{/-last}}{{/required}}{{/allParams}} }{{/hasOptionalParams}}) async { final response = await {{{nickname}}}WithHttpInfo({{#allParams}}{{#required}}{{{paramName}}}{{^-last}}, {{/-last}}{{/required}}{{/allParams}}{{#hasOptionalParams}} {{#allParams}}{{^required}}{{{paramName}}}: {{{paramName}}}{{^-last}}, {{/-last}}{{/required}}{{/allParams}} {{/hasOptionalParams}}); if (response.statusCode >= HttpStatus.badRequest) { throw ApiException(response.statusCode, await _decodeBodyBytes(response)); diff --git a/modules/openapi-generator/src/main/resources/dart2/api_doc.mustache b/modules/openapi-generator/src/main/resources/dart2/api_doc.mustache index b7e91eb72c8..3332ff1f205 100644 --- a/modules/openapi-generator/src/main/resources/dart2/api_doc.mustache +++ b/modules/openapi-generator/src/main/resources/dart2/api_doc.mustache @@ -1,5 +1,5 @@ # {{{pubName}}}.api.{{{classname}}}{{#description}} -{{{description}}}{{/description}} +{{{.}}}{{/description}} ## Load the API package ```dart @@ -10,19 +10,19 @@ All URIs are relative to *{{{basePath}}}* Method | HTTP request | Description ------------- | ------------- | ------------- -{{#operations}}{{#operation}}[**{{{operationId}}}**]({{{classname}}}.md#{{{operationIdLowerCase}}}) | **{{{httpMethod}}}** {{{path}}} | {{#summary}}{{{summary}}}{{/summary}} +{{#operations}}{{#operation}}[**{{{operationId}}}**]({{{classname}}}.md#{{{operationIdLowerCase}}}) | **{{{httpMethod}}}** {{{path}}} | {{{summary}}} {{/operation}}{{/operations}} {{#operations}} {{#operation}} # **{{{operationId}}}** -> {{#returnType}}{{{returnType}}} {{/returnType}}{{{operationId}}}({{#allParams}}{{{paramName}}}{{^-last}}, {{/-last}}{{/allParams}}) +> {{#returnType}}{{{.}}} {{/returnType}}{{{operationId}}}({{#allParams}}{{{paramName}}}{{^-last}}, {{/-last}}{{/allParams}}) {{{summary}}}{{#notes}} -{{{notes}}}{{/notes}} +{{{.}}}{{/notes}} -### Example +### Example ```dart import 'package:{{{pubName}}}/api.dart'; {{#hasAuthMethods}} @@ -60,7 +60,7 @@ final api_instance = {{{classname}}}(); final {{{paramName}}} = {{#isArray}}[{{/isArray}}{{#isBodyParam}}{{{dataType}}}(){{/isBodyParam}}{{^isBodyParam}}{{{example}}}{{/isBodyParam}}{{#isArray}}]{{/isArray}}; // {{{dataType}}} | {{{description}}} {{/allParams}} -try { +try { {{#returnType}}final result = {{/returnType}}api_instance.{{{operationId}}}({{#allParams}}{{{paramName}}}{{^-last}}, {{/-last}}{{/allParams}}); {{#returnType}} print(result); @@ -74,7 +74,7 @@ try { {{^allParams}}This endpoint does not need any parameter.{{/allParams}}{{#allParams}}{{#-last}} Name | Type | Description | Notes ------------- | ------------- | ------------- | -------------{{/-last}}{{/allParams}} -{{#allParams}} **{{{paramName}}}** | {{#isPrimitiveType}}**{{{dataType}}}**{{/isPrimitiveType}}{{^isPrimitiveType}}[**{{{dataType}}}**]({{{baseType}}}.md){{/isPrimitiveType}}| {{{description}}} | {{^required}}[optional] {{/required}}{{#defaultValue}}[default to {{{defaultValue}}}]{{/defaultValue}} +{{#allParams}} **{{{paramName}}}** | {{#isPrimitiveType}}**{{{dataType}}}**{{/isPrimitiveType}}{{^isPrimitiveType}}[**{{{dataType}}}**]({{{baseType}}}.md){{/isPrimitiveType}}| {{{description}}} | {{^required}}[optional] {{/required}}{{#defaultValue}}[default to {{{.}}}]{{/defaultValue}} {{/allParams}} ### Return type diff --git a/modules/openapi-generator/src/main/resources/dart2/api_test.mustache b/modules/openapi-generator/src/main/resources/dart2/api_test.mustache index eb0aeb07643..319945b2c3b 100644 --- a/modules/openapi-generator/src/main/resources/dart2/api_test.mustache +++ b/modules/openapi-generator/src/main/resources/dart2/api_test.mustache @@ -18,7 +18,7 @@ void main() { // {{{.}}} // {{/notes}} - //{{#returnType}}Future<{{{returnType}}}> {{/returnType}}{{^returnType}}Future {{/returnType}}{{{operationId}}}({{#allParams}}{{#required}}{{{dataType}}} {{{paramName}}}{{^-last}}, {{/-last}}{{/required}}{{/allParams}}{{#hasOptionalParams}}{ {{#allParams}}{{^required}}{{{dataType}}} {{{paramName}}}{{^-last}}, {{/-last}}{{/required}}{{/allParams}} }{{/hasOptionalParams}}) async + //{{#returnType}}Future<{{{.}}}> {{/returnType}}{{^returnType}}Future {{/returnType}}{{{operationId}}}({{#allParams}}{{#required}}{{{dataType}}} {{{paramName}}}{{^-last}}, {{/-last}}{{/required}}{{/allParams}}{{#hasOptionalParams}}{ {{#allParams}}{{^required}}{{{dataType}}} {{{paramName}}}{{^-last}}, {{/-last}}{{/required}}{{/allParams}} }{{/hasOptionalParams}}) async test('test {{{operationId}}}', () async { // TODO }); diff --git a/modules/openapi-generator/src/main/resources/dart2/apilib.mustache b/modules/openapi-generator/src/main/resources/dart2/apilib.mustache index df10d804011..e2233d95ec4 100644 --- a/modules/openapi-generator/src/main/resources/dart2/apilib.mustache +++ b/modules/openapi-generator/src/main/resources/dart2/apilib.mustache @@ -1,5 +1,5 @@ {{>header}} -{{#pubLibrary}}library {{{pubLibrary}}};{{/pubLibrary}}{{^pubLibrary}}library {{{pubName}}}.api;{{/pubLibrary}} +{{#pubLibrary}}library {{{.}}};{{/pubLibrary}}{{^pubLibrary}}library {{{pubName}}}.api;{{/pubLibrary}} import 'dart:async'; import 'dart:convert'; diff --git a/modules/openapi-generator/src/main/resources/dart2/auth/part_of.mustache b/modules/openapi-generator/src/main/resources/dart2/auth/part_of.mustache index d9f1d409755..d31ade25036 100644 --- a/modules/openapi-generator/src/main/resources/dart2/auth/part_of.mustache +++ b/modules/openapi-generator/src/main/resources/dart2/auth/part_of.mustache @@ -1 +1 @@ -{{#pubLibrary}}part of {{{pubLibrary}}};{{/pubLibrary}}{{^pubLibrary}}part of {{{pubName}}}.api;{{/pubLibrary}} +{{#pubLibrary}}part of {{{.}}};{{/pubLibrary}}{{^pubLibrary}}part of {{{pubName}}}.api;{{/pubLibrary}} diff --git a/modules/openapi-generator/src/main/resources/dart2/git_push.sh.mustache b/modules/openapi-generator/src/main/resources/dart2/git_push.sh.mustache index 8b3f689c912..f0bed5bd841 100755 --- a/modules/openapi-generator/src/main/resources/dart2/git_push.sh.mustache +++ b/modules/openapi-generator/src/main/resources/dart2/git_push.sh.mustache @@ -55,4 +55,3 @@ git pull origin master # Pushes (Forces) the changes in the local repository up to the remote repository echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" git push origin master 2>&1 | grep -v 'To https' - diff --git a/modules/openapi-generator/src/main/resources/dart2/gitignore.mustache b/modules/openapi-generator/src/main/resources/dart2/gitignore.mustache index 7c280441649..8b7331fd822 100644 --- a/modules/openapi-generator/src/main/resources/dart2/gitignore.mustache +++ b/modules/openapi-generator/src/main/resources/dart2/gitignore.mustache @@ -9,7 +9,7 @@ build/ **/packages/ # Files created by dart2js -# (Most Dart developers will use pub build to compile Dart, use/modify these +# (Most Dart developers will use pub build to compile Dart, use/modify these # rules if you intend to use dart2js directly # Convention is to use extension '.dart.js' for Dart compiled to Javascript to # differentiate from explicit Javascript files) @@ -22,6 +22,6 @@ build/ # Directory created by dartdoc doc/api/ -# Don't commit pubspec lock file +# Don't commit pubspec lock file # (Library packages only! Remove pattern if developing an application package) pubspec.lock diff --git a/modules/openapi-generator/src/main/resources/dart2/model_test.mustache b/modules/openapi-generator/src/main/resources/dart2/model_test.mustache index 7de9c7b840e..5d4f1c161c5 100644 --- a/modules/openapi-generator/src/main/resources/dart2/model_test.mustache +++ b/modules/openapi-generator/src/main/resources/dart2/model_test.mustache @@ -13,7 +13,7 @@ void main() { group('test {{{classname}}}', () { {{#vars}} {{#description}} - // {{{description}}} + // {{{.}}} {{/description}} // {{{dataType}}} {{{name}}}{{#defaultValue}} (default value: {{{.}}}){{/defaultValue}} test('to test the property `{{{name}}}`', () async { diff --git a/modules/openapi-generator/src/main/resources/dart2/object_doc.mustache b/modules/openapi-generator/src/main/resources/dart2/object_doc.mustache index 94402b858e0..441b2c7bd1b 100644 --- a/modules/openapi-generator/src/main/resources/dart2/object_doc.mustache +++ b/modules/openapi-generator/src/main/resources/dart2/object_doc.mustache @@ -8,7 +8,7 @@ import 'package:{{{pubName}}}/api.dart'; ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -{{#vars}}**{{{name}}}** | {{#isPrimitiveType}}**{{{dataType}}}**{{/isPrimitiveType}}{{^isPrimitiveType}}[**{{{dataType}}}**]({{{complexType}}}.md){{/isPrimitiveType}} | {{{description}}} | {{^required}}[optional] {{/required}}{{#isReadOnly}}[readonly] {{/isReadOnly}}{{#defaultValue}}[default to {{{defaultValue}}}]{{/defaultValue}} +{{#vars}}**{{{name}}}** | {{#isPrimitiveType}}**{{{dataType}}}**{{/isPrimitiveType}}{{^isPrimitiveType}}[**{{{dataType}}}**]({{{complexType}}}.md){{/isPrimitiveType}} | {{{description}}} | {{^required}}[optional] {{/required}}{{#isReadOnly}}[readonly] {{/isReadOnly}}{{#defaultValue}}[default to {{{.}}}]{{/defaultValue}} {{/vars}} [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/modules/openapi-generator/src/main/resources/dart2/part_of.mustache b/modules/openapi-generator/src/main/resources/dart2/part_of.mustache index d9f1d409755..d31ade25036 100644 --- a/modules/openapi-generator/src/main/resources/dart2/part_of.mustache +++ b/modules/openapi-generator/src/main/resources/dart2/part_of.mustache @@ -1 +1 @@ -{{#pubLibrary}}part of {{{pubLibrary}}};{{/pubLibrary}}{{^pubLibrary}}part of {{{pubName}}}.api;{{/pubLibrary}} +{{#pubLibrary}}part of {{{.}}};{{/pubLibrary}}{{^pubLibrary}}part of {{{pubName}}}.api;{{/pubLibrary}} diff --git a/modules/openapi-generator/src/main/resources/dart2/serialization/json_serializable/json_serializable_class.mustache b/modules/openapi-generator/src/main/resources/dart2/serialization/json_serializable/json_serializable_class.mustache index 3a9ff0362b3..f3c1ba77cb6 100644 --- a/modules/openapi-generator/src/main/resources/dart2/serialization/json_serializable/json_serializable_class.mustache +++ b/modules/openapi-generator/src/main/resources/dart2/serialization/json_serializable/json_serializable_class.mustache @@ -9,19 +9,19 @@ class {{{classname}}} { {{#vars}} {{#description}} - /// {{{description}}} + /// {{{.}}} {{/description}} {{^isEnum}} {{#minimum}} - // minimum: {{{minimum}}} + // minimum: {{{.}}} {{/minimum}} {{#maximum}} - // maximum: {{{maximum}}} + // maximum: {{{.}}} {{/maximum}} {{/isEnum}} {{^isBinary}} @JsonKey( - {{#defaultValue}}defaultValue: {{{defaultValue}}},{{/defaultValue}}{{^defaultValue}}nullable: {{isNullable}},{{/defaultValue}} + {{#defaultValue}}defaultValue: {{{.}}},{{/defaultValue}}{{^defaultValue}}nullable: {{isNullable}},{{/defaultValue}} name: r'{{{baseName}}}', required: {{#required}}true{{/required}}{{^required}}false{{/required}}, ) diff --git a/modules/openapi-generator/src/main/resources/dart2/serialization/json_serializable/json_serializable_enum_inline.mustache b/modules/openapi-generator/src/main/resources/dart2/serialization/json_serializable/json_serializable_enum_inline.mustache index 5249f86b398..6e9f9016750 100644 --- a/modules/openapi-generator/src/main/resources/dart2/serialization/json_serializable/json_serializable_enum_inline.mustache +++ b/modules/openapi-generator/src/main/resources/dart2/serialization/json_serializable/json_serializable_enum_inline.mustache @@ -1,4 +1,4 @@ -{{#description}}/// {{{description}}}{{/description}} +{{#description}}/// {{{.}}}{{/description}} enum {{{enumName}}} { {{#allowableValues}} {{#enumVars}} diff --git a/modules/openapi-generator/src/main/resources/dart2/serialization/native/native_class.mustache b/modules/openapi-generator/src/main/resources/dart2/serialization/native/native_class.mustache index 1d599915a0a..396236bd6f5 100644 --- a/modules/openapi-generator/src/main/resources/dart2/serialization/native/native_class.mustache +++ b/modules/openapi-generator/src/main/resources/dart2/serialization/native/native_class.mustache @@ -3,14 +3,14 @@ class {{{classname}}} { {{#vars}} {{#description}} - /// {{{description}}} + /// {{{.}}} {{/description}} {{^isEnum}} {{#minimum}} - // minimum: {{{minimum}}} + // minimum: {{{.}}} {{/minimum}} {{#maximum}} - // maximum: {{{maximum}}} + // maximum: {{{.}}} {{/maximum}} {{/isEnum}} {{{datatypeWithEnum}}} {{{name}}}; diff --git a/modules/openapi-generator/src/main/resources/dart2/serialization/native/native_enum.mustache b/modules/openapi-generator/src/main/resources/dart2/serialization/native/native_enum.mustache index d3ba3f350a8..e9c7e5d2d72 100644 --- a/modules/openapi-generator/src/main/resources/dart2/serialization/native/native_enum.mustache +++ b/modules/openapi-generator/src/main/resources/dart2/serialization/native/native_enum.mustache @@ -1,4 +1,4 @@ -{{#description}}/// {{{description}}}{{/description}} +{{#description}}/// {{{.}}}{{/description}} class {{{classname}}} { /// Instantiate a new enum with the provided [value]. const {{{classname}}}._(this.value); diff --git a/modules/openapi-generator/src/main/resources/dart2/serialization/native/native_enum_inline.mustache b/modules/openapi-generator/src/main/resources/dart2/serialization/native/native_enum_inline.mustache index d14c5a5648a..139f4d02879 100644 --- a/modules/openapi-generator/src/main/resources/dart2/serialization/native/native_enum_inline.mustache +++ b/modules/openapi-generator/src/main/resources/dart2/serialization/native/native_enum_inline.mustache @@ -1,4 +1,4 @@ -{{#description}}/// {{{description}}}{{/description}} +{{#description}}/// {{{.}}}{{/description}} class {{{enumName}}} { /// Instantiate a new enum with the provided [value]. const {{{enumName}}}._(this.value); diff --git a/modules/openapi-generator/src/main/resources/elixir/api.mustache b/modules/openapi-generator/src/main/resources/elixir/api.mustache index 7979112f560..eb923cb3920 100644 --- a/modules/openapi-generator/src/main/resources/elixir/api.mustache +++ b/modules/openapi-generator/src/main/resources/elixir/api.mustache @@ -35,7 +35,7 @@ defmodule {{moduleName}}.Api.{{classname}} do {{/optionalParams}} ## Returns - {:ok, {{#isArray}}[%{{&returnBaseType}}{}, ...]{{/isArray}}{{#isMap}}%{}{{/isMap}}{{^returnType}}nil{{/returnType}}{{#returnSimpleType}}{{#returnType}}{{#isMap}}{{/isMap}}{{{returnType}}}{{/returnType}}{{/returnSimpleType}}} on success + {:ok, {{#isArray}}[%{{&returnBaseType}}{}, ...]{{/isArray}}{{#isMap}}%{}{{/isMap}}{{^returnType}}nil{{/returnType}}{{#returnSimpleType}}{{#returnType}}{{{.}}}{{/returnType}}{{/returnSimpleType}}} on success {:error, Tesla.Env.t} on failure """ {{{typespec}}} diff --git a/modules/openapi-generator/src/main/resources/elixir/connection.ex.mustache b/modules/openapi-generator/src/main/resources/elixir/connection.ex.mustache index 80104900463..fe86fe1f06b 100644 --- a/modules/openapi-generator/src/main/resources/elixir/connection.ex.mustache +++ b/modules/openapi-generator/src/main/resources/elixir/connection.ex.mustache @@ -16,7 +16,7 @@ defmodule {{moduleName}}.Connection do {{#isOAuth}} @scopes [ {{#scopes}} - "{{scope}}"{{^-last}},{{/-last}} {{#description}}# {{description}}{{/description}} + "{{scope}}"{{^-last}},{{/-last}} {{#description}}# {{.}}{{/description}} {{/scopes}} ] diff --git a/modules/openapi-generator/src/main/resources/elixir/licenseInfo.mustache b/modules/openapi-generator/src/main/resources/elixir/licenseInfo.mustache index b364930dee9..6e4e7a44c6c 100644 --- a/modules/openapi-generator/src/main/resources/elixir/licenseInfo.mustache +++ b/modules/openapi-generator/src/main/resources/elixir/licenseInfo.mustache @@ -1,4 +1,4 @@ -{{#licenseHeader}}{{licenseHeader}} +{{#licenseHeader}}{{.}} {{/licenseHeader}} # NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/modules/openapi-generator/src/main/resources/elm/README.mustache b/modules/openapi-generator/src/main/resources/elm/README.mustache index 932f287c0fa..36be424bcda 100644 --- a/modules/openapi-generator/src/main/resources/elm/README.mustache +++ b/modules/openapi-generator/src/main/resources/elm/README.mustache @@ -1,7 +1,7 @@ # Elm API client {{#appDescriptionWithNewLines}} -{{{appDescriptionWithNewLines}}} +{{{.}}} {{/appDescriptionWithNewLines}} ## Overview diff --git a/modules/openapi-generator/src/main/resources/elm/licenseInfo.mustache b/modules/openapi-generator/src/main/resources/elm/licenseInfo.mustache index 19a72ee6240..9ee1c264742 100644 --- a/modules/openapi-generator/src/main/resources/elm/licenseInfo.mustache +++ b/modules/openapi-generator/src/main/resources/elm/licenseInfo.mustache @@ -3,10 +3,10 @@ {{{appDescription}}} {{#version}} - The version of the OpenAPI document: {{{version}}} + The version of the OpenAPI document: {{{.}}} {{/version}} {{#infoEmail}} - Contact: {{{infoEmail}}} + Contact: {{{.}}} {{/infoEmail}} NOTE: This file is auto generated by the openapi-generator. diff --git a/modules/openapi-generator/src/main/resources/elm/operation.mustache b/modules/openapi-generator/src/main/resources/elm/operation.mustache index de4d54d1798..496e7954f69 100644 --- a/modules/openapi-generator/src/main/resources/elm/operation.mustache +++ b/modules/openapi-generator/src/main/resources/elm/operation.mustache @@ -33,7 +33,7 @@ import Uuid exposing (Uuid){{/includeUuid}} {-| {{{notes}}} -} {{/notes}} -{{operationId}} : {{#allParams}}{{^required}}Maybe {{/required}}{{#isArray}}List {{/isArray}}{{#datatypeWithEnum}}{{.}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{#isModel}}Api.Data.{{/isModel}}{{dataType}}{{/datatypeWithEnum}} -> {{/allParams}}{{#authMethods}}{{#isBasicBearer}}String -> {{/isBasicBearer}}{{/authMethods}}Api.Request {{^responses}}(){{/responses}}{{#responses}}{{#is2xx}}{{^dataType}}(){{/dataType}}{{#isMap}}(Dict.Dict String {{/isMap}}{{#isArray}}(List {{#items}}{{#isModel}}Api.Data.{{/isModel}}{{/items}}{{/isArray}}{{^isArray}}{{^primitiveType}}{{^isUuid}}Api.Data.{{/isUuid}}{{/primitiveType}}{{/isArray}}{{dataType}}{{#isArray}}){{/isArray}}{{#isMap}}){{/isMap}}{{/is2xx}}{{/responses}} +{{operationId}} : {{#allParams}}{{^required}}Maybe {{/required}}{{#isArray}}List {{/isArray}}{{datatypeWithEnum}}{{^datatypeWithEnum}}{{#isModel}}Api.Data.{{/isModel}}{{dataType}}{{/datatypeWithEnum}} -> {{/allParams}}{{#authMethods}}{{#isBasicBearer}}String -> {{/isBasicBearer}}{{/authMethods}}Api.Request {{^responses}}(){{/responses}}{{#responses}}{{#is2xx}}{{^dataType}}(){{/dataType}}{{#isMap}}(Dict.Dict String {{/isMap}}{{#isArray}}(List {{#items}}{{#isModel}}Api.Data.{{/isModel}}{{/items}}{{/isArray}}{{^isArray}}{{^primitiveType}}{{^isUuid}}Api.Data.{{/isUuid}}{{/primitiveType}}{{/isArray}}{{dataType}}{{#isArray}}){{/isArray}}{{#isMap}}){{/isMap}}{{/is2xx}}{{/responses}} {{operationId}}{{#allParams}} {{>paramName}}{{/allParams}}{{#authMethods}}{{#isBasicBearer}} auth_token{{/isBasicBearer}}{{/authMethods}} = Api.request "{{httpMethod}}" diff --git a/modules/openapi-generator/src/main/resources/erlang-client/api.mustache b/modules/openapi-generator/src/main/resources/erlang-client/api.mustache index ddb5dee0138..3d7162eca51 100644 --- a/modules/openapi-generator/src/main/resources/erlang-client/api.mustache +++ b/modules/openapi-generator/src/main/resources/erlang-client/api.mustache @@ -11,11 +11,11 @@ {{^notes.isEmpty}} %% {{{notes}}} {{/notes.isEmpty}} --spec {{operationId}}(ctx:ctx(){{#allParams}}{{#required}}, {{{dataType}}}{{/required}}{{/allParams}}) -> {ok, {{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}[]{{/returnType}}, {{packageName}}_utils:response_info()} | {ok, hackney:client_ref()} | {error, term(), {{packageName}}_utils:response_info()}. +-spec {{operationId}}(ctx:ctx(){{#allParams}}{{#required}}, {{{dataType}}}{{/required}}{{/allParams}}) -> {ok, {{{returnType}}}{{^returnType}}[]{{/returnType}}, {{packageName}}_utils:response_info()} | {ok, hackney:client_ref()} | {error, term(), {{packageName}}_utils:response_info()}. {{operationId}}(Ctx{{#allParams}}{{#required}}, {{paramName}}{{/required}}{{/allParams}}) -> {{operationId}}(Ctx{{#allParams}}{{#required}}, {{paramName}}{{/required}}{{/allParams}}, #{}). --spec {{operationId}}(ctx:ctx(){{#allParams}}{{#required}}, {{{dataType}}}{{/required}}{{/allParams}}, maps:map()) -> {ok, {{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}[]{{/returnType}}, {{packageName}}_utils:response_info()} | {ok, hackney:client_ref()} | {error, term(), {{packageName}}_utils:response_info()}. +-spec {{operationId}}(ctx:ctx(){{#allParams}}{{#required}}, {{{dataType}}}{{/required}}{{/allParams}}, maps:map()) -> {ok, {{{returnType}}}{{^returnType}}[]{{/returnType}}, {{packageName}}_utils:response_info()} | {ok, hackney:client_ref()} | {error, term(), {{packageName}}_utils:response_info()}. {{operationId}}(Ctx{{#allParams}}{{#required}}, {{paramName}}{{/required}}{{/allParams}}, Optional) -> _OptionalParams = maps:get(params, Optional, #{}), Cfg = maps:get(cfg, Optional, application:get_env(kuberl, config, #{})), diff --git a/modules/openapi-generator/src/main/resources/erlang-client/app.src.mustache b/modules/openapi-generator/src/main/resources/erlang-client/app.src.mustache index 7d9dc3f55fe..f41c881524a 100644 --- a/modules/openapi-generator/src/main/resources/erlang-client/app.src.mustache +++ b/modules/openapi-generator/src/main/resources/erlang-client/app.src.mustache @@ -1,6 +1,6 @@ {application, {{packageName}}, - [{description, {{#appDescription}}"{{appDescription}}"{{/appDescription}}{{^appDescription}}"OpenAPI client library"{{/appDescription}}}, - {vsn, "{{#apiVersion}}{{apiVersion}}{{/apiVersion}}{{^apiVersion}}0.1.0{{/apiVersion}}"}, + [{description, {{#appDescription}}"{{.}}"{{/appDescription}}{{^appDescription}}"OpenAPI client library"{{/appDescription}}}, + {vsn, "{{apiVersion}}{{^apiVersion}}0.1.0{{/apiVersion}}"}, {registered, []}, {applications, [kernel, @@ -9,10 +9,10 @@ hackney, ctx ]}, - {env, [{host, "{{#host}}{{{host}}}{{/host}}{{^host}}localhost{{/host}}"}]}, + {env, [{host, "{{{host}}}{{^host}}localhost{{/host}}"}]}, {modules, []}, {maintainers, []}, - {licenses, [{{#licenseInfo}}"{{licenseInfo}}"{{/licenseInfo}}]}, - {links, [{{#infoUrl}}"{{infoUrl}}"{{/infoUrl}}]} + {licenses, [{{#licenseInfo}}"{{.}}"{{/licenseInfo}}]}, + {links, [{{#infoUrl}}"{{.}}"{{/infoUrl}}]} ]}. diff --git a/modules/openapi-generator/src/main/resources/erlang-proper/app.src.mustache b/modules/openapi-generator/src/main/resources/erlang-proper/app.src.mustache index 0c9bc9c2ae0..54b3656ffd9 100644 --- a/modules/openapi-generator/src/main/resources/erlang-proper/app.src.mustache +++ b/modules/openapi-generator/src/main/resources/erlang-proper/app.src.mustache @@ -1,6 +1,6 @@ { application, {{packageName}} -, [ {description, {{#appDescription}}"{{appDescription}}"{{/appDescription}}{{^appDescription}}"OpenAPI client library for EQC testing"{{/appDescription}}} - , {vsn, "{{#apiVersion}}{{apiVersion}}{{/apiVersion}}{{^apiVersion}}0.1.0{{/apiVersion}}"} +, [ {description, {{#appDescription}}"{{.}}"{{/appDescription}}{{^appDescription}}"OpenAPI client library for EQC testing"{{/appDescription}}} + , {vsn, "{{apiVersion}}{{^apiVersion}}0.1.0{{/apiVersion}}"} , {registered, []} , { applications , [ kernel @@ -10,12 +10,12 @@ ] } , { env - , [ {host, "http://{{#host}}{{{host}}}{{/host}}{{^host}}localhost:8080{{/host}}"} + , [ {host, "http://{{{host}}}{{^host}}localhost:8080{{/host}}"} , {basic_auth, {"admin", "admin"}} ] } , {modules, []} , {maintainers, []} - , {licenses, [{{#licenseInfo}}"{{licenseInfo}}"{{/licenseInfo}}]} - , {links, [{{#infoUrl}}"{{infoUrl}}"{{/infoUrl}}]} + , {licenses, [{{#licenseInfo}}"{{.}}"{{/licenseInfo}}]} + , {links, [{{#infoUrl}}"{{.}}"{{/infoUrl}}]} ]}. diff --git a/modules/openapi-generator/src/main/resources/erlang-proper/model.mustache b/modules/openapi-generator/src/main/resources/erlang-proper/model.mustache index 6aecad001cf..e82269834dd 100644 --- a/modules/openapi-generator/src/main/resources/erlang-proper/model.mustache +++ b/modules/openapi-generator/src/main/resources/erlang-proper/model.mustache @@ -23,7 +23,7 @@ {{/isEnum}} {{#isArray}} {{classname}}() -> - list({{arrayModelType}}{{#minItems}}, {{minItems}}{{#maxItems}}, {{maxItems}}{{/maxItems}}{{/minItems}}). + list({{arrayModelType}}{{#minItems}}, {{minItems}}{{#maxItems}}, {{.}}{{/maxItems}}{{/minItems}}). {{/isArray}} {{^isEnum}}{{^isArray}} {{classname}}() -> @@ -31,7 +31,7 @@ {{classname}}(Fields) -> Default = [ {{#vars}}{{^-first}} - , {{/-first}}{'{{baseName}}', {{#isString}}{{#isEnum}}elements([{{#allowableValues.values}}{{^-first}}, {{/-first}}<<"{{.}}">>{{/allowableValues.values}}]){{/isEnum}}{{^isEnum}}binary({{#minLength}}{{minLength}}{{#maxLength}}, {{maxLength}}{{/maxLength}}{{/minLength}}){{/isEnum}}{{/isString}}{{^isString}}{{baseType}}{{/isString}} }{{/vars}} + , {{/-first}}{'{{baseName}}', {{#isString}}{{#isEnum}}elements([{{#allowableValues.values}}{{^-first}}, {{/-first}}<<"{{.}}">>{{/allowableValues.values}}]){{/isEnum}}{{^isEnum}}binary({{#minLength}}{{minLength}}{{#maxLength}}, {{.}}{{/maxLength}}{{/minLength}}){{/isEnum}}{{/isString}}{{^isString}}{{baseType}}{{/isString}} }{{/vars}} ], lists:ukeymerge(1, lists:sort(Fields), lists:sort(Default)). {{/isArray}}{{/isEnum}} diff --git a/modules/openapi-generator/src/main/resources/erlang-server/README.mustache b/modules/openapi-generator/src/main/resources/erlang-server/README.mustache index 9593d7162a8..5d36ca07576 100644 --- a/modules/openapi-generator/src/main/resources/erlang-server/README.mustache +++ b/modules/openapi-generator/src/main/resources/erlang-server/README.mustache @@ -55,4 +55,3 @@ Use erlang-server with erlang.mk $erl -pa ./deps/cowboy/ebin -pa ./deps/cowlib/ebin -pa ./deps/ranch/ebin -pa ./deps/jsx/ebin -pa ./deps/jesse/ebin -pa ./deps/rfc3339/ebin -pa ./ebin 4, Start project application:ensure_all_started(http_server). - diff --git a/modules/openapi-generator/src/main/resources/erlang-server/api.mustache b/modules/openapi-generator/src/main/resources/erlang-server/api.mustache index 7a6a7c26a90..b97e4a2c5ec 100644 --- a/modules/openapi-generator/src/main/resources/erlang-server/api.mustache +++ b/modules/openapi-generator/src/main/resources/erlang-server/api.mustache @@ -297,7 +297,7 @@ validation_error(ViolatedRule, Name, Info) -> throw({wrong_param, Name, ViolatedRule, Info}). -spec get_value(body | qs_val | header | binding, Name :: any(), Req0 :: cowboy_req:req()) -> - {Value :: any(), Req :: cowboy_req:req()} | + {Value :: any(), Req :: cowboy_req:req()} | {error, Reason :: any(), Req :: cowboy_req:req()}. get_value(body, _Name, Req0) -> {ok, Body, Req} = cowboy_req:read_body(Req0), @@ -327,7 +327,7 @@ prepare_body(Body) -> <<"">> -> <<"">>; _ -> try - jsx:decode(Body, [return_maps]) + jsx:decode(Body, [return_maps]) catch error:_ -> {error, {invalid_body, not_json, Body}} diff --git a/modules/openapi-generator/src/main/resources/erlang-server/app.src.mustache b/modules/openapi-generator/src/main/resources/erlang-server/app.src.mustache index 5fdef5bf790..a90c4e7cae7 100644 --- a/modules/openapi-generator/src/main/resources/erlang-server/app.src.mustache +++ b/modules/openapi-generator/src/main/resources/erlang-server/app.src.mustache @@ -1,5 +1,5 @@ {application, {{packageName}}, [ - {description, {{#appDescription}}"{{appDescription}}"{{/appDescription}}{{^appDescription}}"OpenAPI rest server library"{{/appDescription}}}, + {description, {{#appDescription}}"{{.}}"{{/appDescription}}{{^appDescription}}"OpenAPI rest server library"{{/appDescription}}}, {vsn, "{{apiVersion}}"}, {registered, []}, {applications, [ @@ -14,6 +14,6 @@ {env, [ ]}, {modules, []}, - {licenses, [{{#licenseInfo}}"{{licenseInfo}}"{{/licenseInfo}}]}, - {links, [{{#infoUrl}}"{{infoUrl}}"{{/infoUrl}}]} + {licenses, [{{#licenseInfo}}"{{.}}"{{/licenseInfo}}]}, + {links, [{{#infoUrl}}"{{.}}"{{/infoUrl}}]} ]}. diff --git a/modules/openapi-generator/src/main/resources/erlang-server/auth.mustache b/modules/openapi-generator/src/main/resources/erlang-server/auth.mustache index 3f3e9e94553..3159e352a9c 100644 --- a/modules/openapi-generator/src/main/resources/erlang-server/auth.mustache +++ b/modules/openapi-generator/src/main/resources/erlang-server/auth.mustache @@ -50,6 +50,3 @@ get_api_key(header, KeyParam, Req) -> get_api_key(qs_val, KeyParam, Req) -> QS = cowboy_req:parse_qs(Req), { {{packageName}}_utils:get_opt(KeyParam, QS), Req}. - - - diff --git a/modules/openapi-generator/src/main/resources/erlang-server/router.mustache b/modules/openapi-generator/src/main/resources/erlang-server/router.mustache index d0136c5a190..e2efc2206bc 100644 --- a/modules/openapi-generator/src/main/resources/erlang-server/router.mustache +++ b/modules/openapi-generator/src/main/resources/erlang-server/router.mustache @@ -76,5 +76,3 @@ prepare_validator() -> get_openapi_path() -> {ok, AppName} = application:get_application(?MODULE), filename:join({{packageName}}_utils:priv_dir(AppName), "{{{openAPISpecName}}}.json"). - - diff --git a/modules/openapi-generator/src/main/resources/fsharp-functions-server/Handler.mustache b/modules/openapi-generator/src/main/resources/fsharp-functions-server/Handler.mustache index 8c8aebc852a..1a87cdd1a97 100644 --- a/modules/openapi-generator/src/main/resources/fsharp-functions-server/Handler.mustache +++ b/modules/openapi-generator/src/main/resources/fsharp-functions-server/Handler.mustache @@ -18,36 +18,36 @@ module {{classname}}Handlers = {{#operation}} //#region {{operationId}} /// - /// {{#summary}}{{summary}}{{/summary}} + /// {{summary}} /// [] let {{operationId}} ([] req:HttpRequest ) = - + {{#hasBodyParam}} use reader = StreamReader(req.Body) let mediaTypes = [{{#consumes}}"{{mediaType}}";{{/consumes}}] // currently unused - + {{#bodyParam}} - let bind (contentType:string) body = - match (contentType.ToLower()) with - | "application/json" -> - body |> JsonConvert.DeserializeObject<{{operationId}}BodyParams> + let bind (contentType:string) body = + match (contentType.ToLower()) with + | "application/json" -> + body |> JsonConvert.DeserializeObject<{{operationId}}BodyParams> | _ -> failwith (sprintf "TODO - ContentType %s not currently supported" contentType) {{/bodyParam}} - let bodyParams = reader.ReadToEnd() |> bind req.ContentType + let bodyParams = reader.ReadToEnd() |> bind req.ContentType let result = {{classname}}Service.{{operationId}} bodyParams {{/hasBodyParam}} {{^hasBodyParam}} let result = {{classname}}Service.{{operationId}} () {{/hasBodyParam}} - match result with + match result with {{#responses}} | {{operationId}}{{#isDefault}}Default{{/isDefault}}StatusCode{{^isDefault}}{{code}}{{/isDefault}} resolved -> - {{^primitiveType}} + {{^primitiveType}} let content = JsonConvert.SerializeObject resolved.content let responseContentType = "application/json" {{/primitiveType}} @@ -55,11 +55,8 @@ module {{classname}}Handlers = let content = resolved.content let responseContentType = "text/plain" {{/primitiveType}} - ContentResult(Content = content, ContentType = responseContentType, StatusCode = System.Nullable({{code}})) + ContentResult(Content = content, ContentType = responseContentType, StatusCode = System.Nullable({{code}})) {{/responses}} {{/operation}} {{/operations}} - - - diff --git a/modules/openapi-generator/src/main/resources/fsharp-functions-server/HandlerParams.mustache b/modules/openapi-generator/src/main/resources/fsharp-functions-server/HandlerParams.mustache index 5b14e1520d1..ca4d361c02c 100644 --- a/modules/openapi-generator/src/main/resources/fsharp-functions-server/HandlerParams.mustache +++ b/modules/openapi-generator/src/main/resources/fsharp-functions-server/HandlerParams.mustache @@ -2,13 +2,13 @@ namespace {{packageName}} {{#imports}} {{#import}} -open {{import}} +open {{.}} {{/import}} {{/imports}} open System.Collections.Generic open System -module {{classname}}HandlerParams = +module {{classname}}HandlerParams = {{#operations}} {{#operation}} @@ -21,7 +21,7 @@ module {{classname}}HandlerParams = {{paramName}} : {{dataType}} {{^required}}option{{/required}}; {{#-last}} } - {{/-last}} + {{/-last}} //#endregion {{/pathParams}} {{#queryParams}} @@ -32,11 +32,11 @@ module {{classname}}HandlerParams = type {{operationId}}QueryParams = { {{/-first}} {{paramName}} : {{dataType}} {{^required}}option{{/required}}; - + {{#-last}} } //#endregion - {{/-last}} + {{/-last}} {{/queryParams}} {{#bodyParams}} @@ -44,10 +44,10 @@ module {{classname}}HandlerParams = //#region Body parameters [] {{#-last}} - type {{operationId}}BodyParams = {{dataType}} + type {{operationId}}BodyParams = {{dataType}} {{/-last}} {{^-last}} - type {{operationId}}BodyParams = { + type {{operationId}}BodyParams = { {{paramName}} : {{dataType}}; {{/-last}} {{/-first}} @@ -59,7 +59,7 @@ module {{classname}}HandlerParams = } {{/-first}} //#endregion - {{/-last}} + {{/-last}} {{/bodyParams}} {{#formParams}} @@ -71,7 +71,7 @@ module {{classname}}HandlerParams = {{paramName}} : {{dataType}} {{^required}}option{{/required}}; {{#-last}} } - {{/-last}} + {{/-last}} //#endregion {{/formParams}} {{#headerParams}} @@ -84,11 +84,11 @@ module {{classname}}HandlerParams = {{paramName}} : {{dataType}} {{^required}}option{{/required}}; {{#-last}} } - {{/-last}} + {{/-last}} //#endregion {{/headerParams}} {{#cookieParams}} - + //#region Cookie parameters {{#-first}} type {{operationId}}CookieParams = { @@ -96,14 +96,14 @@ module {{classname}}HandlerParams = {{paramName}} : {{dataType}} {{^required}}option{{/required}}; {{#-last}} } - {{/-last}} + {{/-last}} //#endregion {{/cookieParams}} {{#responses}} - + type {{operationId}}{{#isDefault}}Default{{/isDefault}}StatusCode{{^isDefault}}{{code}}{{/isDefault}}Response = { - content:{{#dataType}}{{{.}}}{{/dataType}}{{^dataType}}string{{/dataType}}; + content:{{{dataType}}}{{^dataType}}string{{/dataType}}; {{^code}}code:int{{/code}} } {{/responses}} @@ -144,4 +144,3 @@ module {{classname}}HandlerParams = {{/allParams}} {{/operation}} {{/operations}} - \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/fsharp-functions-server/Model.mustache b/modules/openapi-generator/src/main/resources/fsharp-functions-server/Model.mustache index 8084cc0cf8f..97ed754375d 100644 --- a/modules/openapi-generator/src/main/resources/fsharp-functions-server/Model.mustache +++ b/modules/openapi-generator/src/main/resources/fsharp-functions-server/Model.mustache @@ -7,13 +7,13 @@ open Newtonsoft.Json open {{import}} {{/imports}} -module {{classname}} = +module {{classname}} = {{#models}} {{#model}} //#region {{classname}} - {{^allowableValues}} + {{^allowableValues}} [] type {{classname}} = { {{#vars}} @@ -21,15 +21,14 @@ module {{classname}} = {{name}} : {{#isDateTime}}{{^required}}Nullable<{{/required}}{{/isDateTime}}{{{dataType}}}{{#isDateTime}}{{^required}}>{{/required}}{{/isDateTime}}; {{/vars}} } - {{/allowableValues}} + {{/allowableValues}} {{#allowableValues}} {{#enumVars}} let {{name}} = {{#isString}}"{{value}}"{{/isString}}{{#isInteger}}"{{value}}"{{/isInteger}} {{/enumVars}} type {{classname}} = {{#isString}}string{{/isString}}{{#isInteger}}int{{/isInteger}} {{/allowableValues}} - + //#endregion {{/model}} {{/models}} - \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/fsharp-functions-server/Project.fsproj.mustache b/modules/openapi-generator/src/main/resources/fsharp-functions-server/Project.fsproj.mustache index c0b479a470f..b48652f82a7 100644 --- a/modules/openapi-generator/src/main/resources/fsharp-functions-server/Project.fsproj.mustache +++ b/modules/openapi-generator/src/main/resources/fsharp-functions-server/Project.fsproj.mustache @@ -10,7 +10,7 @@ - + PreserveNewest diff --git a/modules/openapi-generator/src/main/resources/fsharp-functions-server/README.mustache b/modules/openapi-generator/src/main/resources/fsharp-functions-server/README.mustache index 9441f3981f6..630bfdb543c 100644 --- a/modules/openapi-generator/src/main/resources/fsharp-functions-server/README.mustache +++ b/modules/openapi-generator/src/main/resources/fsharp-functions-server/README.mustache @@ -64,9 +64,9 @@ Each Service/operation function must accept the [OperationId]Params object and r `type AddPetArgs = { bodyParams:AddPetBodyParams } type IPetApiService = abstract member AddPet:HttpContext -> AddPetArgs->AddPetResult` -[OperationId]Result is a discriminated union of all possible OpenAPI response types for that operation. +[OperationId]Result is a discriminated union of all possible OpenAPI response types for that operation. -This means that service implementations can only return status codes that have been declared in the OpenAPI specification. +This means that service implementations can only return status codes that have been declared in the OpenAPI specification. However, if the OpenAPI spec declares a default Response for an operation, the service can manually set the status code. For example: @@ -93,7 +93,7 @@ Additional handlers can be configured in the Customization.fs `let handlers : HttpHandler list = [ // insert your handlers here - GET >=> + GET >=> choose [ route "/login" >=> redirectToLogin route "/logout" >=> logout @@ -110,7 +110,7 @@ Additional handlers can be configured in the Customization.fs ## .openapi-generator-ignore -It is recommended to add src/impl/** and the project's .fsproj file to the .openapi-generator-ignore file. +It is recommended to add src/impl/** and the project's .fsproj file to the .openapi-generator-ignore file. This will allow you to regenerate model, operation and parameter files without overriding your implementations of business logic, authentication, data layers, and so on. diff --git a/modules/openapi-generator/src/main/resources/fsharp-functions-server/ServiceImpl.mustache b/modules/openapi-generator/src/main/resources/fsharp-functions-server/ServiceImpl.mustache index 543a1030190..a4c82647d3b 100644 --- a/modules/openapi-generator/src/main/resources/fsharp-functions-server/ServiceImpl.mustache +++ b/modules/openapi-generator/src/main/resources/fsharp-functions-server/ServiceImpl.mustache @@ -1,7 +1,7 @@ namespace {{packageName}} {{#imports}} {{#import}} -open {{import}} +open {{.}} {{/import}} {{/imports}} open {{classname}}HandlerParams @@ -10,23 +10,23 @@ open System.Collections.Generic open System module {{classname}}ServiceImplementation = - + //#region Service implementation - type {{classname}}ServiceImpl() = + type {{classname}}ServiceImpl() = interface I{{classname}}Service with - + {{#operations}} {{#operation}} member this.{{operationId}} {{^hasBodyParam}}(){{/hasBodyParam}}{{#hasBodyParam}}(parameters:{{operationId}}BodyParams){{/hasBodyParam}} = {{#responses}} {{#-first}} {{^-last}} - if true then + if true then {{/-last}} {{/-first}} {{^-first}} {{^-last}} - else if true then + else if true then {{/-last}} {{#-last}} else diff --git a/modules/openapi-generator/src/main/resources/fsharp-functions-server/ServiceInterface.mustache b/modules/openapi-generator/src/main/resources/fsharp-functions-server/ServiceInterface.mustache index c57b01778fd..8b4f02e6aff 100644 --- a/modules/openapi-generator/src/main/resources/fsharp-functions-server/ServiceInterface.mustache +++ b/modules/openapi-generator/src/main/resources/fsharp-functions-server/ServiceInterface.mustache @@ -5,9 +5,9 @@ open Microsoft.AspNetCore.Http module {{classname}}ServiceInterface = - + //#region Service interface - type I{{classname}}Service = + type I{{classname}}Service = {{#operations}} {{#operation}} abstract member {{operationId}} : {{^hasBodyParam}}unit{{/hasBodyParam}}{{#hasBodyParam}}{{operationId}}BodyParams{{/hasBodyParam}} -> {{operationId}}Result diff --git a/modules/openapi-generator/src/main/resources/fsharp-functions-server/build.bat.mustache b/modules/openapi-generator/src/main/resources/fsharp-functions-server/build.bat.mustache index 9e7afd0a272..b3ec3de1aea 100644 --- a/modules/openapi-generator/src/main/resources/fsharp-functions-server/build.bat.mustache +++ b/modules/openapi-generator/src/main/resources/fsharp-functions-server/build.bat.mustache @@ -1,3 +1,2 @@ dotnet restore {{packageName}}.fsproj dotnet build {{packageName}}.fsproj - diff --git a/modules/openapi-generator/src/main/resources/fsharp-functions-server/build.sh.mustache b/modules/openapi-generator/src/main/resources/fsharp-functions-server/build.sh.mustache index ab63b07a142..c1cabe1d384 100644 --- a/modules/openapi-generator/src/main/resources/fsharp-functions-server/build.sh.mustache +++ b/modules/openapi-generator/src/main/resources/fsharp-functions-server/build.sh.mustache @@ -1,4 +1,3 @@ #!/bin/sh dotnet restore {{packageName}}.fsproj dotnet build {{packageName}}.fsproj - diff --git a/modules/openapi-generator/src/main/resources/fsharp-giraffe-server/AuthSchemes.mustache b/modules/openapi-generator/src/main/resources/fsharp-giraffe-server/AuthSchemes.mustache index cabb34132a6..8afe7e7ea3a 100644 --- a/modules/openapi-generator/src/main/resources/fsharp-giraffe-server/AuthSchemes.mustache +++ b/modules/openapi-generator/src/main/resources/fsharp-giraffe-server/AuthSchemes.mustache @@ -17,14 +17,14 @@ module AuthSchemes = let accessDenied : HttpHandler = setStatusCode 401 >=> text "Access Denied" - let buildGoogle (builder:AuthenticationBuilder) name authorizationUrl scopes (settings:IConfiguration) = + let buildGoogle (builder:AuthenticationBuilder) name authorizationUrl scopes (settings:IConfiguration) = builder.AddGoogle(fun googleOptions -> CustomHandlers.setOAuthOptions "Google" googleOptions scopes settings) - let buildGitHub (builder:AuthenticationBuilder) name authorizationUrl scopes (settings:IConfiguration) = + let buildGitHub (builder:AuthenticationBuilder) name authorizationUrl scopes (settings:IConfiguration) = builder.AddGitHub(fun githubOptions -> CustomHandlers.setOAuthOptions "GitHub" githubOptions scopes settings) - let buildOAuth (builder:AuthenticationBuilder) (name:string) authorizationUrl scopes (settings:IConfiguration) = - builder.AddOAuth(name, (fun (options:OAuthOptions) -> + let buildOAuth (builder:AuthenticationBuilder) (name:string) authorizationUrl scopes (settings:IConfiguration) = + builder.AddOAuth(name, (fun (options:OAuthOptions) -> options.AuthorizationEndpoint <- authorizationUrl options.TokenEndpoint <- settings.[name + "TokenUrl"] options.CallbackPath <- PathString(settings.[name + "CallbackPath"]) @@ -39,7 +39,7 @@ module AuthSchemes = else if (isNull settings.[name + "ClientSecret"]) then raise (Exception((name + "ClientSecret is not set."))) - let getOAuthBuilder settings name = + let getOAuthBuilder settings name = // check that "xxxClientId" and "xxxClientSecret" configuration variables have been set for all OAuth providers checkEnvironment settings name if OAuthBuilders.ContainsKey(name) then @@ -55,7 +55,7 @@ module AuthSchemes = {{/authMethods}} let buildApiKeyAuth name (services:AuthenticationBuilder) = - services.AddApiKey(fun options -> + services.AddApiKey(fun options -> options.Header <- name options.HeaderKey <- String.Empty let events = ApiKeyEvents() @@ -78,16 +78,16 @@ module AuthSchemes = let configureCookie (builder:AuthenticationBuilder) = builder.AddCookie(CustomHandlers.cookieAuth) - let configureServices (services:IServiceCollection) = + let configureServices (services:IServiceCollection) = let serviceProvider = services.BuildServiceProvider() let settings = serviceProvider.GetService() services.AddAuthentication(fun o -> o.DefaultScheme <- CookieAuthenticationDefaults.AuthenticationScheme) - |> configureOAuth settings + |> configureOAuth settings |> configureApiKeyAuth settings |> configureCookie - - let (|||) v1 v2 = - match v1 with + + let (|||) v1 v2 = + match v1 with | Some v -> v1 | None -> v2 @@ -96,5 +96,3 @@ module AuthSchemes = match ctx.Request.Cookies.TryGetValue key with | true , cookie -> Some cookie | false, _ -> None - - \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/fsharp-giraffe-server/CustomHandlers.mustache b/modules/openapi-generator/src/main/resources/fsharp-giraffe-server/CustomHandlers.mustache index cc176cdb66e..d8fc28a3612 100644 --- a/modules/openapi-generator/src/main/resources/fsharp-giraffe-server/CustomHandlers.mustache +++ b/modules/openapi-generator/src/main/resources/fsharp-giraffe-server/CustomHandlers.mustache @@ -21,7 +21,7 @@ open Microsoft.AspNetCore.Authentication.OAuth open System.Threading.Tasks open AspNet.Security.ApiKey.Providers.Events -module CustomHandlers = +module CustomHandlers = let cookieAuth (o : CookieAuthenticationOptions) = do @@ -30,22 +30,22 @@ module CustomHandlers = o.SlidingExpiration <- true o.ExpireTimeSpan <- TimeSpan.FromDays 7.0 - - let onCreatingTicket name (ctx:OAuthCreatingTicketContext) = + + let onCreatingTicket name (ctx:OAuthCreatingTicketContext) = task { // implement post-authentication logic for oAuth handlers here () } :> Task - let validateApiKey key = + let validateApiKey key = raise (NotImplementedException("API key validation must be implemented")) - let setApiKeyEvents name (events:ApiKeyEvents) = - events.OnApiKeyValidated <- (fun ctx -> + let setApiKeyEvents name (events:ApiKeyEvents) = + events.OnApiKeyValidated <- (fun ctx -> task { // implement your validation/authentication logic for api key handlers here - if validateApiKey ctx.ApiKey then - // to interact properly with Giraffe's handlers, you will need to manually set the identity + if validateApiKey ctx.ApiKey then + // to interact properly with Giraffe's handlers, you will need to manually set the identity // let claims = ... // let identity = ClaimsIdentity(claims, ApiKeyDefaults.AuthenticationScheme) // ctx.HttpContext.User <- ClaimsPrincipal([|identity|]) @@ -54,7 +54,7 @@ module CustomHandlers = ) events - let setOAuthOptions name (options:OAuthOptions) scopes (settings:IConfiguration) = + let setOAuthOptions name (options:OAuthOptions) scopes (settings:IConfiguration) = options.ClientId <- settings.[name + "ClientId"] options.ClientSecret <- settings.[name + "ClientSecret"] for scope in scopes do @@ -63,12 +63,12 @@ module CustomHandlers = options.Events.OnCreatingTicket <- Func(onCreatingTicket name) match name with | "Google" -> - () + () | "GitHub" -> () - | _ -> + | _ -> () - + let logout = signOut CookieAuthenticationDefaults.AuthenticationScheme >=> redirectTo false "/" let loginView = @@ -83,13 +83,13 @@ module CustomHandlers = {{/authMethods}} ] ] - - let redirectToLogin : HttpHandler = - htmlView loginView - + + let redirectToLogin : HttpHandler = + htmlView loginView + let handlers : HttpHandler list = [ // insert your handlers here - GET >=> + GET >=> choose [ route "/login" >=> redirectToLogin {{#authMethods}} @@ -108,5 +108,5 @@ module CustomHandlers = let configureApp (app : IApplicationBuilder) = app - let configureServices (services:IServiceCollection) (authBuilder:AuthenticationBuilder) = + let configureServices (services:IServiceCollection) (authBuilder:AuthenticationBuilder) = () diff --git a/modules/openapi-generator/src/main/resources/fsharp-giraffe-server/Handler.mustache b/modules/openapi-generator/src/main/resources/fsharp-giraffe-server/Handler.mustache index 02d959293c5..1a3a87d3d9d 100644 --- a/modules/openapi-generator/src/main/resources/fsharp-giraffe-server/Handler.mustache +++ b/modules/openapi-generator/src/main/resources/fsharp-giraffe-server/Handler.mustache @@ -9,11 +9,11 @@ open {{classname}}ServiceInterface open {{classname}}ServiceImplementation {{#imports}} {{#import}} -open {{import}} +open {{.}} {{/import}} {{/imports}} -module {{classname}}Handler = +module {{classname}}Handler = {{#operations}} /// @@ -23,17 +23,17 @@ module {{classname}}Handler = {{#operation}} //#region {{operationId}} /// - /// {{#summary}}{{summary}}{{/summary}} + /// {{summary}} /// - let {{operationId}} {{#hasPathParams}}(pathParams:{{operationId}}PathParams){{/hasPathParams}} : HttpHandler = + let {{operationId}} {{#hasPathParams}}(pathParams:{{operationId}}PathParams){{/hasPathParams}} : HttpHandler = fun (next : HttpFunc) (ctx : HttpContext) -> task { {{#hasQueryParams}} let queryParams = ctx.TryBindQueryString<{{operationId}}QueryParams>() {{/hasQueryParams}} {{#hasBodyParam}} - let! bodyParams = + let! bodyParams = ctx.BindJsonAsync<{{operationId}}BodyParams>() {{/hasBodyParam}} {{#hasFormParams}} @@ -52,7 +52,7 @@ module {{classname}}Handler = {{/-first}} {{/allParams}} let result = {{classname}}Service.{{operationId}} ctx {{#allParams}}{{#-first}}serviceArgs{{/-first}}{{/allParams}} - return! (match result with + return! (match result with {{#responses}} | {{operationId}}{{#isDefault}}Default{{/isDefault}}StatusCode{{^isDefault}}{{code}}{{/isDefault}} resolved -> setStatusCode {{code}} >=> {{#primitiveType}}{{^isMap}}text{{/isMap}}{{/primitiveType}}{{^primitiveType}}json{{/primitiveType}} resolved.content @@ -63,5 +63,3 @@ module {{classname}}Handler = {{/operation}} {{/operations}} - - diff --git a/modules/openapi-generator/src/main/resources/fsharp-giraffe-server/HandlerParams.mustache b/modules/openapi-generator/src/main/resources/fsharp-giraffe-server/HandlerParams.mustache index 5b14e1520d1..ca4d361c02c 100644 --- a/modules/openapi-generator/src/main/resources/fsharp-giraffe-server/HandlerParams.mustache +++ b/modules/openapi-generator/src/main/resources/fsharp-giraffe-server/HandlerParams.mustache @@ -2,13 +2,13 @@ namespace {{packageName}} {{#imports}} {{#import}} -open {{import}} +open {{.}} {{/import}} {{/imports}} open System.Collections.Generic open System -module {{classname}}HandlerParams = +module {{classname}}HandlerParams = {{#operations}} {{#operation}} @@ -21,7 +21,7 @@ module {{classname}}HandlerParams = {{paramName}} : {{dataType}} {{^required}}option{{/required}}; {{#-last}} } - {{/-last}} + {{/-last}} //#endregion {{/pathParams}} {{#queryParams}} @@ -32,11 +32,11 @@ module {{classname}}HandlerParams = type {{operationId}}QueryParams = { {{/-first}} {{paramName}} : {{dataType}} {{^required}}option{{/required}}; - + {{#-last}} } //#endregion - {{/-last}} + {{/-last}} {{/queryParams}} {{#bodyParams}} @@ -44,10 +44,10 @@ module {{classname}}HandlerParams = //#region Body parameters [] {{#-last}} - type {{operationId}}BodyParams = {{dataType}} + type {{operationId}}BodyParams = {{dataType}} {{/-last}} {{^-last}} - type {{operationId}}BodyParams = { + type {{operationId}}BodyParams = { {{paramName}} : {{dataType}}; {{/-last}} {{/-first}} @@ -59,7 +59,7 @@ module {{classname}}HandlerParams = } {{/-first}} //#endregion - {{/-last}} + {{/-last}} {{/bodyParams}} {{#formParams}} @@ -71,7 +71,7 @@ module {{classname}}HandlerParams = {{paramName}} : {{dataType}} {{^required}}option{{/required}}; {{#-last}} } - {{/-last}} + {{/-last}} //#endregion {{/formParams}} {{#headerParams}} @@ -84,11 +84,11 @@ module {{classname}}HandlerParams = {{paramName}} : {{dataType}} {{^required}}option{{/required}}; {{#-last}} } - {{/-last}} + {{/-last}} //#endregion {{/headerParams}} {{#cookieParams}} - + //#region Cookie parameters {{#-first}} type {{operationId}}CookieParams = { @@ -96,14 +96,14 @@ module {{classname}}HandlerParams = {{paramName}} : {{dataType}} {{^required}}option{{/required}}; {{#-last}} } - {{/-last}} + {{/-last}} //#endregion {{/cookieParams}} {{#responses}} - + type {{operationId}}{{#isDefault}}Default{{/isDefault}}StatusCode{{^isDefault}}{{code}}{{/isDefault}}Response = { - content:{{#dataType}}{{{.}}}{{/dataType}}{{^dataType}}string{{/dataType}}; + content:{{{dataType}}}{{^dataType}}string{{/dataType}}; {{^code}}code:int{{/code}} } {{/responses}} @@ -144,4 +144,3 @@ module {{classname}}HandlerParams = {{/allParams}} {{/operation}} {{/operations}} - \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/fsharp-giraffe-server/Helpers.mustache b/modules/openapi-generator/src/main/resources/fsharp-giraffe-server/Helpers.mustache index 6dcbe4ad94c..5297ff25180 100644 --- a/modules/openapi-generator/src/main/resources/fsharp-giraffe-server/Helpers.mustache +++ b/modules/openapi-generator/src/main/resources/fsharp-giraffe-server/Helpers.mustache @@ -1,12 +1,12 @@ namespace OpenAPI - module Helpers = + module Helpers = let (>=>) switch1 switch2 = - match switch1 with - | Ok v1 -> - match switch2 with + match switch1 with + | Ok v1 -> + match switch2 with | Ok v2 -> Ok(v1, v2) - | Error e -> Error e + | Error e -> Error e | Error e -> Error e \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/fsharp-giraffe-server/Model.mustache b/modules/openapi-generator/src/main/resources/fsharp-giraffe-server/Model.mustache index de115478e26..afb74b9a1ac 100644 --- a/modules/openapi-generator/src/main/resources/fsharp-giraffe-server/Model.mustache +++ b/modules/openapi-generator/src/main/resources/fsharp-giraffe-server/Model.mustache @@ -6,7 +6,7 @@ open System.Collections.Generic open {{import}} {{/imports}} -module {{classname}} = +module {{classname}} = {{#models}} {{#model}} @@ -33,4 +33,3 @@ module {{classname}} = //#endregion {{/model}} {{/models}} - \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/fsharp-giraffe-server/Program.mustache b/modules/openapi-generator/src/main/resources/fsharp-giraffe-server/Program.mustache index 74f0f7b2af9..7029285307a 100644 --- a/modules/openapi-generator/src/main/resources/fsharp-giraffe-server/Program.mustache +++ b/modules/openapi-generator/src/main/resources/fsharp-giraffe-server/Program.mustache @@ -45,7 +45,7 @@ module App = let HttpPut = PUT let HttpDelete = DELETE - let authFailure : HttpHandler = + let authFailure : HttpHandler = setStatusCode 401 >=> text "You must be authenticated to access this resource." let webApp = @@ -58,7 +58,7 @@ module App = {{/operation}} {{/operations}} {{/apis}} - RequestErrors.notFound (text "Not Found") + RequestErrors.notFound (text "Not Found") {{/apiInfo}} ]) // --------------------------------- @@ -72,13 +72,13 @@ module App = .UseResponseCaching() |> ignore CustomHandlers.configureApp app |> ignore app.UseGiraffe webApp |> ignore - + let configureServices (services : IServiceCollection) = services .AddResponseCaching() .AddGiraffe() - |> AuthSchemes.configureServices + |> AuthSchemes.configureServices |> CustomHandlers.configureServices services |> ignore services.AddDataProtection() |> ignore diff --git a/modules/openapi-generator/src/main/resources/fsharp-giraffe-server/README.mustache b/modules/openapi-generator/src/main/resources/fsharp-giraffe-server/README.mustache index 21d41400b22..8f02693beb9 100644 --- a/modules/openapi-generator/src/main/resources/fsharp-giraffe-server/README.mustache +++ b/modules/openapi-generator/src/main/resources/fsharp-giraffe-server/README.mustache @@ -64,9 +64,9 @@ Each Service/operation function must accept the [OperationId]Params object and r `type AddPetArgs = { bodyParams:AddPetBodyParams } type IPetApiService = abstract member AddPet:HttpContext -> AddPetArgs->AddPetResult` -[OperationId]Result is a discriminated union of all possible OpenAPI response types for that operation. +[OperationId]Result is a discriminated union of all possible OpenAPI response types for that operation. -This means that service implementations can only return status codes that have been declared in the OpenAPI specification. +This means that service implementations can only return status codes that have been declared in the OpenAPI specification. However, if the OpenAPI spec declares a default Response for an operation, the service can manually set the status code. For example: @@ -75,7 +75,7 @@ For example: type FindPetsByStatusStatusCode400Response = { content:string; } type FindPetsByStatusResult = FindPetsByStatusDefaultStatusCode of FindPetsByStatusDefaultStatusCodeResponse | FindPetsByStatusStatusCode400 of FindPetsByStatusStatusCode400Response` -## Note on nullable/optional properties +## Note on nullable/optional properties Currently, handler parameters and models do not distinguish between required properties and optional (or nullable) properties***. @@ -121,7 +121,7 @@ Additional handlers can be configured in the Customization.fs `let handlers : HttpHandler list = [ // insert your handlers here - GET >=> + GET >=> choose [ route "/login" >=> redirectToLogin route "/logout" >=> logout @@ -165,7 +165,7 @@ You must implement your own validation logic for the key in CustomHandlers.setAp ## .openapi-generator-ignore -It is recommended to add src/impl/** and the project's .fsproj file to the .openapi-generator-ignore file. +It is recommended to add src/impl/** and the project's .fsproj file to the .openapi-generator-ignore file. This will allow you to regenerate model, operation and parameter files without overriding your implementations of business logic, authentication, data layers, and so on. diff --git a/modules/openapi-generator/src/main/resources/fsharp-giraffe-server/ServiceImpl.mustache b/modules/openapi-generator/src/main/resources/fsharp-giraffe-server/ServiceImpl.mustache index 0ab72e64e77..a43ba4f2f8d 100644 --- a/modules/openapi-generator/src/main/resources/fsharp-giraffe-server/ServiceImpl.mustache +++ b/modules/openapi-generator/src/main/resources/fsharp-giraffe-server/ServiceImpl.mustache @@ -1,7 +1,7 @@ namespace {{packageName}} {{#imports}} {{#import}} -open {{import}} +open {{.}} {{/import}} {{/imports}} open {{classname}}HandlerParams @@ -11,23 +11,23 @@ open System open Giraffe module {{classname}}ServiceImplementation = - + //#region Service implementation - type {{classname}}ServiceImpl() = + type {{classname}}ServiceImpl() = interface I{{classname}}Service with - + {{#operations}} {{#operation}} member this.{{operationId}} ctx {{#allParams}}{{#-first}}args{{/-first}}{{/allParams}} = {{#responses}} {{#-first}} {{^-last}} - if true then + if true then {{/-last}} {{/-first}} {{^-first}} {{^-last}} - else if true then + else if true then {{/-last}} {{#-last}} else diff --git a/modules/openapi-generator/src/main/resources/fsharp-giraffe-server/ServiceInterface.mustache b/modules/openapi-generator/src/main/resources/fsharp-giraffe-server/ServiceInterface.mustache index 68b14c67c26..41d887e2131 100644 --- a/modules/openapi-generator/src/main/resources/fsharp-giraffe-server/ServiceInterface.mustache +++ b/modules/openapi-generator/src/main/resources/fsharp-giraffe-server/ServiceInterface.mustache @@ -6,9 +6,9 @@ open Microsoft.AspNetCore.Http module {{classname}}ServiceInterface = - + //#region Service interface - type I{{classname}}Service = + type I{{classname}}Service = {{#operations}} {{#operation}} abstract member {{operationId}}:HttpContext {{#allParams}}{{#-first}}-> {{operationId}}Args{{/-first}}{{/allParams}}->{{operationId}}Result diff --git a/modules/openapi-generator/src/main/resources/fsharp-giraffe-server/TestHelper.mustache b/modules/openapi-generator/src/main/resources/fsharp-giraffe-server/TestHelper.mustache index c8437d7002e..e72e3664fdf 100644 --- a/modules/openapi-generator/src/main/resources/fsharp-giraffe-server/TestHelper.mustache +++ b/modules/openapi-generator/src/main/resources/fsharp-giraffe-server/TestHelper.mustache @@ -12,7 +12,7 @@ open FSharp.Control.Tasks.V2.ContextInsensitive open Xunit open System.Text -module TestHelper = +module TestHelper = // --------------------------------- // Test server/client setup // --------------------------------- @@ -70,14 +70,14 @@ module TestHelper = let readText (response : HttpResponseMessage) = response.Content.ReadAsStringAsync() - |> Async.AwaitTask + |> Async.AwaitTask |> Async.RunSynchronously let shouldEqual expected actual = Assert.Equal(expected, actual) - let getConverter mediaType = - (fun (x:string) -> + let getConverter mediaType = + (fun (x:string) -> match mediaType with | "application/x-www-form-urlencoded" -> raise (NotSupportedException()) // TODO - implement FormUrlEncodedContent | _ -> x |> Encoding.UTF8.GetBytes |> MemoryStream |> StreamContent) \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/fsharp-giraffe-server/build.bat.mustache b/modules/openapi-generator/src/main/resources/fsharp-giraffe-server/build.bat.mustache index 5c6ac5b1d17..fbe14427eb1 100644 --- a/modules/openapi-generator/src/main/resources/fsharp-giraffe-server/build.bat.mustache +++ b/modules/openapi-generator/src/main/resources/fsharp-giraffe-server/build.bat.mustache @@ -1,3 +1,2 @@ dotnet restore src/{{packageName}}.fsproj dotnet build src/{{packageName}}.fsproj - diff --git a/modules/openapi-generator/src/main/resources/fsharp-giraffe-server/build.sh.mustache b/modules/openapi-generator/src/main/resources/fsharp-giraffe-server/build.sh.mustache index 2a97c479bc9..ebf8f4ca9b0 100644 --- a/modules/openapi-generator/src/main/resources/fsharp-giraffe-server/build.sh.mustache +++ b/modules/openapi-generator/src/main/resources/fsharp-giraffe-server/build.sh.mustache @@ -1,4 +1,3 @@ #!/bin/sh dotnet restore src/{{packageName}}.fsproj dotnet build src/{{packageName}}.fsproj - diff --git a/modules/openapi-generator/src/main/resources/go-deprecated/README.mustache b/modules/openapi-generator/src/main/resources/go-deprecated/README.mustache index 2e52e206175..94cc83ad70c 100644 --- a/modules/openapi-generator/src/main/resources/go-deprecated/README.mustache +++ b/modules/openapi-generator/src/main/resources/go-deprecated/README.mustache @@ -1,7 +1,7 @@ # Go API client for {{packageName}} {{#appDescriptionWithNewLines}} -{{{appDescriptionWithNewLines}}} +{{{.}}} {{/appDescriptionWithNewLines}} ## Overview @@ -43,7 +43,7 @@ All URIs are relative to *{{basePath}}* Class | Method | HTTP request | Description ------------ | ------------- | ------------- | ------------- -{{#apiInfo}}{{#apis}}{{#operations}}{{#operation}}*{{classname}}* | [**{{operationId}}**]({{apiDocPath}}{{classname}}.md#{{operationIdLowerCase}}) | **{{httpMethod}}** {{path}} | {{#summary}}{{summary}}{{/summary}} +{{#apiInfo}}{{#apis}}{{#operations}}{{#operation}}*{{classname}}* | [**{{operationId}}**]({{apiDocPath}}{{classname}}.md#{{operationIdLowerCase}}) | **{{httpMethod}}** {{path}} | {{summary}} {{/operation}}{{/operations}}{{/apis}}{{/apiInfo}} ## Documentation For Models diff --git a/modules/openapi-generator/src/main/resources/go-deprecated/api.mustache b/modules/openapi-generator/src/main/resources/go-deprecated/api.mustache index f85854a4fc9..b837934add7 100644 --- a/modules/openapi-generator/src/main/resources/go-deprecated/api.mustache +++ b/modules/openapi-generator/src/main/resources/go-deprecated/api.mustache @@ -25,7 +25,7 @@ type {{classname}} interface { * {{operationId}}{{#summary}} {{{.}}}{{/summary}}{{^summary}} Method for {{operationId}}{{/summary}} * {{#notes}} - * {{notes}} + * {{.}} * {{/notes}} * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @@ -43,10 +43,10 @@ type {{classname}} interface { {{/allParams}} {{/hasOptionalParams}} {{#returnType}} - * @return {{{returnType}}} + * @return {{{.}}} {{/returnType}} */ - {{{nickname}}}(ctx _context.Context{{#hasParams}}, {{/hasParams}}{{#allParams}}{{#required}}{{paramName}} {{{dataType}}}{{^-last}}, {{/-last}}{{/required}}{{/allParams}}{{#hasOptionalParams}}localVarOptionals *{{#structPrefix}}{{&classname}}{{/structPrefix}}{{{nickname}}}Opts{{/hasOptionalParams}}) ({{#returnType}}{{{returnType}}}, {{/returnType}}*_nethttp.Response, error) + {{{nickname}}}(ctx _context.Context{{#hasParams}}, {{/hasParams}}{{#allParams}}{{#required}}{{paramName}} {{{dataType}}}{{^-last}}, {{/-last}}{{/required}}{{/allParams}}{{#hasOptionalParams}}localVarOptionals *{{#structPrefix}}{{&classname}}{{/structPrefix}}{{{nickname}}}Opts{{/hasOptionalParams}}) ({{#returnType}}{{{.}}}, {{/returnType}}*_nethttp.Response, error) {{/operation}} } @@ -80,7 +80,7 @@ type {{#structPrefix}}{{&classname}}{{/structPrefix}}{{{nickname}}}Opts struct { * {{operationId}}{{#summary}} {{{.}}}{{/summary}}{{^summary}} Method for {{operationId}}{{/summary}} * {{#notes}} - * {{notes}} + * {{.}} * {{/notes}} * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @@ -98,10 +98,10 @@ type {{#structPrefix}}{{&classname}}{{/structPrefix}}{{{nickname}}}Opts struct { {{/allParams}} {{/hasOptionalParams}} {{#returnType}} - * @return {{{returnType}}} + * @return {{{.}}} {{/returnType}} */ -func (a *{{{classname}}}Service) {{{nickname}}}(ctx _context.Context{{#hasParams}}, {{/hasParams}}{{#allParams}}{{#required}}{{paramName}} {{{dataType}}}{{^-last}}, {{/-last}}{{/required}}{{/allParams}}{{#hasOptionalParams}}localVarOptionals *{{#structPrefix}}{{&classname}}{{/structPrefix}}{{{nickname}}}Opts{{/hasOptionalParams}}) ({{#returnType}}{{{returnType}}}, {{/returnType}}*_nethttp.Response, error) { +func (a *{{{classname}}}Service) {{{nickname}}}(ctx _context.Context{{#hasParams}}, {{/hasParams}}{{#allParams}}{{#required}}{{paramName}} {{{dataType}}}{{^-last}}, {{/-last}}{{/required}}{{/allParams}}{{#hasOptionalParams}}localVarOptionals *{{#structPrefix}}{{&classname}}{{/structPrefix}}{{{nickname}}}Opts{{/hasOptionalParams}}) ({{#returnType}}{{{.}}}, {{/returnType}}*_nethttp.Response, error) { var ( localVarHTTPMethod = _nethttp.Method{{httpMethod}} localVarPostBody interface{} @@ -109,13 +109,13 @@ func (a *{{{classname}}}Service) {{{nickname}}}(ctx _context.Context{{#hasParams localVarFileName string localVarFileBytes []byte {{#returnType}} - localVarReturnValue {{{returnType}}} + localVarReturnValue {{{.}}} {{/returnType}} ) // create path and map variables localVarPath := a.client.cfg.BasePath + "{{{path}}}"{{#pathParams}} - localVarPath = strings.Replace(localVarPath, "{"+"{{baseName}}"+"}", _neturl.PathEscape(parameterToString({{paramName}}, "{{#collectionFormat}}{{collectionFormat}}{{/collectionFormat}}")) , -1) + localVarPath = strings.Replace(localVarPath, "{"+"{{baseName}}"+"}", _neturl.PathEscape(parameterToString({{paramName}}, "{{collectionFormat}}")) , -1) {{/pathParams}} localVarHeaderParams := make(map[string]string) @@ -177,15 +177,15 @@ func (a *{{{classname}}}Service) {{{nickname}}}(ctx _context.Context{{#hasParams if reflect.TypeOf(t).Kind() == reflect.Slice { s := reflect.ValueOf(t) for i := 0; i < s.Len(); i++ { - localVarQueryParams.Add("{{baseName}}", parameterToString(s.Index(i), "{{#collectionFormat}}{{collectionFormat}}{{/collectionFormat}}")) + localVarQueryParams.Add("{{baseName}}", parameterToString(s.Index(i), "{{collectionFormat}}")) } } else { - localVarQueryParams.Add("{{baseName}}", parameterToString(t, "{{#collectionFormat}}{{collectionFormat}}{{/collectionFormat}}")) + localVarQueryParams.Add("{{baseName}}", parameterToString(t, "{{collectionFormat}}")) } } {{/isCollectionFormatMulti}} {{^isCollectionFormatMulti}} - localVarQueryParams.Add("{{baseName}}", parameterToString({{paramName}}, "{{#collectionFormat}}{{collectionFormat}}{{/collectionFormat}}")) + localVarQueryParams.Add("{{baseName}}", parameterToString({{paramName}}, "{{collectionFormat}}")) {{/isCollectionFormatMulti}} {{/required}} {{^required}} @@ -195,14 +195,14 @@ func (a *{{{classname}}}Service) {{{nickname}}}(ctx _context.Context{{#hasParams if reflect.TypeOf(t).Kind() == reflect.Slice { s := reflect.ValueOf(t) for i := 0; i < s.Len(); i++ { - localVarQueryParams.Add("{{baseName}}", parameterToString(s.Index(i), "{{#collectionFormat}}{{collectionFormat}}{{/collectionFormat}}")) + localVarQueryParams.Add("{{baseName}}", parameterToString(s.Index(i), "{{collectionFormat}}")) } } else { - localVarQueryParams.Add("{{baseName}}", parameterToString(t, "{{#collectionFormat}}{{collectionFormat}}{{/collectionFormat}}")) + localVarQueryParams.Add("{{baseName}}", parameterToString(t, "{{collectionFormat}}")) } {{/isCollectionFormatMulti}} {{^isCollectionFormatMulti}} - localVarQueryParams.Add("{{baseName}}", parameterToString(localVarOptionals.{{vendorExtensions.x-export-param-name}}.Value(), "{{#collectionFormat}}{{collectionFormat}}{{/collectionFormat}}")) + localVarQueryParams.Add("{{baseName}}", parameterToString(localVarOptionals.{{vendorExtensions.x-export-param-name}}.Value(), "{{collectionFormat}}")) {{/isCollectionFormatMulti}} } {{/required}} @@ -232,11 +232,11 @@ func (a *{{{classname}}}Service) {{{nickname}}}(ctx _context.Context{{#hasParams {{#hasHeaderParams}} {{#headerParams}} {{#required}} - localVarHeaderParams["{{baseName}}"] = parameterToString({{paramName}}, "{{#collectionFormat}}{{collectionFormat}}{{/collectionFormat}}") + localVarHeaderParams["{{baseName}}"] = parameterToString({{paramName}}, "{{collectionFormat}}") {{/required}} {{^required}} if localVarOptionals != nil && localVarOptionals.{{vendorExtensions.x-export-param-name}}.IsSet() { - localVarHeaderParams["{{baseName}}"] = parameterToString(localVarOptionals.{{vendorExtensions.x-export-param-name}}.Value(), "{{#collectionFormat}}{{collectionFormat}}{{/collectionFormat}}") + localVarHeaderParams["{{baseName}}"] = parameterToString(localVarOptionals.{{vendorExtensions.x-export-param-name}}.Value(), "{{collectionFormat}}") } {{/required}} {{/headerParams}} @@ -267,7 +267,7 @@ func (a *{{{classname}}}Service) {{{nickname}}}(ctx _context.Context{{#hasParams {{/isFile}} {{^isFile}} {{#required}} - localVarFormParams.Add("{{baseName}}", parameterToString({{paramName}}, "{{#collectionFormat}}{{collectionFormat}}{{/collectionFormat}}")) + localVarFormParams.Add("{{baseName}}", parameterToString({{paramName}}, "{{collectionFormat}}")) {{/required}} {{^required}} {{#isModel}} @@ -281,7 +281,7 @@ func (a *{{{classname}}}Service) {{{nickname}}}(ctx _context.Context{{#hasParams {{/isModel}} {{^isModel}} if localVarOptionals != nil && localVarOptionals.{{vendorExtensions.x-export-param-name}}.IsSet() { - localVarFormParams.Add("{{baseName}}", parameterToString(localVarOptionals.{{vendorExtensions.x-export-param-name}}.Value(), "{{#collectionFormat}}{{collectionFormat}}{{/collectionFormat}}")) + localVarFormParams.Add("{{baseName}}", parameterToString(localVarOptionals.{{vendorExtensions.x-export-param-name}}.Value(), "{{collectionFormat}}")) } {{/isModel}} {{/required}} diff --git a/modules/openapi-generator/src/main/resources/go-deprecated/api_doc.mustache b/modules/openapi-generator/src/main/resources/go-deprecated/api_doc.mustache index aaa9f553adb..468ee78bbf5 100644 --- a/modules/openapi-generator/src/main/resources/go-deprecated/api_doc.mustache +++ b/modules/openapi-generator/src/main/resources/go-deprecated/api_doc.mustache @@ -1,12 +1,12 @@ # {{invokerPackage}}\{{classname}}{{#description}} -{{description}}{{/description}} +{{.}}{{/description}} All URIs are relative to *{{basePath}}* Method | HTTP request | Description ------------- | ------------- | ------------- -{{#operations}}{{#operation}}[**{{operationId}}**]({{classname}}.md#{{operationId}}) | **{{httpMethod}}** {{path}} | {{#summary}}{{summary}}{{/summary}} +{{#operations}}{{#operation}}[**{{operationId}}**]({{classname}}.md#{{operationId}}) | **{{httpMethod}}** {{path}} | {{summary}} {{/operation}}{{/operations}} {{#operations}} @@ -14,11 +14,11 @@ Method | HTTP request | Description ## {{{operationId}}} -> {{#returnType}}{{{returnType}}} {{/returnType}}{{{operationId}}}(ctx, {{#allParams}}{{#required}}{{paramName}}{{^-last}}, {{/-last}}{{/required}}{{/allParams}}{{#hasOptionalParams}}optional{{/hasOptionalParams}}) +> {{#returnType}}{{{.}}} {{/returnType}}{{{operationId}}}(ctx, {{#allParams}}{{#required}}{{paramName}}{{^-last}}, {{/-last}}{{/required}}{{/allParams}}{{#hasOptionalParams}}optional{{/hasOptionalParams}}) {{{summary}}}{{#notes}} -{{{notes}}}{{/notes}} +{{{.}}}{{/notes}} ### Required Parameters @@ -26,7 +26,7 @@ Method | HTTP request | Description Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc.{{/-last}}{{/allParams}}{{#allParams}}{{#required}} -**{{paramName}}** | {{#isFile}}**{{dataType}}**{{/isFile}}{{#isPrimitiveType}}**{{dataType}}**{{/isPrimitiveType}}{{^isPrimitiveType}}{{^isFile}}[**{{dataType}}**]({{baseType}}.md){{/isFile}}{{/isPrimitiveType}}| {{description}} | {{#defaultValue}}[default to {{defaultValue}}]{{/defaultValue}}{{/required}}{{/allParams}}{{#hasOptionalParams}} +**{{paramName}}** | {{#isFile}}**{{dataType}}**{{/isFile}}{{#isPrimitiveType}}**{{dataType}}**{{/isPrimitiveType}}{{^isPrimitiveType}}{{^isFile}}[**{{dataType}}**]({{baseType}}.md){{/isFile}}{{/isPrimitiveType}}| {{description}} | {{#defaultValue}}[default to {{.}}]{{/defaultValue}}{{/required}}{{/allParams}}{{#hasOptionalParams}} **optional** | ***{{{nickname}}}Opts** | optional parameters | nil if no parameters ### Optional Parameters @@ -36,7 +36,7 @@ Optional parameters are passed through a pointer to a {{{nickname}}}Opts struct Name | Type | Description | Notes ------------- | ------------- | ------------- | -------------{{/-last}}{{/allParams}}{{#allParams}} -{{^required}} **{{paramName}}** | {{#isFile}}**optional.Interface of {{dataType}}**{{/isFile}}{{#isPrimitiveType}}**optional.{{vendorExtensions.x-optional-data-type}}**{{/isPrimitiveType}}{{^isPrimitiveType}}{{^isFile}}[**optional.Interface of {{dataType}}**]({{baseType}}.md){{/isFile}}{{/isPrimitiveType}}| {{description}} | {{#defaultValue}}[default to {{defaultValue}}]{{/defaultValue}}{{/required}}{{/allParams}}{{/hasOptionalParams}} +{{^required}} **{{paramName}}** | {{#isFile}}**optional.Interface of {{dataType}}**{{/isFile}}{{#isPrimitiveType}}**optional.{{vendorExtensions.x-optional-data-type}}**{{/isPrimitiveType}}{{^isPrimitiveType}}{{^isFile}}[**optional.Interface of {{dataType}}**]({{baseType}}.md){{/isFile}}{{/isPrimitiveType}}| {{description}} | {{#defaultValue}}[default to {{.}}]{{/defaultValue}}{{/required}}{{/allParams}}{{/hasOptionalParams}} ### Return type diff --git a/modules/openapi-generator/src/main/resources/go-deprecated/configuration.mustache b/modules/openapi-generator/src/main/resources/go-deprecated/configuration.mustache index b21d2a13a23..46322cf507a 100644 --- a/modules/openapi-generator/src/main/resources/go-deprecated/configuration.mustache +++ b/modules/openapi-generator/src/main/resources/go-deprecated/configuration.mustache @@ -88,7 +88,7 @@ func NewConfiguration() *Configuration { cfg := &Configuration{ BasePath: "{{{basePath}}}", DefaultHeader: make(map[string]string), - UserAgent: "{{#httpUserAgent}}{{{.}}}{{/httpUserAgent}}{{^httpUserAgent}}OpenAPI-Generator/{{{packageVersion}}}/go{{/httpUserAgent}}", + UserAgent: "{{{httpUserAgent}}}{{^httpUserAgent}}OpenAPI-Generator/{{{packageVersion}}}/go{{/httpUserAgent}}", Debug: false, {{#servers}} {{#-first}} diff --git a/modules/openapi-generator/src/main/resources/go-deprecated/git_push.sh.mustache b/modules/openapi-generator/src/main/resources/go-deprecated/git_push.sh.mustache index 8b3f689c912..f0bed5bd841 100755 --- a/modules/openapi-generator/src/main/resources/go-deprecated/git_push.sh.mustache +++ b/modules/openapi-generator/src/main/resources/go-deprecated/git_push.sh.mustache @@ -55,4 +55,3 @@ git pull origin master # Pushes (Forces) the changes in the local repository up to the remote repository echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" git push origin master 2>&1 | grep -v 'To https' - diff --git a/modules/openapi-generator/src/main/resources/go-deprecated/model.mustache b/modules/openapi-generator/src/main/resources/go-deprecated/model.mustache index f30047a9e21..cf2d15413d6 100644 --- a/modules/openapi-generator/src/main/resources/go-deprecated/model.mustache +++ b/modules/openapi-generator/src/main/resources/go-deprecated/model.mustache @@ -12,8 +12,8 @@ import ( {{/imports}} {{#model}} {{#isEnum}} -// {{{classname}}} {{#description}}{{{.}}}{{/description}}{{^description}}the model '{{{classname}}}'{{/description}} -type {{{classname}}} {{^format}}{{dataType}}{{/format}}{{#format}}{{{format}}}{{/format}} +// {{{classname}}} {{{description}}}{{^description}}the model '{{{classname}}}'{{/description}} +type {{{classname}}} {{^format}}{{dataType}}{{/format}}{{{format}}} // List of {{{name}}} const ( @@ -27,13 +27,13 @@ const ( ) {{/isEnum}} {{^isEnum}} -// {{classname}}{{#description}} {{{description}}}{{/description}}{{^description}} struct for {{{classname}}}{{/description}} +// {{classname}}{{#description}} {{{.}}}{{/description}}{{^description}} struct for {{{classname}}}{{/description}} type {{classname}} struct { {{#allVars}} {{^-first}} {{/-first}} {{#description}} - // {{{description}}} + // {{{.}}} {{/description}} {{name}} {{#isNullable}}*{{/isNullable}}{{{dataType}}} `json:"{{baseName}}{{^required}},omitempty{{/required}}"{{#withXml}} xml:"{{baseName}}{{#isXmlAttribute}},attr{{/isXmlAttribute}}"{{/withXml}}{{#vendorExtensions.x-go-custom-tag}} {{{.}}}{{/vendorExtensions.x-go-custom-tag}}` {{/allVars}} diff --git a/modules/openapi-generator/src/main/resources/go-deprecated/partial_header.mustache b/modules/openapi-generator/src/main/resources/go-deprecated/partial_header.mustache index e23b21520a9..f0a0906d6d2 100644 --- a/modules/openapi-generator/src/main/resources/go-deprecated/partial_header.mustache +++ b/modules/openapi-generator/src/main/resources/go-deprecated/partial_header.mustache @@ -1,17 +1,17 @@ /* {{#appName}} - * {{{appName}}} + * {{{.}}} * {{/appName}} {{#appDescription}} - * {{{appDescription}}} + * {{{.}}} * {{/appDescription}} {{#version}} - * API version: {{{version}}} + * API version: {{{.}}} {{/version}} {{#infoEmail}} - * Contact: {{{infoEmail}}} + * Contact: {{{.}}} {{/infoEmail}} {{^withGoCodegenComment}} * Generated by: OpenAPI Generator (https://openapi-generator.tech) diff --git a/modules/openapi-generator/src/main/resources/go-echo-server/README.mustache b/modules/openapi-generator/src/main/resources/go-echo-server/README.mustache index 9ff2b9aeb19..f45fd404673 100644 --- a/modules/openapi-generator/src/main/resources/go-echo-server/README.mustache +++ b/modules/openapi-generator/src/main/resources/go-echo-server/README.mustache @@ -1,13 +1,13 @@ # Go Echo API Server for {{packageName}} {{#appDescriptionWithNewLines}} -{{{appDescriptionWithNewLines}}} +{{{.}}} {{/appDescriptionWithNewLines}} ## Overview This server was generated by the [openapi-generator] (https://openapi-generator.tech) project. -By using the [OpenAPI-Spec](https://github.com/OAI/OpenAPI-Specification) from a remote server, you can easily generate a server stub. +By using the [OpenAPI-Spec](https://github.com/OAI/OpenAPI-Specification) from a remote server, you can easily generate a server stub. - To see how to make this your own, look here: @@ -36,7 +36,7 @@ docker build --network=host -t {{{packageName}}} . Once the image is built, just run ``` -docker run --rm -it {{{packageName}}} +docker run --rm -it {{{packageName}}} ``` ### Known Issue diff --git a/modules/openapi-generator/src/main/resources/go-echo-server/main.mustache b/modules/openapi-generator/src/main/resources/go-echo-server/main.mustache index e8654aaa3f2..97736d7f083 100644 --- a/modules/openapi-generator/src/main/resources/go-echo-server/main.mustache +++ b/modules/openapi-generator/src/main/resources/go-echo-server/main.mustache @@ -15,7 +15,7 @@ func main() { // Middleware e.Use(middleware.Logger()) e.Use(middleware.Recover()) - + {{#apiInfo}}{{#apis}}{{#operations}}{{#operation}} // {{nickname}} - {{{summary}}}{{#isDeprecated}} (deprecated){{/isDeprecated}} e.{{httpMethod.toUpperCase}}("{{{basePathWithoutHost}}}{{{path}}}", c.{{operationId}}) diff --git a/modules/openapi-generator/src/main/resources/go-echo-server/model.mustache b/modules/openapi-generator/src/main/resources/go-echo-server/model.mustache index 433d848254b..ec58995c783 100644 --- a/modules/openapi-generator/src/main/resources/go-echo-server/model.mustache +++ b/modules/openapi-generator/src/main/resources/go-echo-server/model.mustache @@ -4,7 +4,7 @@ package models {{/-first}} "{{import}}"{{#-last}} ) {{/-last}}{{/imports}}{{#model}}{{#isEnum}}{{#description}}// {{{classname}}} : {{{description}}}{{/description}} -type {{{classname}}} {{^format}}{{dataType}}{{/format}}{{#format}}{{{format}}}{{/format}} +type {{{classname}}} {{^format}}{{dataType}}{{/format}}{{{format}}} // List of {{{classname}}} const ( @@ -17,7 +17,7 @@ const ( // {{classname}} - {{{description}}}{{/description}} type {{classname}} struct { {{#vars}}{{#description}} - // {{{description}}}{{/description}} + // {{{.}}}{{/description}} {{#deprecated}} // Deprecated {{/deprecated}} diff --git a/modules/openapi-generator/src/main/resources/go-gin-server/README.mustache b/modules/openapi-generator/src/main/resources/go-gin-server/README.mustache index 3ad44c6fa7a..972ecfa6f09 100644 --- a/modules/openapi-generator/src/main/resources/go-gin-server/README.mustache +++ b/modules/openapi-generator/src/main/resources/go-gin-server/README.mustache @@ -1,13 +1,13 @@ # Go API Server for {{packageName}} {{#appDescriptionWithNewLines}} -{{{appDescriptionWithNewLines}}} +{{{.}}} {{/appDescriptionWithNewLines}} ## Overview This server was generated by the [openapi-generator] (https://openapi-generator.tech) project. -By using the [OpenAPI-Spec](https://github.com/OAI/OpenAPI-Specification) from a remote server, you can easily generate a server stub. +By using the [OpenAPI-Spec](https://github.com/OAI/OpenAPI-Specification) from a remote server, you can easily generate a server stub. - To see how to make this your own, look here: @@ -35,7 +35,7 @@ docker build --network=host -t {{{packageName}}} . Once the image is built, just run ``` -docker run --rm -it {{{packageName}}} +docker run --rm -it {{{packageName}}} ``` ### Known Issue @@ -43,4 +43,3 @@ docker run --rm -it {{{packageName}}} Endpoints sharing a common path may result in issues. For example, `/v2/pet/findByTags` and `/v2/pet/:petId` will result in an issue with the Gin framework. For more information about this known limitation, please refer to [gin-gonic/gin#388](https://github.com/gin-gonic/gin/issues/388) for more information. A workaround is to manually update the path and handler. Please refer to [gin-gonic/gin/issues/205#issuecomment-296155497](https://github.com/gin-gonic/gin/issues/205#issuecomment-296155497) for more information. - diff --git a/modules/openapi-generator/src/main/resources/go-gin-server/model.mustache b/modules/openapi-generator/src/main/resources/go-gin-server/model.mustache index 14993caf01a..2ffa77c2c9e 100644 --- a/modules/openapi-generator/src/main/resources/go-gin-server/model.mustache +++ b/modules/openapi-generator/src/main/resources/go-gin-server/model.mustache @@ -5,7 +5,7 @@ package {{packageName}} {{/-first}} "{{import}}"{{#-last}} ) {{/-last}}{{/imports}}{{#model}}{{#isEnum}}{{#description}}// {{{classname}}} : {{{description}}}{{/description}} -type {{{classname}}} {{^format}}{{dataType}}{{/format}}{{#format}}{{{format}}}{{/format}} +type {{{classname}}} {{^format}}{{dataType}}{{/format}}{{{format}}} // List of {{{classname}}} const ( @@ -18,7 +18,7 @@ const ( // {{classname}} - {{{description}}}{{/description}} type {{classname}} struct { {{#vars}}{{#description}} - // {{{description}}}{{/description}} + // {{{.}}}{{/description}} {{#deprecated}} // Deprecated {{/deprecated}} diff --git a/modules/openapi-generator/src/main/resources/go-gin-server/partial_header.mustache b/modules/openapi-generator/src/main/resources/go-gin-server/partial_header.mustache index 23edcdfb691..07920e30413 100644 --- a/modules/openapi-generator/src/main/resources/go-gin-server/partial_header.mustache +++ b/modules/openapi-generator/src/main/resources/go-gin-server/partial_header.mustache @@ -1,17 +1,17 @@ /* {{#appName}} - * {{{appName}}} + * {{{.}}} * {{/appName}} {{#appDescription}} - * {{{appDescription}}} + * {{{.}}} * {{/appDescription}} {{#version}} - * API version: {{{version}}} + * API version: {{{.}}} {{/version}} {{#infoEmail}} - * Contact: {{{infoEmail}}} + * Contact: {{{.}}} {{/infoEmail}} * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ diff --git a/modules/openapi-generator/src/main/resources/go-server/README.mustache b/modules/openapi-generator/src/main/resources/go-server/README.mustache index 5a59be67382..cdf8713c2e6 100644 --- a/modules/openapi-generator/src/main/resources/go-server/README.mustache +++ b/modules/openapi-generator/src/main/resources/go-server/README.mustache @@ -1,13 +1,13 @@ # Go API Server for {{packageName}} {{#appDescriptionWithNewLines}} -{{{appDescriptionWithNewLines}}} +{{{.}}} {{/appDescriptionWithNewLines}} ## Overview This server was generated by the [openapi-generator] (https://openapi-generator.tech) project. -By using the [OpenAPI-Spec](https://github.com/OAI/OpenAPI-Specification) from a remote server, you can easily generate a server stub. +By using the [OpenAPI-Spec](https://github.com/OAI/OpenAPI-Specification) from a remote server, you can easily generate a server stub. - To see how to make this your own, look here: @@ -35,7 +35,5 @@ docker build --network=host -t {{{packageName}}} . Once image is built use ``` -docker run --rm -it {{{packageName}}} +docker run --rm -it {{{packageName}}} ``` - - diff --git a/modules/openapi-generator/src/main/resources/go-server/api.mustache b/modules/openapi-generator/src/main/resources/go-server/api.mustache index f08e1b27038..b0ae118950d 100644 --- a/modules/openapi-generator/src/main/resources/go-server/api.mustache +++ b/modules/openapi-generator/src/main/resources/go-server/api.mustache @@ -10,7 +10,7 @@ import ( {{#apiInfo}}{{#apis}} // {{classname}}Router defines the required methods for binding the api requests to a responses for the {{classname}} -// The {{classname}}Router implementation should parse necessary information from the http request, +// The {{classname}}Router implementation should parse necessary information from the http request, // pass the data to a {{classname}}Servicer to perform the required actions, then write the service results to the http response. type {{classname}}Router interface { {{#operations}}{{#operation}} {{#isDeprecated}} @@ -21,8 +21,8 @@ type {{classname}}Router interface { {{#operations}}{{#operation}} // {{classname}}Servicer defines the api actions for the {{classname}} service -// This interface intended to stay up to date with the openapi yaml used to generate it, -// while the service implementation can ignored with the .openapi-generator-ignore file +// This interface intended to stay up to date with the openapi yaml used to generate it, +// while the service implementation can ignored with the .openapi-generator-ignore file // and updated with the logic required for the API. type {{classname}}Servicer interface { {{#operations}}{{#operation}} {{#isDeprecated}} diff --git a/modules/openapi-generator/src/main/resources/go-server/model.mustache b/modules/openapi-generator/src/main/resources/go-server/model.mustache index c13d81795ad..8a4dd7a9790 100644 --- a/modules/openapi-generator/src/main/resources/go-server/model.mustache +++ b/modules/openapi-generator/src/main/resources/go-server/model.mustache @@ -5,7 +5,7 @@ package {{packageName}} {{/-first}} "{{import}}"{{#-last}} ) {{/-last}}{{/imports}}{{#model}}{{#isEnum}}{{#description}}// {{{classname}}} : {{{description}}}{{/description}} -type {{{classname}}} {{^format}}{{dataType}}{{/format}}{{#format}}{{{format}}}{{/format}} +type {{{classname}}} {{^format}}{{dataType}}{{/format}}{{{format}}} // List of {{{classname}}} const ( @@ -28,7 +28,7 @@ type {{classname}} struct { {{/isArray}} {{/parent}} {{#vars}}{{#description}} - // {{{description}}}{{/description}} + // {{{.}}}{{/description}} {{#deprecated}} // Deprecated {{/deprecated}} diff --git a/modules/openapi-generator/src/main/resources/go-server/partial_header.mustache b/modules/openapi-generator/src/main/resources/go-server/partial_header.mustache index 23edcdfb691..07920e30413 100644 --- a/modules/openapi-generator/src/main/resources/go-server/partial_header.mustache +++ b/modules/openapi-generator/src/main/resources/go-server/partial_header.mustache @@ -1,17 +1,17 @@ /* {{#appName}} - * {{{appName}}} + * {{{.}}} * {{/appName}} {{#appDescription}} - * {{{appDescription}}} + * {{{.}}} * {{/appDescription}} {{#version}} - * API version: {{{version}}} + * API version: {{{.}}} {{/version}} {{#infoEmail}} - * Contact: {{{infoEmail}}} + * Contact: {{{.}}} {{/infoEmail}} * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ diff --git a/modules/openapi-generator/src/main/resources/go-server/service.mustache b/modules/openapi-generator/src/main/resources/go-server/service.mustache index 2df7298b17b..6339027c099 100644 --- a/modules/openapi-generator/src/main/resources/go-server/service.mustache +++ b/modules/openapi-generator/src/main/resources/go-server/service.mustache @@ -9,7 +9,7 @@ import ( ) // {{classname}}Service is a service that implents the logic for the {{classname}}Servicer -// This service should implement the business logic for every endpoint for the {{classname}} API. +// This service should implement the business logic for every endpoint for the {{classname}} API. // Include any external packages or services that will be required by this service. type {{classname}}Service struct { } @@ -41,4 +41,3 @@ func (s *{{classname}}Service) {{nickname}}(ctx context.Context{{#allParams}}, { {{/responses}} return Response(http.StatusNotImplemented, nil), errors.New("{{nickname}} method not implemented") }{{/operation}}{{/operations}} - diff --git a/modules/openapi-generator/src/main/resources/go/README.mustache b/modules/openapi-generator/src/main/resources/go/README.mustache index de164be1cf8..3eb9c387eb7 100644 --- a/modules/openapi-generator/src/main/resources/go/README.mustache +++ b/modules/openapi-generator/src/main/resources/go/README.mustache @@ -1,7 +1,7 @@ # Go API client for {{packageName}} {{#appDescriptionWithNewLines}} -{{{appDescriptionWithNewLines}}} +{{{.}}} {{/appDescriptionWithNewLines}} ## Overview diff --git a/modules/openapi-generator/src/main/resources/go/client.mustache b/modules/openapi-generator/src/main/resources/go/client.mustache index 8cc5dfd6009..06a0ab7b9dc 100644 --- a/modules/openapi-generator/src/main/resources/go/client.mustache +++ b/modules/openapi-generator/src/main/resources/go/client.mustache @@ -363,7 +363,7 @@ func (c *APIClient) prepareRequest( reader = strings.NewReader(body.String()) } - // Define default values for region and service to maintain backward compatibility + // Define default values for region and service to maintain backward compatibility region := auth.Region if region == "" { region = "eu-west-2" diff --git a/modules/openapi-generator/src/main/resources/go/git_push.sh.mustache b/modules/openapi-generator/src/main/resources/go/git_push.sh.mustache index 8b3f689c912..f0bed5bd841 100755 --- a/modules/openapi-generator/src/main/resources/go/git_push.sh.mustache +++ b/modules/openapi-generator/src/main/resources/go/git_push.sh.mustache @@ -55,4 +55,3 @@ git pull origin master # Pushes (Forces) the changes in the local repository up to the remote repository echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" git push origin master 2>&1 | grep -v 'To https' - diff --git a/modules/openapi-generator/src/main/resources/go/model_simple.mustache b/modules/openapi-generator/src/main/resources/go/model_simple.mustache index a2e30fc4b8f..bda8563ed17 100644 --- a/modules/openapi-generator/src/main/resources/go/model_simple.mustache +++ b/modules/openapi-generator/src/main/resources/go/model_simple.mustache @@ -14,7 +14,7 @@ type {{classname}} struct { {{^-first}} {{/-first}} {{#description}} - // {{{description}}} + // {{{.}}} {{/description}} {{#deprecated}} // Deprecated @@ -305,7 +305,7 @@ func (o *{{{classname}}}) UnmarshalJSON(bytes []byte) (err error) { {{^-first}} {{/-first}} {{#description}} - // {{{description}}} + // {{{.}}} {{/description}} {{#deprecated}} // Deprecated diff --git a/modules/openapi-generator/src/main/resources/graphql-nodejs-express-server/README.mustache b/modules/openapi-generator/src/main/resources/graphql-nodejs-express-server/README.mustache index 2e556cc0666..522ed33b279 100644 --- a/modules/openapi-generator/src/main/resources/graphql-nodejs-express-server/README.mustache +++ b/modules/openapi-generator/src/main/resources/graphql-nodejs-express-server/README.mustache @@ -1,7 +1,7 @@ # GraphQL express API server {{#appDescriptionWithNewLines}} -{{{appDescriptionWithNewLines}}} +{{{.}}} {{/appDescriptionWithNewLines}} ## Requirements diff --git a/modules/openapi-generator/src/main/resources/graphql-nodejs-express-server/api.mustache b/modules/openapi-generator/src/main/resources/graphql-nodejs-express-server/api.mustache index 9d59eab63ae..736f40e11a1 100644 --- a/modules/openapi-generator/src/main/resources/graphql-nodejs-express-server/api.mustache +++ b/modules/openapi-generator/src/main/resources/graphql-nodejs-express-server/api.mustache @@ -9,7 +9,7 @@ input {{operationId}}Input { {{#allParams}} - {{#description}}# {{description}}{{/description}} + {{#description}}# {{.}}{{/description}} {{paramName}}: {{#isContainer}}[{{/isContainer}}{{dataType}}{{#isArray}}Input{{/isArray}}{{#isModel}}Input{{/isModel}}{{#isContainer}}]{{/isContainer}}{{^-last}}, {{/-last}} {{/allParams}} }{{/hasParams}}{{/vendorExtensions.x-is-mutation}}{{/operation}} @@ -18,16 +18,16 @@ type Mutation { {{#operation}} {{#vendorExtensions.x-is-mutation}} {{#summary}} - # {{summary}} + # {{.}} {{/summary}} {{#notes}} - # {{notes}} + # {{.}} {{/notes}} {{#allParams}} # @param {{dataType}} {{paramName}} {{description}} {{/allParams}} - # @return [{{#returnType}}{{returnType}}{{/returnType}}{{^returnType}}Boolean{{/returnType}}] - {{operationId}}{{#hasParams}}(input: {{operationId}}Input!){{/hasParams}}: {{#returnType}}{{.}}{{/returnType}}{{^returnType}}Boolean{{/returnType}} + # @return [{{returnType}}{{^returnType}}Boolean{{/returnType}}] + {{operationId}}{{#hasParams}}(input: {{operationId}}Input!){{/hasParams}}: {{returnType}}{{^returnType}}Boolean{{/returnType}} {{/vendorExtensions.x-is-mutation}} {{/operation}} } @@ -38,16 +38,16 @@ type Query { {{#operation}} {{^vendorExtensions.x-is-mutation}} {{#summary}} - # {{summary}} + # {{.}} {{/summary}} {{#notes}} - # {{notes}} + # {{.}} {{/notes}} {{#allParams}} # @param {{dataType}} {{paramName}} {{description}} {{/allParams}} - # @return [{{#returnType}}{{returnType}}{{/returnType}}{{^returnType}}Boolean{{/returnType}}] - {{operationId}}{{#hasParams}}({{#allParams}}{{paramName}}: {{dataType}}{{^-last}}, {{/-last}}{{/allParams}}){{/hasParams}}: {{#returnType}}{{.}}{{/returnType}}{{^returnType}}Boolean{{/returnType}} + # @return [{{returnType}}{{^returnType}}Boolean{{/returnType}}] + {{operationId}}{{#hasParams}}({{#allParams}}{{paramName}}: {{dataType}}{{^-last}}, {{/-last}}{{/allParams}}){{/hasParams}}: {{returnType}}{{^returnType}}Boolean{{/returnType}} {{/vendorExtensions.x-is-mutation}} {{/operation}} } diff --git a/modules/openapi-generator/src/main/resources/graphql-nodejs-express-server/api_doc.mustache b/modules/openapi-generator/src/main/resources/graphql-nodejs-express-server/api_doc.mustache index c41fd6e4f37..28aa346a94f 100644 --- a/modules/openapi-generator/src/main/resources/graphql-nodejs-express-server/api_doc.mustache +++ b/modules/openapi-generator/src/main/resources/graphql-nodejs-express-server/api_doc.mustache @@ -1,21 +1,21 @@ # {{classname}}{{#description}} - {{description}}{{/description}} + {{.}}{{/description}} All URIs are relative to *{{basePath}}* Method | HTTP request | Description ------------- | ------------- | ------------- -{{#operations}}{{#operation}}[**{{operationId}}**]({{classname}}.md#{{operationId}}) | **{{httpMethod}}** {{path}} | {{#summary}}{{summary}}{{/summary}} +{{#operations}}{{#operation}}[**{{operationId}}**]({{classname}}.md#{{operationId}}) | **{{httpMethod}}** {{path}} | {{summary}} {{/operation}}{{/operations}} {{#operations}} {{#operation}} # **{{operationId}}** -> {{#returnType}}{{returnType}} {{/returnType}}{{operationId}}({{#allParams}}{{{paramName}}}{{^-last}}, {{/-last}}{{/allParams}}) +> {{#returnType}}{{.}} {{/returnType}}{{operationId}}({{#allParams}}{{{paramName}}}{{^-last}}, {{/-last}}{{/allParams}}) {{summary}}{{#notes}} -{{notes}}{{/notes}} +{{.}}{{/notes}} {{/operation}} {{/operations}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/graphql-nodejs-express-server/model.mustache b/modules/openapi-generator/src/main/resources/graphql-nodejs-express-server/model.mustache index 3bbbb5199df..25a62c0302f 100644 --- a/modules/openapi-generator/src/main/resources/graphql-nodejs-express-server/model.mustache +++ b/modules/openapi-generator/src/main/resources/graphql-nodejs-express-server/model.mustache @@ -2,12 +2,12 @@ {{#model}} {{>partial_header_graphql}} {{#description}} -# {{{description}}} +# {{{.}}} {{/description}} type {{classname}} { {{#vars}} {{#description}} - # {{{description}}} + # {{{.}}} {{/description}} {{baseName}}: {{#isEnum}}{{classname}}{{datatypeWithEnum}}{{/isEnum}}{{^isEnum}}{{datatypeWithEnum}}{{/isEnum}} {{/vars}} @@ -16,7 +16,7 @@ type {{classname}} { input {{classname}}Input { {{#vars}} {{#description}} - # {{{description}}} + # {{{.}}} {{/description}} {{baseName}}: {{#isEnum}}{{classname}}{{datatypeWithEnum}}{{/isEnum}}{{^isEnum}}{{#isContainer}}[{{datatypeWithEnum}}{{#complexType}}Input{{/complexType}}]{{/isContainer}}{{^isContainer}}{{datatypeWithEnum}}{{#isModel}}Input{{/isModel}}{{/isContainer}}{{/isEnum}} {{/vars}} @@ -25,7 +25,7 @@ input {{classname}}Input { {{#isEnum}} {{#description}} -# {{{description}}} +# {{{.}}} {{/description}} enum {{classname}}{{enumName}} { {{#allowableValues}} diff --git a/modules/openapi-generator/src/main/resources/graphql-nodejs-express-server/package.json.mustache b/modules/openapi-generator/src/main/resources/graphql-nodejs-express-server/package.json.mustache index 71324a2093b..871be2f6ee3 100644 --- a/modules/openapi-generator/src/main/resources/graphql-nodejs-express-server/package.json.mustache +++ b/modules/openapi-generator/src/main/resources/graphql-nodejs-express-server/package.json.mustache @@ -1,7 +1,7 @@ { "name": "graphql-server", "version": "1.0.0", - "description": "{{#appDescription}} {{{appDescription}}} {{/appDescription}}", + "description": "{{#appDescription}} {{{.}}} {{/appDescription}}", "main": "index.js", "scripts": { "start": "node start.js", diff --git a/modules/openapi-generator/src/main/resources/graphql-nodejs-express-server/partial_header.mustache b/modules/openapi-generator/src/main/resources/graphql-nodejs-express-server/partial_header.mustache index 1e1214c8a69..66e3e0011d3 100644 --- a/modules/openapi-generator/src/main/resources/graphql-nodejs-express-server/partial_header.mustache +++ b/modules/openapi-generator/src/main/resources/graphql-nodejs-express-server/partial_header.mustache @@ -1,11 +1,11 @@ /** * {{#appName}} - * {{{appName}}} + * {{{.}}} * {{/appName}} * {{#appDescription}} - * {{{appDescription}}} + * {{{.}}} * {{/appDescription}} - * {{#version}}Version: {{{version}}}{{/version}} - * {{#infoEmail}}Contact: {{{infoEmail}}}{{/infoEmail}} + * {{#version}}Version: {{{.}}}{{/version}} + * {{#infoEmail}}Contact: {{{.}}}{{/infoEmail}} * Generated by OpenAPI Generator: https://openapi-generator.tech */ diff --git a/modules/openapi-generator/src/main/resources/graphql-nodejs-express-server/partial_header_graphql.mustache b/modules/openapi-generator/src/main/resources/graphql-nodejs-express-server/partial_header_graphql.mustache index 8e97c5d4f0b..c647d74ab5c 100644 --- a/modules/openapi-generator/src/main/resources/graphql-nodejs-express-server/partial_header_graphql.mustache +++ b/modules/openapi-generator/src/main/resources/graphql-nodejs-express-server/partial_header_graphql.mustache @@ -1,9 +1,9 @@ # {{#appName}} -# {{{appName}}} +# {{{.}}} # {{/appName}} # {{#appDescription}} -# {{{appDescription}}} +# {{{.}}} # {{/appDescription}} -# {{#version}}Version: {{{version}}}{{/version}} -# {{#infoEmail}}Contact: {{{infoEmail}}}{{/infoEmail}} +# {{#version}}Version: {{{.}}}{{/version}} +# {{#infoEmail}}Contact: {{{.}}}{{/infoEmail}} # Generated by OpenAPI Generator: https://openapi-generator.tech diff --git a/modules/openapi-generator/src/main/resources/graphql-schema/README.mustache b/modules/openapi-generator/src/main/resources/graphql-schema/README.mustache index 75f88357c43..bca3b8ce1ff 100644 --- a/modules/openapi-generator/src/main/resources/graphql-schema/README.mustache +++ b/modules/openapi-generator/src/main/resources/graphql-schema/README.mustache @@ -1,7 +1,7 @@ # Lua API client for {{packageName}} {{#appDescriptionWithNewLines}} -{{{appDescriptionWithNewLines}}} +{{{.}}} {{/appDescriptionWithNewLines}} ## Overview @@ -29,7 +29,7 @@ All URIs are relative to *{{basePath}}* Class | Method | HTTP request | Description ------------ | ------------- | ------------- | ------------- -{{#apiInfo}}{{#apis}}{{#operations}}{{#operation}}*{{classname}}* | [**{{operationId}}**]({{apiDocPath}}{{classname}}.md#{{operationIdLowerCase}}) | **{{httpMethod}}** {{path}} | {{#summary}}{{summary}}{{/summary}} +{{#apiInfo}}{{#apis}}{{#operations}}{{#operation}}*{{classname}}* | [**{{operationId}}**]({{apiDocPath}}{{classname}}.md#{{operationIdLowerCase}}) | **{{httpMethod}}** {{path}} | {{summary}} {{/operation}}{{/operations}}{{/apis}}{{/apiInfo}} ## Documentation For Models diff --git a/modules/openapi-generator/src/main/resources/graphql-schema/api.mustache b/modules/openapi-generator/src/main/resources/graphql-schema/api.mustache index 6f9532b82e8..2b8543f655d 100644 --- a/modules/openapi-generator/src/main/resources/graphql-schema/api.mustache +++ b/modules/openapi-generator/src/main/resources/graphql-schema/api.mustache @@ -8,16 +8,16 @@ type mutation { {{#operation}} {{#vendorExtensions.x-is-mutation}} {{#summary}} - # {{summary}} + # {{.}} {{/summary}} {{#notes}} - # {{notes}} + # {{.}} {{/notes}} {{#allParams}} # @param {{dataType}} {{paramName}} {{description}} {{/allParams}} - # @return [{{#returnType}}{{returnType}}{{/returnType}}{{^returnType}}null{{/returnType}}] - {{operationId}}({{#allParams}}{{paramName}}: {{dataType}}{{^-last}}, {{/-last}}{{/allParams}}): {{#returnType}}{{.}}{{/returnType}}{{^returnType}}null{{/returnType}} + # @return [{{returnType}}{{^returnType}}null{{/returnType}}] + {{operationId}}({{#allParams}}{{paramName}}: {{dataType}}{{^-last}}, {{/-last}}{{/allParams}}): {{returnType}}{{^returnType}}null{{/returnType}} {{/vendorExtensions.x-is-mutation}} {{/operation}} @@ -29,16 +29,16 @@ type query { {{#operation}} {{^vendorExtensions.x-is-mutation}} {{#summary}} - # {{summary}} + # {{.}} {{/summary}} {{#notes}} - # {{notes}} + # {{.}} {{/notes}} {{#allParams}} # @param {{dataType}} {{paramName}} {{description}} {{/allParams}} - # @return [{{#returnType}}{{returnType}}{{/returnType}}{{^returnType}}null{{/returnType}}] - {{operationId}}({{#allParams}}{{paramName}}: {{dataType}}{{^-last}}, {{/-last}}{{/allParams}}): {{#returnType}}{{.}}{{/returnType}}{{^returnType}}null{{/returnType}} + # @return [{{returnType}}{{^returnType}}null{{/returnType}}] + {{operationId}}({{#allParams}}{{paramName}}: {{dataType}}{{^-last}}, {{/-last}}{{/allParams}}): {{returnType}}{{^returnType}}null{{/returnType}} {{/vendorExtensions.x-is-mutation}} {{/operation}} diff --git a/modules/openapi-generator/src/main/resources/graphql-schema/git_push.sh.mustache b/modules/openapi-generator/src/main/resources/graphql-schema/git_push.sh.mustache index 8b3f689c912..f0bed5bd841 100755 --- a/modules/openapi-generator/src/main/resources/graphql-schema/git_push.sh.mustache +++ b/modules/openapi-generator/src/main/resources/graphql-schema/git_push.sh.mustache @@ -55,4 +55,3 @@ git pull origin master # Pushes (Forces) the changes in the local repository up to the remote repository echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" git push origin master 2>&1 | grep -v 'To https' - diff --git a/modules/openapi-generator/src/main/resources/graphql-schema/model.mustache b/modules/openapi-generator/src/main/resources/graphql-schema/model.mustache index 9c06501f432..bc2f808d8fc 100644 --- a/modules/openapi-generator/src/main/resources/graphql-schema/model.mustache +++ b/modules/openapi-generator/src/main/resources/graphql-schema/model.mustache @@ -2,13 +2,13 @@ {{#model}} {{>partial_header}} {{#description}} -# {{description}} +# {{.}} {{/description}} type {{classname}} { {{#vars}} {{#description}} - # {{description}} + # {{.}} {{/description}} {{baseName}}: {{datatypeWithEnum}} @@ -18,7 +18,7 @@ type {{classname}} { {{#isEnum}} {{#description}} -# {{description}} +# {{.}} {{/description}} enum {{enumName}} { {{#allowableValues}} diff --git a/modules/openapi-generator/src/main/resources/graphql-schema/partial_header.mustache b/modules/openapi-generator/src/main/resources/graphql-schema/partial_header.mustache index 541eedc1444..0ea833544f1 100644 --- a/modules/openapi-generator/src/main/resources/graphql-schema/partial_header.mustache +++ b/modules/openapi-generator/src/main/resources/graphql-schema/partial_header.mustache @@ -1,14 +1,14 @@ {{#appName}} -# {{{appName}}} +# {{{.}}} {{/appName}} {{#appDescription}} -# {{{appDescription}}} +# {{{.}}} {{/appDescription}} {{#version}} -# The version of the OpenAPI document: {{{version}}} +# The version of the OpenAPI document: {{{.}}} {{/version}} {{#infoEmail}} -# Contact: {{{infoEmail}}} +# Contact: {{{.}}} {{/infoEmail}} # Generated by OpenAPI Generator: https://openapi-generator.tech # diff --git a/modules/openapi-generator/src/main/resources/haskell-http-client/API.mustache b/modules/openapi-generator/src/main/resources/haskell-http-client/API.mustache index 38a7699b17b..eaedbb92a4e 100644 --- a/modules/openapi-generator/src/main/resources/haskell-http-client/API.mustache +++ b/modules/openapi-generator/src/main/resources/haskell-http-client/API.mustache @@ -60,7 +60,7 @@ import qualified Prelude as P -- {{/hasAuthMethods}}{{#vendorExtensions.x-has-unknown-return}} -- Note: Has 'Produces' instances, but no response schema -- {{/vendorExtensions.x-has-unknown-return}} -{{operationId}} +{{operationId}} :: {{#vendorExtensions.x-has-body-or-form-param}}(Consumes {{{vendorExtensions.x-operation-type}}} {{>_contentType}}{{#allParams}}{{#isBodyParam}}{{#required}}, MimeRender {{>_contentType}} {{#vendorExtensions.x-param-name-type}}{{{.}}}{{/vendorExtensions.x-param-name-type}}{{^vendorExtensions.x-param-name-type}}{{{dataType}}}{{/vendorExtensions.x-param-name-type}}{{/required}}{{/isBodyParam}}{{/allParams}}) => {{^vendorExtensions.x-inline-content-type}}ContentType contentType -- ^ request content-type ('MimeType') -> {{/vendorExtensions.x-inline-content-type}}{{/vendorExtensions.x-has-body-or-form-param}}{{^vendorExtensions.x-inline-accept}}Accept accept -- ^ request accept ('MimeType') @@ -92,7 +92,7 @@ instance HasOptionalParam {{{vendorExtensions.x-operation-type}}} {{#vendorExten instance Consumes {{{vendorExtensions.x-operation-type}}} {{{x-mediaDataType}}}{{/x-mediaIsWildcard}}{{#x-mediaIsWildcard}} instance MimeType mtype => Consumes {{{vendorExtensions.x-operation-type}}} mtype{{/x-mediaIsWildcard}} {{/consumes}}{{/hasConsumes}}{{^hasConsumes}}{{#vendorExtensions.x-has-body-or-form-param}} - + -- | @*/*@ instance MimeType mtype => Consumes {{{vendorExtensions.x-operation-type}}} mtype {{/vendorExtensions.x-has-body-or-form-param}}{{/hasConsumes}}{{#hasProduces}} diff --git a/modules/openapi-generator/src/main/resources/haskell-http-client/Client.mustache b/modules/openapi-generator/src/main/resources/haskell-http-client/Client.mustache index cd2c451a3a7..e3969468f17 100644 --- a/modules/openapi-generator/src/main/resources/haskell-http-client/Client.mustache +++ b/modules/openapi-generator/src/main/resources/haskell-http-client/Client.mustache @@ -60,7 +60,7 @@ dispatchLbs manager config request = do -- | pair of decoded http body and http response data MimeResult res = MimeResult { mimeResult :: Either MimeError res -- ^ decoded http body - , mimeResultResponse :: NH.Response BCL.ByteString -- ^ http response + , mimeResultResponse :: NH.Response BCL.ByteString -- ^ http response } deriving (Show, Functor, Foldable, Traversable) @@ -68,7 +68,7 @@ data MimeResult res = data MimeError = MimeError { mimeError :: String -- ^ unrender/parser error - , mimeErrorResponse :: NH.Response BCL.ByteString -- ^ http response + , mimeErrorResponse :: NH.Response BCL.ByteString -- ^ http response } deriving (Eq, Show) -- | send a request returning the 'MimeResult' @@ -162,7 +162,7 @@ _toInitRequest => {{configType}} -- ^ config -> {{requestType}} req contentType res accept -- ^ request -> IO (InitRequest req contentType res accept) -- ^ initialized request -_toInitRequest config req0 = +_toInitRequest config req0 = runConfigLogWithExceptions "Client" config $ do parsedReq <- P.liftIO $ NH.parseRequest $ BCL.unpack $ BCL.append (configHost config) (BCL.concat (rUrlPath req0)) req1 <- P.liftIO $ _applyAuthMethods req0 config @@ -193,7 +193,7 @@ modifyInitRequest (InitRequest req) f = InitRequest (f req) modifyInitRequestM :: Monad m => InitRequest req contentType res accept -> (NH.Request -> m NH.Request) -> m (InitRequest req contentType res accept) modifyInitRequestM (InitRequest req) f = fmap InitRequest (f req) --- ** Logging +-- ** Logging -- | Run a block using the configured logger instance runConfigLog diff --git a/modules/openapi-generator/src/main/resources/haskell-http-client/Core.mustache b/modules/openapi-generator/src/main/resources/haskell-http-client/Core.mustache index 2a20a43be0a..dfcf3ce6e22 100644 --- a/modules/openapi-generator/src/main/resources/haskell-http-client/Core.mustache +++ b/modules/openapi-generator/src/main/resources/haskell-http-client/Core.mustache @@ -61,7 +61,7 @@ import Prelude (($), (.), (<$>), (<*>), Maybe(..), Bool(..), Char, String, fmap, -- * {{configType}} --- | +-- | data {{configType}} = {{configType}} { configHost :: BCL.ByteString -- ^ host supplied in the Request , configUserAgent :: Text -- ^ user-agent supplied in the Request @@ -87,19 +87,19 @@ instance P.Show {{configType}} where -- -- configUserAgent: -- --- @"{{#httpUserAgent}}{{{.}}}{{/httpUserAgent}}{{^httpUserAgent}}{{{cabalName}}}/{{{cabalVersion}}}{{/httpUserAgent}}"@ +-- @"{{{httpUserAgent}}}{{^httpUserAgent}}{{{cabalName}}}/{{{cabalVersion}}}{{/httpUserAgent}}"@ -- newConfig :: IO {{configType}} newConfig = do logCxt <- initLogContext return $ {{configType}} { configHost = "{{{basePath}}}" - , configUserAgent = "{{#httpUserAgent}}{{{.}}}{{/httpUserAgent}}{{^httpUserAgent}}{{{cabalName}}}/{{{cabalVersion}}}{{/httpUserAgent}}" + , configUserAgent = "{{{httpUserAgent}}}{{^httpUserAgent}}{{{cabalName}}}/{{{cabalVersion}}}{{/httpUserAgent}}" , configLogExecWithContext = runDefaultLogExecWithContext , configLogContext = logCxt , configAuthMethods = [] , configValidateAuthMethods = True - } + } -- | updates config use AuthMethod on matching requests addAuthMethod :: AuthMethod auth => {{configType}} -> auth -> {{configType}} @@ -121,7 +121,7 @@ withStderrLogging p = do -- | updates the config to disable logging withNoLogging :: {{configType}} -> {{configType}} withNoLogging p = p { configLogExecWithContext = runNullLogExec} - + -- * {{requestType}} -- | Represents a request. @@ -220,7 +220,7 @@ data ParamBody -- ** {{requestType}} Utils -_mkRequest :: NH.Method -- ^ Method +_mkRequest :: NH.Method -- ^ Method -> [BCL.ByteString] -- ^ Endpoint -> {{requestType}} req contentType res accept -- ^ req: Request Type, res: Response Type _mkRequest m u = {{requestType}} m u _mkParams [] @@ -254,13 +254,13 @@ removeHeader req header = _setContentTypeHeader :: forall req contentType res accept. MimeType contentType => {{requestType}} req contentType res accept -> {{requestType}} req contentType res accept _setContentTypeHeader req = - case mimeType (P.Proxy :: P.Proxy contentType) of + case mimeType (P.Proxy :: P.Proxy contentType) of Just m -> req `setHeader` [("content-type", BC.pack $ P.show m)] Nothing -> req `removeHeader` ["content-type"] _setAcceptHeader :: forall req contentType res accept. MimeType accept => {{requestType}} req contentType res accept -> {{requestType}} req contentType res accept _setAcceptHeader req = - case mimeType (P.Proxy :: P.Proxy accept) of + case mimeType (P.Proxy :: P.Proxy accept) of Just m -> req `setHeader` [("accept", BC.pack $ P.show m)] Nothing -> req `removeHeader` ["accept"] @@ -284,25 +284,25 @@ addQuery :: addQuery req query = req & L.over (rParamsL . paramsQueryL) (query P.++) addForm :: {{requestType}} req contentType res accept -> WH.Form -> {{requestType}} req contentType res accept -addForm req newform = +addForm req newform = let form = case paramsBody (rParams req) of ParamBodyFormUrlEncoded _form -> _form _ -> mempty in req & L.set (rParamsL . paramsBodyL) (ParamBodyFormUrlEncoded (newform <> form)) _addMultiFormPart :: {{requestType}} req contentType res accept -> NH.Part -> {{requestType}} req contentType res accept -_addMultiFormPart req newpart = +_addMultiFormPart req newpart = let parts = case paramsBody (rParams req) of ParamBodyMultipartFormData _parts -> _parts _ -> [] in req & L.set (rParamsL . paramsBodyL) (ParamBodyMultipartFormData (newpart : parts)) _setBodyBS :: {{requestType}} req contentType res accept -> B.ByteString -> {{requestType}} req contentType res accept -_setBodyBS req body = +_setBodyBS req body = req & L.set (rParamsL . paramsBodyL) (ParamBodyB body) _setBodyLBS :: {{requestType}} req contentType res accept -> BL.ByteString -> {{requestType}} req contentType res accept -_setBodyLBS req body = +_setBodyLBS req body = req & L.set (rParamsL . paramsBodyL) (ParamBodyBL body) _hasAuthType :: AuthMethod authMethod => {{requestType}} req contentType res accept -> P.Proxy authMethod -> {{requestType}} req contentType res accept @@ -371,7 +371,7 @@ _toCollA' c encode one xs = case c of {-# INLINE go #-} {-# INLINE expandList #-} {-# INLINE combine #-} - + -- * AuthMethods -- | Provides a method to apply auth methods to requests @@ -402,7 +402,7 @@ _applyAuthMethods req config@({{configType}} {configAuthMethods = as}) = foldlM go req as where go r (AnyAuthMethod a) = applyAuthMethod config a r - + -- * Utils -- | Removes Null fields. (OpenAPI-Specification 2.0 does not allow Null in JSON) @@ -445,16 +445,16 @@ instance P.Show DateTime where instance MimeRender MimeMultipartFormData DateTime where mimeRender _ = mimeRenderDefaultMultipartFormData --- | @{{#dateTimeParseFormat}}TI.parseTimeM True TI.defaultTimeLocale "{{{dateTimeParseFormat}}}"{{/dateTimeParseFormat}}{{^dateTimeParseFormat}}{{#dateTimeFormat}}TI.parseTimeM True TI.defaultTimeLocale "{{{dateTimeFormat}}}"{{/dateTimeFormat}}{{^dateTimeFormat}}_parseISO8601{{/dateTimeFormat}}{{/dateTimeParseFormat}}@ +-- | @{{#dateTimeParseFormat}}TI.parseTimeM True TI.defaultTimeLocale "{{{.}}}"{{/dateTimeParseFormat}}{{^dateTimeParseFormat}}{{#dateTimeFormat}}TI.parseTimeM True TI.defaultTimeLocale "{{{.}}}"{{/dateTimeFormat}}{{^dateTimeFormat}}_parseISO8601{{/dateTimeFormat}}{{/dateTimeParseFormat}}@ _readDateTime :: (MonadFail m{{^dateTimeFormat}}, Alternative m{{/dateTimeFormat}}) => String -> m DateTime _readDateTime s = - DateTime <$> {{#dateTimeParseFormat}}TI.parseTimeM True TI.defaultTimeLocale "{{{dateTimeParseFormat}}}"{{/dateTimeParseFormat}}{{^dateTimeParseFormat}}{{#dateTimeFormat}}TI.parseTimeM True TI.defaultTimeLocale "{{{dateTimeFormat}}}"{{/dateTimeFormat}}{{^dateTimeFormat}}_parseISO8601{{/dateTimeFormat}}{{/dateTimeParseFormat}} s + DateTime <$> {{#dateTimeParseFormat}}TI.parseTimeM True TI.defaultTimeLocale "{{{.}}}"{{/dateTimeParseFormat}}{{^dateTimeParseFormat}}{{#dateTimeFormat}}TI.parseTimeM True TI.defaultTimeLocale "{{{.}}}"{{/dateTimeFormat}}{{^dateTimeFormat}}_parseISO8601{{/dateTimeFormat}}{{/dateTimeParseFormat}} s {-# INLINE _readDateTime #-} --- | @{{^dateTimeFormat}}TI.formatISO8601Millis{{/dateTimeFormat}}{{#dateTimeFormat}}TI.formatTime TI.defaultTimeLocale "{{{dateTimeFormat}}}"{{/dateTimeFormat}}@ +-- | @{{^dateTimeFormat}}TI.formatISO8601Millis{{/dateTimeFormat}}{{#dateTimeFormat}}TI.formatTime TI.defaultTimeLocale "{{{.}}}"{{/dateTimeFormat}}@ _showDateTime :: ({{^dateTimeFormat}}t ~ TI.UTCTime, {{/dateTimeFormat}}TI.FormatTime t) => t -> String _showDateTime = - {{#dateTimeFormat}}TI.formatTime TI.defaultTimeLocale "{{{dateTimeFormat}}}"{{/dateTimeFormat}}{{^dateTimeFormat}}TI.formatISO8601Millis{{/dateTimeFormat}} + {{#dateTimeFormat}}TI.formatTime TI.defaultTimeLocale "{{{.}}}"{{/dateTimeFormat}}{{^dateTimeFormat}}TI.formatISO8601Millis{{/dateTimeFormat}} {-# INLINE _showDateTime #-} -- | parse an ISO8601 date-time string @@ -495,7 +495,7 @@ _showDate = -- * Byte/Binary Formatting - + -- | base64 encoded characters newtype ByteArray = ByteArray { unByteArray :: BL.ByteString } deriving (P.Eq,P.Data,P.Ord,P.Typeable,NF.NFData) diff --git a/modules/openapi-generator/src/main/resources/haskell-http-client/LoggingKatip.mustache b/modules/openapi-generator/src/main/resources/haskell-http-client/LoggingKatip.mustache index 693820cd291..479818737ae 100644 --- a/modules/openapi-generator/src/main/resources/haskell-http-client/LoggingKatip.mustache +++ b/modules/openapi-generator/src/main/resources/haskell-http-client/LoggingKatip.mustache @@ -106,4 +106,3 @@ levelError = LG.ErrorS levelDebug :: LogLevel levelDebug = LG.DebugS - diff --git a/modules/openapi-generator/src/main/resources/haskell-http-client/Model.mustache b/modules/openapi-generator/src/main/resources/haskell-http-client/Model.mustache index b6ffd40e3ad..7655a54c09f 100644 --- a/modules/openapi-generator/src/main/resources/haskell-http-client/Model.mustache +++ b/modules/openapi-generator/src/main/resources/haskell-http-client/Model.mustache @@ -72,11 +72,11 @@ newtype {{{x-param-name-type}}} = {{{x-param-name-type}}} { un{{{x-param-name-ty -- {{{.}}}{{/description}}{{#isAlias}} newtype {{classname}} = {{classname}} { un{{classname}} :: {{{vendorExtensions.x-data-type}}} - } deriving (P.Eq, P.Show, P.Typeable, A.ToJSON, A.FromJSON{{#modelDeriving}}, {{modelDeriving}}{{/modelDeriving}}){{/isAlias}}{{^isAlias}} + } deriving (P.Eq, P.Show, P.Typeable, A.ToJSON, A.FromJSON{{#modelDeriving}}, {{.}}{{/modelDeriving}}){{/isAlias}}{{^isAlias}} data {{classname}} = {{classname}} - { {{#vars}}{{name}} :: {{#x-strictFields}}!({{/x-strictFields}}{{^required}}Maybe {{/required}}{{{vendorExtensions.x-data-type}}}{{#x-strictFields}}){{/x-strictFields}} -- ^ {{#required}}/Required/ {{/required}}{{#isReadOnly}}/ReadOnly/ {{/isReadOnly}}"{{baseName}}"{{#description}} - {{description}}{{/description}}{{^-last}} + { {{#vars}}{{name}} :: {{#x-strictFields}}!({{/x-strictFields}}{{^required}}Maybe {{/required}}{{{vendorExtensions.x-data-type}}}{{#x-strictFields}}){{/x-strictFields}} -- ^ {{#required}}/Required/ {{/required}}{{#isReadOnly}}/ReadOnly/ {{/isReadOnly}}"{{baseName}}"{{#description}} - {{.}}{{/description}}{{^-last}} , {{/-last}}{{/vars}} - } deriving (P.Show, P.Eq, P.Typeable{{#modelDeriving}}, {{modelDeriving}}{{/modelDeriving}}){{/isAlias}} + } deriving (P.Show, P.Eq, P.Typeable{{#modelDeriving}}, {{.}}{{/modelDeriving}}){{/isAlias}} {{^isAlias}}-- | FromJSON {{classname}} instance A.FromJSON {{classname}} where @@ -189,7 +189,7 @@ instance AuthMethod {{name}} where applyAuthMethod _ a@({{name}} secret) req = P.pure $ if (P.typeOf a `P.elem` rAuthTypes req) - then req `setHeader` toHeader ("Authorization", "Bearer " <> secret) + then req `setHeader` toHeader ("Authorization", "Bearer " <> secret) & L.over rAuthTypesL (P.filter (/= P.typeOf a)) else req diff --git a/modules/openapi-generator/src/main/resources/haskell-http-client/README.mustache b/modules/openapi-generator/src/main/resources/haskell-http-client/README.mustache index deec0c0cacb..acd5efa0426 100644 --- a/modules/openapi-generator/src/main/resources/haskell-http-client/README.mustache +++ b/modules/openapi-generator/src/main/resources/haskell-http-client/README.mustache @@ -15,7 +15,7 @@ stack haddock ``` which will generate docs for this lib in the `docs` folder. -To generate the docs in the normal location (to enable hyperlinks to external libs), remove +To generate the docs in the normal location (to enable hyperlinks to external libs), remove ``` build: haddock-arguments: @@ -82,7 +82,7 @@ These options allow some customization of the code generation process. An example setting _dateTimeFormat_ and _strictFields_: ``` -java -jar openapi-generator-cli.jar generate -i petstore.yaml -g haskell-http-client -o output/haskell-http-client --additional-properties=dateTimeFormat="%Y-%m-%dT%H:%M:%S%Q%z" --additional-properties=strictFields=false +java -jar openapi-generator-cli.jar generate -i petstore.yaml -g haskell-http-client -o output/haskell-http-client --additional-properties=dateTimeFormat="%Y-%m-%dT%H:%M:%S%Q%z" --additional-properties=strictFields=false ``` View the full list of Codegen "config option" parameters with the command: @@ -136,10 +136,10 @@ in GHCi or via the Haddocks. * optional non-body parameters are included by using `applyOptionalParam` * optional body parameters are set by using `setBodyParam` -Example code generated for pretend _addFoo_ operation: +Example code generated for pretend _addFoo_ operation: ```haskell -data AddFoo +data AddFoo instance Consumes AddFoo MimeJSON instance Produces AddFoo MimeJSON instance Produces AddFoo MimeXML @@ -182,14 +182,14 @@ the config, it will be applied to the request. ```haskell mgr <- newManager defaultManagerSettings -config0 <- withStdoutLogging =<< newConfig +config0 <- withStdoutLogging =<< newConfig let config = config0 `addAuthMethod` AuthOAuthFoo "secret-key" -let addFooRequest = - addFoo - (ContentType MimeJSON) - (Accept MimeXML) +let addFooRequest = + addFoo + (ContentType MimeJSON) + (Accept MimeXML) (ParamBar paramBar) (ParamQux paramQux) modelBaz diff --git a/modules/openapi-generator/src/main/resources/haskell-http-client/git_push.sh.mustache b/modules/openapi-generator/src/main/resources/haskell-http-client/git_push.sh.mustache index 8b3f689c912..f0bed5bd841 100644 --- a/modules/openapi-generator/src/main/resources/haskell-http-client/git_push.sh.mustache +++ b/modules/openapi-generator/src/main/resources/haskell-http-client/git_push.sh.mustache @@ -55,4 +55,3 @@ git pull origin master # Pushes (Forces) the changes in the local repository up to the remote repository echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" git push origin master 2>&1 | grep -v 'To https' - diff --git a/modules/openapi-generator/src/main/resources/haskell-http-client/tests/Instances.mustache b/modules/openapi-generator/src/main/resources/haskell-http-client/tests/Instances.mustache index dfa64cbb929..ca4bcf42671 100644 --- a/modules/openapi-generator/src/main/resources/haskell-http-client/tests/Instances.mustache +++ b/modules/openapi-generator/src/main/resources/haskell-http-client/tests/Instances.mustache @@ -72,7 +72,7 @@ instance Arbitrary A.Value where sizedObject n = liftM (A.object . map mapF) $ replicateM n $ (,) <$> (arbitrary :: Gen String) <*> simpleAndArrays - + -- | Checks if a given list has no duplicates in _O(n log n)_. hasNoDups :: (Ord a) @@ -87,7 +87,7 @@ hasNoDups = go Set.empty instance ApproxEq TI.Day where (=~) = (==) - + arbitraryReduced :: Arbitrary a => Int -> Gen a arbitraryReduced n = resize (n `div` 2) arbitrary @@ -104,7 +104,7 @@ arbitraryReducedMaybeValue n = do else return generated -- * Models - + {{#models}} {{#model}} {{^isEnum}} diff --git a/modules/openapi-generator/src/main/resources/htmlDocs/bodyParam.mustache b/modules/openapi-generator/src/main/resources/htmlDocs/bodyParam.mustache index 006149abf79..1c3e14a8090 100644 --- a/modules/openapi-generator/src/main/resources/htmlDocs/bodyParam.mustache +++ b/modules/openapi-generator/src/main/resources/htmlDocs/bodyParam.mustache @@ -1,3 +1,3 @@ {{#isBodyParam}}
{{baseName}} {{#baseType}}{{baseType}}{{/baseType}} {{^required}}(optional){{/required}}{{#required}}(required){{/required}}
-
Body Parameter — {{unescapedDescription}} {{#defaultValue}}default: {{{defaultValue}}}{{/defaultValue}}
{{/isBodyParam}} +
Body Parameter — {{unescapedDescription}} {{#defaultValue}}default: {{{.}}}{{/defaultValue}}
{{/isBodyParam}} diff --git a/modules/openapi-generator/src/main/resources/htmlDocs/formParam.mustache b/modules/openapi-generator/src/main/resources/htmlDocs/formParam.mustache index 19e3fddab8a..bea19ea953b 100644 --- a/modules/openapi-generator/src/main/resources/htmlDocs/formParam.mustache +++ b/modules/openapi-generator/src/main/resources/htmlDocs/formParam.mustache @@ -1,3 +1,3 @@ {{#isFormParam}}
{{baseName}} {{^required}}(optional){{/required}}{{#required}}(required){{/required}}
-
Form Parameter — {{unescapedDescription}} {{#defaultValue}}default: {{{defaultValue}}} {{/defaultValue}}{{#dataFormat}}format: {{{dataFormat}}}{{/dataFormat}}
{{/isFormParam}} \ No newline at end of file +
Form Parameter — {{unescapedDescription}} {{#defaultValue}}default: {{{.}}} {{/defaultValue}}{{#dataFormat}}format: {{{.}}}{{/dataFormat}}
{{/isFormParam}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/htmlDocs/headerParam.mustache b/modules/openapi-generator/src/main/resources/htmlDocs/headerParam.mustache index 7f5d4efc140..6c6614b0945 100644 --- a/modules/openapi-generator/src/main/resources/htmlDocs/headerParam.mustache +++ b/modules/openapi-generator/src/main/resources/htmlDocs/headerParam.mustache @@ -1,3 +1,3 @@
{{baseName}} {{^required}}(optional){{/required}}{{#required}}(required){{/required}}
-
Header Parameter — {{unescapedDescription}} {{#defaultValue}}default: {{{defaultValue}}} {{/defaultValue}}{{#dataFormat}}format: {{{dataFormat}}}{{/dataFormat}}
+
Header Parameter — {{unescapedDescription}} {{#defaultValue}}default: {{{.}}} {{/defaultValue}}{{#dataFormat}}format: {{{.}}}{{/dataFormat}}
diff --git a/modules/openapi-generator/src/main/resources/htmlDocs/index.mustache b/modules/openapi-generator/src/main/resources/htmlDocs/index.mustache index eb13cf63fc2..a5ad68cc9c8 100644 --- a/modules/openapi-generator/src/main/resources/htmlDocs/index.mustache +++ b/modules/openapi-generator/src/main/resources/htmlDocs/index.mustache @@ -11,8 +11,8 @@
{{{appDescription}}}
{{#infoUrl}}
More information: {{{infoUrl}}}
{{/infoUrl}} {{#infoEmail}}
Contact Info: {{{infoEmail}}}
{{/infoEmail}} - {{#version}}
Version: {{{version}}}
{{/version}} - {{#basePathWithoutHost}}
BasePath:{{basePathWithoutHost}}
{{/basePathWithoutHost}} + {{#version}}
Version: {{{.}}}
{{/version}} + {{#basePathWithoutHost}}
BasePath:{{.}}
{{/basePathWithoutHost}}
{{{licenseInfo}}}
{{{licenseUrl}}}

Access

@@ -155,7 +155,7 @@
    {{#models}} {{#model}} -
  1. {{name}}{{#title}} - {{title}}{{/title}}
  2. +
  3. {{name}}{{#title}} - {{.}}{{/title}}
  4. {{/model}} {{/models}}
@@ -163,10 +163,10 @@ {{#models}} {{#model}}
-

{{name}}{{#title}} - {{title}}{{/title}} Up

- {{#unescapedDescription}}
{{unescapedDescription}}
{{/unescapedDescription}} +

{{name}}{{#title}} - {{.}}{{/title}} Up

+ {{#unescapedDescription}}
{{.}}
{{/unescapedDescription}}
- {{#vars}}
{{name}} {{^required}}(optional){{/required}}
{{^isPrimitiveType}}{{dataType}}{{/isPrimitiveType}} {{unescapedDescription}} {{#dataFormat}}format: {{{dataFormat}}}{{/dataFormat}}
+ {{#vars}}
{{name}} {{^required}}(optional){{/required}}
{{^isPrimitiveType}}{{dataType}}{{/isPrimitiveType}} {{unescapedDescription}} {{#dataFormat}}format: {{{.}}}{{/dataFormat}}
{{#isEnum}}
Enum:
{{#_enum}}
{{this}}
{{/_enum}} diff --git a/modules/openapi-generator/src/main/resources/htmlDocs/pathParam.mustache b/modules/openapi-generator/src/main/resources/htmlDocs/pathParam.mustache index df8d9920400..4c21c3f480a 100644 --- a/modules/openapi-generator/src/main/resources/htmlDocs/pathParam.mustache +++ b/modules/openapi-generator/src/main/resources/htmlDocs/pathParam.mustache @@ -1,3 +1,3 @@ {{#isPathParam}}
{{baseName}} {{^required}}(optional){{/required}}{{#required}}(required){{/required}}
-
Path Parameter — {{unescapedDescription}} {{#defaultValue}}default: {{{defaultValue}}} {{/defaultValue}}{{#dataFormat}}format: {{{dataFormat}}}{{/dataFormat}}
{{/isPathParam}} \ No newline at end of file +
Path Parameter — {{unescapedDescription}} {{#defaultValue}}default: {{{.}}} {{/defaultValue}}{{#dataFormat}}format: {{{.}}}{{/dataFormat}}
{{/isPathParam}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/htmlDocs/queryParam.mustache b/modules/openapi-generator/src/main/resources/htmlDocs/queryParam.mustache index 79f7ab2b8c6..ee15a268a24 100644 --- a/modules/openapi-generator/src/main/resources/htmlDocs/queryParam.mustache +++ b/modules/openapi-generator/src/main/resources/htmlDocs/queryParam.mustache @@ -1,3 +1,3 @@ {{#isQueryParam}}
{{baseName}} {{^required}}(optional){{/required}}{{#required}}(required){{/required}}
-
Query Parameter — {{unescapedDescription}} {{#defaultValue}}default: {{{defaultValue}}} {{/defaultValue}}{{#dataFormat}}format: {{{dataFormat}}}{{/dataFormat}}
{{/isQueryParam}} \ No newline at end of file +
Query Parameter — {{unescapedDescription}} {{#defaultValue}}default: {{{.}}} {{/defaultValue}}{{#dataFormat}}format: {{{.}}}{{/dataFormat}}
{{/isQueryParam}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/htmlDocs2/index.mustache b/modules/openapi-generator/src/main/resources/htmlDocs2/index.mustache index 5ff3aa02980..10af1ef7d19 100644 --- a/modules/openapi-generator/src/main/resources/htmlDocs2/index.mustache +++ b/modules/openapi-generator/src/main/resources/htmlDocs2/index.mustache @@ -200,7 +200,7 @@

API and SDK Documentation

{{#version}} -
Version: {{{version}}}
+
Version: {{{.}}}
{{/version}}
@@ -492,10 +492,10 @@ {{#headers}} - {{#name}}{{name}}{{/name}} + {{name}} {{#datatype}}{{dataType}}{{/datatype}} - {{#dataFormat}}{{dataFormat}}{{/dataFormat}} - {{#description}}{{description}}{{/description}} + {{dataFormat}} + {{description}} {{/headers}} @@ -523,10 +523,10 @@ {{/infoEmail}}

{{#licenseInfo}} -
{{{licenseInfo}}}
+
{{{.}}}
{{/licenseInfo}} {{#licenseUrl}} -
{{{licenseUrl}}}
+
{{{.}}}
{{/licenseUrl}}
diff --git a/modules/openapi-generator/src/main/resources/htmlDocs2/js_jsonformatter.mustache b/modules/openapi-generator/src/main/resources/htmlDocs2/js_jsonformatter.mustache index 3936dc85149..e3bcee88471 100644 --- a/modules/openapi-generator/src/main/resources/htmlDocs2/js_jsonformatter.mustache +++ b/modules/openapi-generator/src/main/resources/htmlDocs2/js_jsonformatter.mustache @@ -497,7 +497,7 @@ return /******/ (function(modules) { // webpackBootstrap /***/ function(module, exports, __webpack_require__) { // style-loader: Adds some css to the DOM by adding a