{{/injectionTokenTyped}}('basePath');
4 | export const COLLECTION_FORMATS = {
5 | 'csv': ',',
6 | 'tsv': ' ',
7 | 'ssv': ' ',
8 | 'pipes': '|'
9 | }
10 |
--------------------------------------------------------------------------------
/src/main/resources/handlebars/typescript-angular/modelEnum.mustache:
--------------------------------------------------------------------------------
1 | export type {{classname}} = {{#allowableValues}}{{#enumVars}}{{{value}}}{{^@last}} | {{/@last}}{{/enumVars}}{{/allowableValues}};
2 |
3 | export const {{classname}} = {
4 | {{#allowableValues}}
5 | {{#enumVars}}
6 | {{name}}: {{{value}}} as {{classname}}{{^@last}},{{/@last}}
7 | {{/enumVars}}
8 | {{/allowableValues}}
9 | };
--------------------------------------------------------------------------------
/src/main/resources/handlebars/aspnetcore/build.sh.mustache:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 | #
3 | # Generated by: https://github.com/swagger-api/swagger-codegen.git
4 | #
5 |
6 | dotnet restore src/{{packageName}}/ && \
7 | dotnet build src/{{packageName}}/ && \
8 | echo "Now, run the following to start the project: dotnet run -p src/{{packageName}}/{{packageName}}.csproj --launch-profile web"
9 |
--------------------------------------------------------------------------------
/src/main/resources/handlebars/R/partial_header.mustache:
--------------------------------------------------------------------------------
1 | {{#appName}}
2 | # {{{appName}}}
3 | #
4 | {{/appName}}
5 | {{#appDescription}}
6 | # {{{appDescription}}}
7 | #
8 | {{/appDescription}}
9 | # {{#version}}OpenAPI spec version: {{{version}}}{{/version}}
10 | # {{#infoEmail}}Contact: {{{infoEmail}}}{{/infoEmail}}
11 | # Generated by: https://github.com/swagger-api/swagger-codegen.git
12 |
--------------------------------------------------------------------------------
/src/main/resources/handlebars/scala/client/gitignore.mustache:
--------------------------------------------------------------------------------
1 | # scala specific
2 | *.class
3 | *.log
4 |
5 | # sbt specific
6 | .cache
7 | .history
8 | .lib/
9 | dist/*
10 | target/
11 | lib_managed/
12 | src_managed/
13 | project/boot/
14 | project/plugins/project/
15 |
16 | # Scala-IDE specific
17 | .scala_dependencies
18 | .worksheet
19 |
20 | # IntelliJ specific
21 | .idea
22 | *.iml
23 |
--------------------------------------------------------------------------------
/src/main/java/io/swagger/codegen/v3/generators/features/UseGenericResponseFeatures.java:
--------------------------------------------------------------------------------
1 | package io.swagger.codegen.v3.generators.features;
2 |
3 | public interface UseGenericResponseFeatures {
4 | // Language supports generating generic Jaxrs or native return types
5 | String USE_GENERIC_RESPONSE = "useGenericResponse";
6 |
7 | void setUseGenericResponse(boolean useGenericResponse);
8 | }
9 |
--------------------------------------------------------------------------------
/src/main/resources/handlebars/go-server/controller-api.mustache:
--------------------------------------------------------------------------------
1 | {{>partial_header}}
2 | package {{packageName}}
3 |
4 | {{#operations}}
5 | import (
6 | "net/http"
7 | ){{#operation}}
8 |
9 | func {{nickname}}(w http.ResponseWriter, r *http.Request) {
10 | w.Header().Set("Content-Type", "application/json; charset=UTF-8")
11 | w.WriteHeader(http.StatusOK)
12 | }{{/operation}}{{/operations}}
13 |
--------------------------------------------------------------------------------
/src/main/resources/handlebars/JavaJaxRS/interface.mustache:
--------------------------------------------------------------------------------
1 | /**
2 | * {{#description}}{{.}}{{/description}}{{^description}}{{classname}}{{/description}}
3 | */
4 | public interface {{{classname}}} {
5 |
6 | {{#vendorExtensions}}
7 | {{#x-discriminator-type-getter}}
8 | {{x-discriminator-type}} {{x-discriminator-type-getter}}();
9 | {{/x-discriminator-type-getter}}
10 | {{/vendorExtensions}}
11 | }
12 |
--------------------------------------------------------------------------------
/src/main/resources/handlebars/csharp/project.json.mustache:
--------------------------------------------------------------------------------
1 | {
2 | "supports": {},
3 | "dependencies": {
4 | "FubarCoder.RestSharp.Portable.Core": "4.0.7",
5 | "FubarCoder.RestSharp.Portable.HttpClient": "4.0.7",
6 | "Newtonsoft.Json": "10.0.3",
7 | "JsonSubTypes": "1.2.0"
8 | },
9 | "frameworks": {
10 | "{{targetFrameworkNuget}}": {}
11 | }
12 | }
--------------------------------------------------------------------------------
/src/main/java/io/swagger/codegen/v3/generators/features/PerformBeanValidationFeatures.java:
--------------------------------------------------------------------------------
1 | package io.swagger.codegen.v3.generators.features;
2 |
3 | public interface PerformBeanValidationFeatures {
4 |
5 | // Language supports performing BeanValidation
6 | String PERFORM_BEANVALIDATION = "performBeanValidation";
7 |
8 | void setPerformBeanValidation(boolean performBeanValidation);
9 | }
10 |
--------------------------------------------------------------------------------
/src/main/resources/handlebars/JavaInflector/interface.mustache:
--------------------------------------------------------------------------------
1 | /**
2 | * {{#description}}{{.}}{{/description}}{{^description}}{{classname}}{{/description}}
3 | */
4 | public interface {{{classname}}} {
5 |
6 | {{#vendorExtensions}}
7 | {{#x-discriminator-type-getter}}
8 | {{x-discriminator-type}} {{x-discriminator-type-getter}}();
9 | {{/x-discriminator-type-getter}}
10 | {{/vendorExtensions}}
11 | }
12 |
--------------------------------------------------------------------------------
/src/main/resources/handlebars/JavaJaxRS/cxf/interface.mustache:
--------------------------------------------------------------------------------
1 | /**
2 | * {{#description}}{{.}}{{/description}}{{^description}}{{classname}}{{/description}}
3 | */
4 | public interface {{{classname}}} {
5 |
6 | {{#vendorExtensions}}
7 | {{#x-discriminator-type-getter}}
8 | {{x-discriminator-type}} {{x-discriminator-type-getter}}();
9 | {{/x-discriminator-type-getter}}
10 | {{/vendorExtensions}}
11 | }
12 |
--------------------------------------------------------------------------------
/src/main/resources/handlebars/JavaJaxRS/spec/interface.mustache:
--------------------------------------------------------------------------------
1 | /**
2 | * {{#description}}{{.}}{{/description}}{{^description}}{{classname}}{{/description}}
3 | */
4 | public interface {{{classname}}} {
5 |
6 | {{#vendorExtensions}}
7 | {{#x-discriminator-type-getter}}
8 | {{x-discriminator-type}} {{x-discriminator-type-getter}}();
9 | {{/x-discriminator-type-getter}}
10 | {{/vendorExtensions}}
11 | }
12 |
--------------------------------------------------------------------------------
/src/main/resources/handlebars/csharp-471/project.json.mustache:
--------------------------------------------------------------------------------
1 | {
2 | "supports": {},
3 | "dependencies": {
4 | "FubarCoder.RestSharp.Portable.Core": "4.0.7",
5 | "FubarCoder.RestSharp.Portable.HttpClient": "4.0.7",
6 | "Newtonsoft.Json": "10.0.3",
7 | "JsonSubTypes": "1.2.0"
8 | },
9 | "frameworks": {
10 | "{{targetFrameworkNuget}}": {}
11 | }
12 | }
--------------------------------------------------------------------------------
/src/main/resources/handlebars/JavaJaxRS/cxf-cdi/interface.mustache:
--------------------------------------------------------------------------------
1 | /**
2 | * {{#description}}{{.}}{{/description}}{{^description}}{{classname}}{{/description}}
3 | */
4 | public interface {{{classname}}} {
5 |
6 | {{#vendorExtensions}}
7 | {{#x-discriminator-type-getter}}
8 | {{x-discriminator-type}} {{x-discriminator-type-getter}}();
9 | {{/x-discriminator-type-getter}}
10 | {{/vendorExtensions}}
11 | }
12 |
--------------------------------------------------------------------------------
/src/main/java/io/swagger/codegen/v3/generators/handlebars/IsHelper.java:
--------------------------------------------------------------------------------
1 | package io.swagger.codegen.v3.generators.handlebars;
2 |
3 | import static io.swagger.codegen.v3.VendorExtendable.PREFIX_IS;
4 |
5 | public class IsHelper extends ExtensionHelper {
6 |
7 | public static final String NAME = "is";
8 |
9 | @Override
10 | public String getPreffix() {
11 | return PREFIX_IS;
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/src/main/resources/handlebars/JavaJaxRS/resteasy/eap/interface.mustache:
--------------------------------------------------------------------------------
1 | /**
2 | * {{#description}}{{.}}{{/description}}{{^description}}{{classname}}{{/description}}
3 | */
4 | public interface {{{classname}}} {
5 |
6 | {{#vendorExtensions}}
7 | {{#x-discriminator-type-getter}}
8 | {{x-discriminator-type}} {{x-discriminator-type-getter}}();
9 | {{/x-discriminator-type-getter}}
10 | {{/vendorExtensions}}
11 | }
12 |
--------------------------------------------------------------------------------
/src/main/resources/handlebars/javascript/es6/model.mustache:
--------------------------------------------------------------------------------
1 | {{>licenseInfo}}
2 | import ApiClient from '../ApiClient';
3 | {{#imports}}
4 | import {{import}} from './{{import}}';
5 | {{/imports}}
6 |
7 | {{#models}}
8 | {{#model}}
9 | {{#isEnum}}
10 | {{>partial_model_enum_class}}
11 | {{/isEnum}}
12 | {{^isEnum}}
13 | {{>partial_model_generic}}
14 | {{/isEnum}}
15 | {{/model}}
16 | {{/models}}
17 |
--------------------------------------------------------------------------------
/src/main/resources/handlebars/kotlin-server/enum_class.mustache:
--------------------------------------------------------------------------------
1 | /**
2 | * {{{description}}}
3 | * Values: {{#allowableValues}}{{#enumVars}}{{&name}}{{^@last}},{{/@last}}{{/enumVars}}{{/allowableValues}}
4 | */
5 | enum class {{classname}}(val value: {{dataType}}){
6 | {{#allowableValues}}{{#enumVars}}
7 | {{&name}}({{{value}}}){{^@last}},{{/@last}}{{#@last}};{{/@last}}
8 | {{/enumVars}}{{/allowableValues}}
9 | }
10 |
--------------------------------------------------------------------------------
/src/main/java/io/swagger/codegen/v3/generators/handlebars/HasHelper.java:
--------------------------------------------------------------------------------
1 | package io.swagger.codegen.v3.generators.handlebars;
2 |
3 | import static io.swagger.codegen.v3.VendorExtendable.PREFIX_HAS;
4 |
5 | public class HasHelper extends ExtensionHelper {
6 |
7 | public static final String NAME = "has";
8 |
9 | @Override
10 | public String getPreffix() {
11 | return PREFIX_HAS;
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/src/main/resources/handlebars/csharp/partial_header.mustache:
--------------------------------------------------------------------------------
1 | /*
2 | {{#appName}}
3 | * {{{appName}}}
4 | *
5 | {{/appName}}
6 | {{#appDescription}}
7 | * {{{appDescription}}}
8 | *
9 | {{/appDescription}}
10 | * {{#version}}OpenAPI spec version: {{{version}}}{{/version}}
11 | * {{#infoEmail}}Contact: {{{infoEmail}}}{{/infoEmail}}
12 | * Generated by: https://github.com/swagger-api/swagger-codegen.git
13 | */
14 |
--------------------------------------------------------------------------------
/src/main/resources/handlebars/go/gitignore.mustache:
--------------------------------------------------------------------------------
1 | # Compiled Object files, Static and Dynamic libs (Shared Objects)
2 | *.o
3 | *.a
4 | *.so
5 |
6 | # Folders
7 | _obj
8 | _test
9 |
10 | # Architecture specific extensions/prefixes
11 | *.[568vq]
12 | [568vq].out
13 |
14 | *.cgo1.go
15 | *.cgo2.c
16 | _cgo_defun.c
17 | _cgo_gotypes.go
18 | _cgo_export.*
19 |
20 | _testmain.go
21 |
22 | *.exe
23 | *.test
24 | *.prof
25 |
--------------------------------------------------------------------------------
/src/main/resources/handlebars/swift5/modelInlineEnumDeclaration.mustache:
--------------------------------------------------------------------------------
1 | public enum {{enumName}}: {{^isContainer}}{{datatype}}{{/isContainer}}{{#isContainer}}String{{/isContainer}}, Codable { {{#allowableValues}}{{#enumVars}}
2 | case {{name}} = {{#isContainer}}"{{/isContainer}}{{#isString}}"{{/isString}}{{{value}}}{{#isString}}"{{/isString}}{{#isContainer}}"{{/isContainer}}{{/enumVars}}{{/allowableValues}}
3 | }
4 |
--------------------------------------------------------------------------------
/src/main/resources/handlebars/aspnetcore/build.bat.mustache:
--------------------------------------------------------------------------------
1 | :: Generated by: https://github.com/swagger-api/swagger-codegen.git
2 | ::
3 |
4 | @echo off
5 |
6 | dotnet restore src{{backslash}}{{packageName}}
7 | dotnet build src{{backslash}}{{packageName}}
8 | echo Now, run the following to start the project: dotnet run -p src{{backslash}}{{packageName}}{{backslash}}{{packageName}}.csproj --launch-profile web.
9 | echo.
10 |
--------------------------------------------------------------------------------
/src/main/resources/handlebars/aspnetcore/partial_header.mustache:
--------------------------------------------------------------------------------
1 | /*
2 | {{#appName}}
3 | * {{{appName}}}
4 | *
5 | {{/appName}}
6 | {{#appDescription}}
7 | * {{{appDescription}}}
8 | *
9 | {{/appDescription}}
10 | * {{#version}}OpenAPI spec version: {{{version}}}{{/version}}
11 | * {{#infoEmail}}Contact: {{{infoEmail}}}{{/infoEmail}}
12 | * Generated by: https://github.com/swagger-api/swagger-codegen.git
13 | */
14 |
--------------------------------------------------------------------------------
/src/main/resources/handlebars/csharp-471/partial_header.mustache:
--------------------------------------------------------------------------------
1 | /*
2 | {{#appName}}
3 | * {{{appName}}}
4 | *
5 | {{/appName}}
6 | {{#appDescription}}
7 | * {{{appDescription}}}
8 | *
9 | {{/appDescription}}
10 | * {{#version}}OpenAPI spec version: {{{version}}}{{/version}}
11 | * {{#infoEmail}}Contact: {{{infoEmail}}}{{/infoEmail}}
12 | * Generated by: https://github.com/swagger-api/swagger-codegen.git
13 | */
14 |
--------------------------------------------------------------------------------
/src/main/resources/handlebars/htmlDocs/formParam.mustache:
--------------------------------------------------------------------------------
1 | {{#is this 'form-param'}}{{baseName}} {{^required}}(optional){{/required}}{{#required}}(required){{/required}}
2 |
3 | Form Parameter — {{unescapedDescription}} {{#defaultValue}}default: {{{defaultValue}}} {{/defaultValue}}{{#dataFormat}}format: {{{dataFormat}}}{{/dataFormat}}
{{/is}}
--------------------------------------------------------------------------------
/src/main/resources/handlebars/htmlDocs/pathParam.mustache:
--------------------------------------------------------------------------------
1 | {{#is this 'path-param'}}{{baseName}} {{^required}}(optional){{/required}}{{#required}}(required){{/required}}
2 |
3 | Path Parameter — {{unescapedDescription}} {{#defaultValue}}default: {{{defaultValue}}} {{/defaultValue}}{{#dataFormat}}format: {{{dataFormat}}}{{/dataFormat}}
{{/is}}
--------------------------------------------------------------------------------
/src/main/resources/handlebars/ruby/api_info.mustache:
--------------------------------------------------------------------------------
1 | {{#appName}}
2 | #{{{appName}}}
3 |
4 | {{/appName}}
5 | {{#appDescription}}
6 | #{{{appDescription}}}
7 |
8 | {{/appDescription}}
9 | {{#version}}OpenAPI spec version: {{version}}{{/version}}
10 | {{#infoEmail}}Contact: {{{infoEmail}}}{{/infoEmail}}
11 | Generated by: https://github.com/swagger-api/swagger-codegen.git
12 | Swagger Codegen version: {{{generatorVersion}}}
13 |
--------------------------------------------------------------------------------
/src/main/java/io/swagger/codegen/v3/generators/handlebars/HasNotHelper.java:
--------------------------------------------------------------------------------
1 | package io.swagger.codegen.v3.generators.handlebars;
2 |
3 | import io.swagger.codegen.v3.VendorExtendable;
4 |
5 | public class HasNotHelper extends NoneExtensionHelper {
6 |
7 | public static final String NAME = "hasNot";
8 |
9 | @Override
10 | public String getPreffix() {
11 | return VendorExtendable.PREFIX_HAS;
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/src/main/resources/handlebars/csharp-471/interface.mustache:
--------------------------------------------------------------------------------
1 | ///
2 | /// {{#description}}{{.}}{{/description}}{{^description}}{{classname}}{{/description}}
3 | ///
4 | public interface {{{classname}}}
5 | {
6 |
7 | {{#vendorExtensions}}
8 | {{#x-discriminator-type-getter}}
9 | {{x-discriminator-type}} {{x-discriminator-type-getter}}();
10 | {{/x-discriminator-type-getter}}
11 | {{/vendorExtensions}}
12 | }
13 |
--------------------------------------------------------------------------------
/src/main/resources/handlebars/csharp/interface.mustache:
--------------------------------------------------------------------------------
1 | ///
2 | /// {{#description}}{{.}}{{/description}}{{^description}}{{classname}}{{/description}}
3 | ///
4 | public interface {{{classname}}}
5 | {
6 |
7 | {{#vendorExtensions}}
8 | {{#x-discriminator-type-getter}}
9 | {{x-discriminator-type}} {{x-discriminator-type-getter}}();
10 | {{/x-discriminator-type-getter}}
11 | {{/vendorExtensions}}
12 | }
13 |
--------------------------------------------------------------------------------
/src/main/resources/handlebars/htmlDocs/headerParam.mustache:
--------------------------------------------------------------------------------
1 | {{#is this 'header-param'}}{{baseName}} {{^required}}(optional){{/required}}{{#required}}(required){{/required}}
2 |
3 | Header Parameter — {{unescapedDescription}} {{#defaultValue}}default: {{{defaultValue}}} {{/defaultValue}}{{#dataFormat}}format: {{{dataFormat}}}{{/dataFormat}}
{{/is}}
--------------------------------------------------------------------------------
/src/main/resources/handlebars/htmlDocs/queryParam.mustache:
--------------------------------------------------------------------------------
1 | {{#is this 'query-param'}}{{baseName}} {{^required}}(optional){{/required}}{{#required}}(required){{/required}}
2 |
3 | Query Parameter — {{unescapedDescription}} {{#defaultValue}}default: {{{defaultValue}}} {{/defaultValue}}{{#dataFormat}}format: {{{dataFormat}}}{{/dataFormat}}
{{/is}}
--------------------------------------------------------------------------------
/src/main/resources/handlebars/kotlin-server/licenseInfo.mustache:
--------------------------------------------------------------------------------
1 | /**
2 | * {{{appName}}}
3 | * {{{appDescription}}}
4 | *
5 | * {{#version}}OpenAPI spec version: {{{version}}}{{/version}}
6 | * {{#infoEmail}}Contact: {{{infoEmail}}}{{/infoEmail}}
7 | *
8 | * NOTE: This class is auto generated by the swagger code generator program.
9 | * https://github.com/swagger-api/swagger-codegen.git
10 | * Do not edit the class manually.
11 | */
--------------------------------------------------------------------------------
/src/test/java/io/swagger/codegen/v3/generators/options/JavaInflectorServerOptionsProvider.java:
--------------------------------------------------------------------------------
1 | package io.swagger.codegen.v3.generators.options;
2 |
3 | public class JavaInflectorServerOptionsProvider extends JavaOptionsProvider {
4 | @Override
5 | public String getLanguage() {
6 | return "inflector";
7 | }
8 |
9 | @Override
10 | public boolean isServer() {
11 | return true;
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/.github/workflows/dependency-review.yml:
--------------------------------------------------------------------------------
1 | name: 'Dependency Review'
2 | on: [pull_request]
3 |
4 | permissions:
5 | contents: read
6 |
7 | jobs:
8 | dependency-review:
9 | runs-on: ubuntu-latest
10 | steps:
11 | - name: 'Checkout Repository'
12 | uses: actions/checkout@v4
13 | - name: Dependency Review
14 | uses: actions/dependency-review-action@v3
15 | with:
16 | fail-on-severity: high
17 |
--------------------------------------------------------------------------------
/src/main/java/io/swagger/codegen/v3/generators/handlebars/IsNotHelper.java:
--------------------------------------------------------------------------------
1 | package io.swagger.codegen.v3.generators.handlebars;
2 |
3 | import io.swagger.codegen.v3.VendorExtendable;
4 |
5 | public class IsNotHelper extends NoneExtensionHelper {
6 |
7 | public static final String NAME = "isNot";
8 |
9 |
10 | @Override
11 | public String getPreffix() {
12 | return VendorExtendable.PREFIX_IS;
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/src/main/resources/handlebars/Java/gitignore.mustache:
--------------------------------------------------------------------------------
1 | *.class
2 |
3 | # Mobile Tools for Java (J2ME)
4 | .mtj.tmp/
5 |
6 | # Package Files #
7 | *.jar
8 | *.war
9 | *.ear
10 |
11 | # exclude jar for gradle wrapper
12 | !gradle/wrapper/*.jar
13 |
14 | # virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
15 | hs_err_pid*
16 |
17 | # build files
18 | **/target
19 | target
20 | .gradle
21 | build
22 |
--------------------------------------------------------------------------------
/src/main/resources/handlebars/Java/licenseInfo.mustache:
--------------------------------------------------------------------------------
1 | /*
2 | * {{{appName}}}
3 | * {{{appDescription}}}
4 | *
5 | * {{#version}}OpenAPI spec version: {{{version}}}{{/version}}
6 | * {{#infoEmail}}Contact: {{{infoEmail}}}{{/infoEmail}}
7 | *
8 | * NOTE: This class is auto generated by the swagger code generator program.
9 | * https://github.com/swagger-api/swagger-codegen.git
10 | * Do not edit the class manually.
11 | */
12 |
--------------------------------------------------------------------------------
/src/main/resources/handlebars/JavaJaxRS/spec/RestApplication.mustache:
--------------------------------------------------------------------------------
1 | package {{invokerPackage}};
2 |
3 | {{#jakarta}}
4 | import jakarta.ws.rs.ApplicationPath;
5 | import jakarta.ws.rs.core.Application;
6 | {{/jakarta}}
7 | {{^jakarta}}
8 | import javax.ws.rs.ApplicationPath;
9 | import javax.ws.rs.core.Application;
10 | {{/jakarta}}
11 |
12 | @ApplicationPath("/")
13 | public class RestApplication extends Application {
14 |
15 | }
16 |
--------------------------------------------------------------------------------
/src/main/resources/handlebars/python/partial_header.mustache:
--------------------------------------------------------------------------------
1 | """
2 | {{#appName}}
3 | {{{appName}}}
4 | {{/appName}}
5 |
6 | {{#appDescription}}
7 | {{{appDescription}}} # noqa: E501
8 | {{/appDescription}}
9 |
10 | {{#version}}OpenAPI spec version: {{{version}}}{{/version}}
11 | {{#infoEmail}}Contact: {{{infoEmail}}}{{/infoEmail}}
12 | Generated by: https://github.com/swagger-api/swagger-codegen.git
13 | """
14 |
--------------------------------------------------------------------------------
/src/main/resources/handlebars/JavaJaxRS/licenseInfo.mustache:
--------------------------------------------------------------------------------
1 | /*
2 | * {{{appName}}}
3 | * {{{appDescription}}}
4 | *
5 | * {{#version}}OpenAPI spec version: {{{version}}}{{/version}}
6 | * {{#infoEmail}}Contact: {{{infoEmail}}}{{/infoEmail}}
7 | *
8 | * NOTE: This class is auto generated by the swagger code generator program.
9 | * https://github.com/swagger-api/swagger-codegen.git
10 | * Do not edit the class manually.
11 | */
12 |
--------------------------------------------------------------------------------
/src/main/resources/handlebars/JavaJaxRS/resteasy/RestApplication.mustache:
--------------------------------------------------------------------------------
1 | package {{invokerPackage}};
2 |
3 | {{#jakarta}}
4 | import jakarta.ws.rs.ApplicationPath;
5 | import jakarta.ws.rs.core.Application;
6 | {{/jakarta}}
7 | {{^jakarta}}
8 | import javax.ws.rs.ApplicationPath;
9 | import javax.ws.rs.core.Application;
10 | {{/jakarta}}
11 |
12 | @ApplicationPath("/")
13 | public class RestApplication extends Application {
14 |
15 | }
16 |
--------------------------------------------------------------------------------
/src/main/resources/handlebars/JavaJaxRS/spec/pathParams.mustache:
--------------------------------------------------------------------------------
1 | {{#is this 'path-param'}}{{#useBeanValidation}}{{>beanValidationPathParams}}{{/useBeanValidation}} @PathParam("{{baseName}}")
2 | {{#useOas2}}{{#description}} @ApiParam("{{description}}"){{/description}} {{{dataType}}} {{paramName}}{{/useOas2}}
3 | {{^useOas2}}{{#description}} @Parameter(description = "{{description}}"){{/description}} {{{dataType}}} {{paramName}}{{/useOas2}}
4 | {{/is}}
--------------------------------------------------------------------------------
/src/main/resources/handlebars/kotlin-server/libraries/ktor/_response.mustache:
--------------------------------------------------------------------------------
1 | val exampleContentType = "{{{contentType}}}"
2 | val exampleContentString = """{{&example}}"""
3 |
4 | when(exampleContentType) {
5 | "application/json" -> call.respond(gson.fromJson(exampleContentString, empty::class.java))
6 | "application/xml" -> call.respondText(exampleContentString, ContentType.Text.Xml)
7 | else -> call.respondText(exampleContentString)
8 | }
--------------------------------------------------------------------------------
/src/main/resources/handlebars/aspnetcore/wwwroot/web.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/src/main/resources/handlebars/kotlin-client/licenseInfo.mustache:
--------------------------------------------------------------------------------
1 | /**
2 | * {{{appName}}}
3 | * {{{appDescription}}}
4 | *
5 | * {{#version}}OpenAPI spec version: {{{version}}}{{/version}}
6 | * {{#infoEmail}}Contact: {{{infoEmail}}}{{/infoEmail}}
7 | *
8 | * NOTE: This class is auto generated by the swagger code generator program.
9 | * https://github.com/swagger-api/swagger-codegen.git
10 | * Do not edit the class manually.
11 | */
12 |
--------------------------------------------------------------------------------
/src/main/resources/handlebars/kotlin-server/libraries/ktor/licenseInfo.mustache:
--------------------------------------------------------------------------------
1 | /**
2 | * {{{appName}}}
3 | * {{{appDescription}}}
4 | *
5 | * {{#version}}OpenAPI spec version: {{{version}}}{{/version}}
6 | * {{#infoEmail}}Contact: {{{infoEmail}}}{{/infoEmail}}
7 | *
8 | * NOTE: This class is auto generated by the swagger code generator program.
9 | * https://github.com/swagger-api/swagger-codegen.git
10 | * Do not edit the class manually.
11 | */
--------------------------------------------------------------------------------
/src/main/resources/handlebars/scala/client/licenseInfo.mustache:
--------------------------------------------------------------------------------
1 | /**
2 | * {{{appName}}}
3 | * {{{appDescription}}}
4 | *
5 | * {{#version}}OpenAPI spec version: {{{version}}}{{/version}}
6 | * {{#infoEmail}}Contact: {{{infoEmail}}}{{/infoEmail}}
7 | *
8 | * NOTE: This class is auto generated by the swagger code generator program.
9 | * https://github.com/swagger-api/swagger-codegen.git
10 | * Do not edit the class manually.
11 | */
12 |
--------------------------------------------------------------------------------
/src/main/resources/handlebars/swift5/_param.mustache:
--------------------------------------------------------------------------------
1 | "{{baseName}}": {{paramName}}{{^isEnum}}{{#isInteger}}{{^required}}?{{/required}}.encodeToJSON(){{/isInteger}}{{#isLong}}{{^required}}?{{/required}}.encodeToJSON(){{/isLong}}{{/isEnum}}{{#isEnum}}{{^isContainer}}{{^required}}?{{/required}}.rawValue{{/isContainer}}{{/isEnum}}{{#isDate}}{{^required}}?{{/required}}.encodeToJSON(){{/isDate}}{{#isDateTime}}{{^required}}?{{/required}}.encodeToJSON(){{/isDateTime}}
--------------------------------------------------------------------------------
/src/main/resources/handlebars/typescript-angular/licenseInfo.mustache:
--------------------------------------------------------------------------------
1 | /**
2 | * {{{appName}}}
3 | * {{{appDescription}}}
4 | *
5 | * {{#version}}OpenAPI spec version: {{{version}}}{{/version}}
6 | * {{#infoEmail}}Contact: {{{infoEmail}}}{{/infoEmail}}
7 | *
8 | * NOTE: This class is auto generated by the swagger code generator program.
9 | * https://github.com/swagger-api/swagger-codegen.git
10 | * Do not edit the class manually.
11 | */
--------------------------------------------------------------------------------
/src/main/resources/handlebars/typescript-angular/rxjs-operators.mustache:
--------------------------------------------------------------------------------
1 | // RxJS imports according to https://angular.io/docs/ts/latest/guide/server-communication.html#!#rxjs
2 |
3 | // See node_module/rxjs/Rxjs.js
4 | // Import just the rxjs statics and operators we need for THIS app.
5 |
6 | // Statics
7 | import 'rxjs/add/observable/throw';
8 |
9 | // Operators
10 | import 'rxjs/add/operator/catch';
11 | import 'rxjs/add/operator/map';
12 |
--------------------------------------------------------------------------------
/src/main/resources/handlebars/typescript-axios/licenseInfo.mustache:
--------------------------------------------------------------------------------
1 | /**
2 | * {{{appName}}}
3 | * {{{appDescription}}}
4 | *
5 | * {{#version}}OpenAPI spec version: {{{version}}}{{/version}}
6 | * {{#infoEmail}}Contact: {{{infoEmail}}}{{/infoEmail}}
7 | *
8 | * NOTE: This class is auto generated by the swagger code generator program.
9 | * https://github.com/swagger-api/swagger-codegen.git
10 | * Do not edit the class manually.
11 | */
12 |
--------------------------------------------------------------------------------
/src/main/resources/handlebars/typescript-fetch/licenseInfo.mustache:
--------------------------------------------------------------------------------
1 | /**
2 | * {{{appName}}}
3 | * {{{appDescription}}}
4 | *
5 | * {{#version}}OpenAPI spec version: {{{version}}}{{/version}}
6 | * {{#infoEmail}}Contact: {{{infoEmail}}}{{/infoEmail}}
7 | *
8 | * NOTE: This file is auto generated by the swagger code generator program.
9 | * https://github.com/swagger-api/swagger-codegen.git
10 | * Do not edit the file manually.
11 | */
12 |
--------------------------------------------------------------------------------
/src/main/resources/mustache/typescript-fetch/licenseInfo.mustache:
--------------------------------------------------------------------------------
1 | /**
2 | * {{{appName}}}
3 | * {{{appDescription}}}
4 | *
5 | * {{#version}}OpenAPI spec version: {{{version}}}{{/version}}
6 | * {{#infoEmail}}Contact: {{{infoEmail}}}{{/infoEmail}}
7 | *
8 | * NOTE: This file is auto generated by the swagger code generator program.
9 | * https://github.com/swagger-api/swagger-codegen.git
10 | * Do not edit the file manually.
11 | */
12 |
--------------------------------------------------------------------------------
/src/main/resources/handlebars/javascript/licenseInfo.mustache:
--------------------------------------------------------------------------------
1 | /**
2 | * {{{appName}}}
3 | * {{{appDescription}}}
4 | *
5 | * {{#version}}OpenAPI spec version: {{{version}}}{{/version}}
6 | * {{#infoEmail}}Contact: {{{infoEmail}}}{{/infoEmail}}
7 | *
8 | * NOTE: This class is auto generated by the swagger code generator program.
9 | * https://github.com/swagger-api/swagger-codegen.git
10 | * Do not edit the class manually.
11 | *
12 | */
13 |
--------------------------------------------------------------------------------
/src/main/resources/handlebars/python/travis.mustache:
--------------------------------------------------------------------------------
1 | # ref: https://docs.travis-ci.com/user/languages/python
2 | language: python
3 | python:
4 | - "3.2"
5 | - "3.3"
6 | - "3.4"
7 | - "3.5"
8 | #- "3.5-dev" # 3.5 development branch
9 | #- "nightly" # points to the latest development branch e.g. 3.6-dev
10 | # command to install dependencies
11 | install: "pip install -r requirements.txt"
12 | # command to run tests
13 | script: nosetests
14 |
--------------------------------------------------------------------------------
/src/main/resources/handlebars/swift4/modelInlineEnumDeclaration.mustache:
--------------------------------------------------------------------------------
1 | public enum {{enumName}}: {{#isNot this 'container'}}{{datatype}}{{/isNot}}{{#is this 'container'}}String{{/is}}, Codable { {{#allowableValues}}{{#enumVars}}
2 | case {{name}} = {{#is ../../this 'container'}}"{{/is}}{{#is ../../this 'string'}}"{{/is}}{{{value}}}{{#is ../../this 'string'}}"{{/is}}{{#is ../../this 'container'}}"{{/is}}{{/enumVars}}{{/allowableValues}}
3 | }
4 |
--------------------------------------------------------------------------------
/src/main/resources/handlebars/go/partial_header.mustache:
--------------------------------------------------------------------------------
1 | /*
2 | {{#appName}}
3 | * {{{appName}}}
4 | *
5 | {{/appName}}
6 | {{#appDescription}}
7 | * {{{appDescription}}}
8 | *
9 | {{/appDescription}}
10 | {{#version}}
11 | * API version: {{{version}}}
12 | {{/version}}
13 | {{#infoEmail}}
14 | * Contact: {{{infoEmail}}}
15 | {{/infoEmail}}
16 | * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
17 | */
18 |
--------------------------------------------------------------------------------
/src/main/java/io/swagger/codegen/v3/generators/features/BeanValidationExtendedFeatures.java:
--------------------------------------------------------------------------------
1 | package io.swagger.codegen.v3.generators.features;
2 |
3 | public interface BeanValidationExtendedFeatures {
4 |
5 | // Language (implementing Client/Server) supports automatic BeanValidation (1.1)
6 | String USE_BEANVALIDATION_FEATURE = "useBeanValidationFeature";
7 |
8 | void setUseBeanValidationFeature(boolean useBeanValidationFeature);
9 |
10 | }
11 |
--------------------------------------------------------------------------------
/src/main/resources/handlebars/JavaSpring/libraries/spring-cloud/application-test.mustache:
--------------------------------------------------------------------------------
1 | spring:
2 | application:
3 | name: {{artifactId}}-test
4 | jackson:
5 | serialization.WRITE_DATES_AS_TIMESTAMPS: false
6 |
7 | hystrix.command.default.execution.timeout.enabled: false
8 |
9 | logging.level.{{apiPackage}}: DEBUG
10 |
11 | feign.hystrix.enabled: true
12 |
13 | {{#wiremock}}
14 | wiremock.base.path: http://localhost:33333
15 | {{/wiremock}}
16 |
--------------------------------------------------------------------------------
/src/main/resources/handlebars/go-server/partial_header.mustache:
--------------------------------------------------------------------------------
1 | /*
2 | {{#appName}}
3 | * {{{appName}}}
4 | *
5 | {{/appName}}
6 | {{#appDescription}}
7 | * {{{appDescription}}}
8 | *
9 | {{/appDescription}}
10 | {{#version}}
11 | * API version: {{{version}}}
12 | {{/version}}
13 | {{#infoEmail}}
14 | * Contact: {{{infoEmail}}}
15 | {{/infoEmail}}
16 | * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
17 | */
18 |
--------------------------------------------------------------------------------
/src/main/resources/handlebars/Java/libraries/retrofit/formParams.mustache:
--------------------------------------------------------------------------------
1 | {{~#is this 'form-param'}}{{#isNot this 'binary'}}{{#is ../this 'multipart'}}@retrofit.http.Part{{/is}}{{#isNot ../this 'multipart'}}@retrofit.http.Field{{/isNot}}("{{baseName}}") {{{dataType}}} {{paramName}}{{/isNot}}{{#is this 'binary'}}{{#is ../this 'multipart'}}@retrofit.http.Part{{/is}}{{#isNot ../this 'multipart'}}@retrofit.http.Field{{/isNot}}("{{baseName}}") TypedFile {{paramName}}{{/is}}{{/is}}
--------------------------------------------------------------------------------
/src/main/java/io/swagger/codegen/v3/generators/features/NotNullAnnotationFeatures.java:
--------------------------------------------------------------------------------
1 | package io.swagger.codegen.v3.generators.features;
2 |
3 | public interface NotNullAnnotationFeatures {
4 |
5 | // Language supports generating not Null Jackson Annotation
6 | String NOT_NULL_JACKSON_ANNOTATION = "notNullJacksonAnnotation";
7 |
8 | void setNotNullJacksonAnnotation(boolean notNullJacksonAnnotation);
9 |
10 | boolean isNotNullJacksonAnnotation();
11 | }
--------------------------------------------------------------------------------
/src/main/resources/handlebars/Java/travis.mustache:
--------------------------------------------------------------------------------
1 | #
2 | # Generated by: https://github.com/swagger-api/swagger-codegen.git
3 | #
4 | language: java
5 | jdk:
6 | - oraclejdk8
7 | - oraclejdk7
8 | before_install:
9 | # ensure gradlew has proper permission
10 | - chmod a+x ./gradlew
11 | script:
12 | # test using maven
13 | - mvn test
14 | # uncomment below to test using gradle
15 | # - gradle test
16 | # uncomment below to test using sbt
17 | # - sbt test
18 |
--------------------------------------------------------------------------------
/src/main/resources/handlebars/Java/xmlAnnotation.mustache:
--------------------------------------------------------------------------------
1 | {{#withXml}}
2 | @XmlRootElement({{#xmlNamespace}}namespace="{{xmlNamespace}}", {{/xmlNamespace}}name = "{{#xmlName}}{{xmlName}}{{/xmlName}}{{^xmlName}}{{classname}}{{/xmlName}}")
3 | @XmlAccessorType(XmlAccessType.FIELD)
4 | {{#jackson}}@JacksonXmlRootElement({{#xmlNamespace}}namespace="{{xmlNamespace}}", {{/xmlNamespace}}localName = "{{#xmlName}}{{xmlName}}{{/xmlName}}{{^xmlName}}{{classname}}{{/xmlName}}"){{/jackson}}{{/withXml}}
--------------------------------------------------------------------------------
/src/main/resources/handlebars/aspnetcore/README.mustache:
--------------------------------------------------------------------------------
1 | # {{packageName}} - ASP.NET Core 2.0 Server
2 |
3 | {{#appDescription}}
4 | {{{appDescription}}}
5 | {{/appDescription}}
6 |
7 | ## Run
8 |
9 | Linux/OS X:
10 |
11 | ```
12 | sh build.sh
13 | ```
14 |
15 | Windows:
16 |
17 | ```
18 | build.bat
19 | ```
20 |
21 | ## Run in Docker
22 |
23 | ```
24 | cd src/{{packageName}}
25 | docker build -t {{dockerTag}} .
26 | docker run -p 5000:5000 {{dockerTag}}
27 | ```
28 |
--------------------------------------------------------------------------------
/src/main/resources/handlebars/kotlin-server/libraries/ktor/_principal.mustache:
--------------------------------------------------------------------------------
1 | {{#authMethods}}
2 | {{#@first}}
3 | {{#or isBasic isBearer}}
4 | val principal = call.authentication.principal()
5 | {{/or}}
6 | {{#isApiKey}}
7 | val principal = call.authentication.principal()
8 | {{/isApiKey}}
9 | {{#isOAuth}}
10 | val principal = call.authentication.principal()
11 | {{/isOAuth}}
12 | {{/@first}}
13 | {{/authMethods}}
14 |
--------------------------------------------------------------------------------
/src/main/resources/handlebars/php/partial_header.mustache:
--------------------------------------------------------------------------------
1 | /**
2 | {{#appName}}
3 | * {{{appName}}}
4 | *
5 | {{/appName}}
6 | {{#appDescription}}
7 | * {{{appDescription}}}
8 | *
9 | {{/appDescription}}
10 | * {{#version}}OpenAPI spec version: {{{version}}}{{/version}}
11 | * {{#infoEmail}}Contact: {{{infoEmail}}}{{/infoEmail}}
12 | * Generated by: https://github.com/swagger-api/swagger-codegen.git
13 | * Swagger Codegen version: {{{generatorVersion}}}
14 | */
15 |
--------------------------------------------------------------------------------
/src/main/resources/handlebars/swift3/_param.mustache:
--------------------------------------------------------------------------------
1 | "{{baseName}}": {{paramName}}{{#isNot this 'enum'}}{{#is this 'integer'}}{{^required}}?{{/required}}.encodeToJSON(){{/is}}{{#is this 'long'}}{{^required}}?{{/required}}.encodeToJSON(){{/is}}{{/isNot}}{{#is this 'enum'}}{{#isNot this 'container'}}{{^required}}?{{/required}}.rawValue{{/isNot}}{{/is}}{{#is this 'date'}}{{^required}}?{{/required}}.encodeToJSON(){{/is}}{{#is this 'date-time'}}{{^required}}?{{/required}}.encodeToJSON(){{/is}}
--------------------------------------------------------------------------------
/src/main/resources/handlebars/swift4/_param.mustache:
--------------------------------------------------------------------------------
1 | "{{baseName}}": {{paramName}}{{#isNot this 'enum'}}{{#is this 'integer'}}{{^required}}?{{/required}}.encodeToJSON(){{/is}}{{#is this 'long'}}{{^required}}?{{/required}}.encodeToJSON(){{/is}}{{/isNot}}{{#is this 'enum'}}{{#isNot this 'container'}}{{^required}}?{{/required}}.rawValue{{/isNot}}{{/is}}{{#is this 'date'}}{{^required}}?{{/required}}.encodeToJSON(){{/is}}{{#is this 'date-time'}}{{^required}}?{{/required}}.encodeToJSON(){{/is}}
--------------------------------------------------------------------------------
/src/main/resources/handlebars/typescript-angular/apis.mustache:
--------------------------------------------------------------------------------
1 | {{#apiInfo}}
2 | {{#apis}}
3 | {{#operations}}
4 | export * from './{{ classFilename }}';
5 | import { {{ classname }} } from './{{ classFilename }}';
6 | {{/operations}}
7 | {{#withInterfaces}}
8 | export * from './{{ classFilename }}Interface'
9 | {{/withInterfaces}}
10 | {{/apis}}
11 | export const APIS = [{{#apis}}{{#operations}}{{ classname }}{{/operations}}{{^@last}}, {{/@last}}{{/apis}}];
12 | {{/apiInfo}}
13 |
--------------------------------------------------------------------------------
/src/main/resources/handlebars/JavaJaxRS/cxf-cdi/formParams.mustache:
--------------------------------------------------------------------------------
1 | {{#is this 'form-param'}}{{#isNot this 'binary'}}@Multipart(value = "{{baseName}}"{{^required}}, required = false{{/required}}) {{{dataType}}} {{paramName}}{{/isNot}}{{#is this 'binary'}} @Multipart(value = "{{baseName}}"{{^required}}, required = false{{/required}}) InputStream {{paramName}}InputStream, @Multipart(value = "{{baseName}}" {{^required}}, required = false{{/required}}) Attachment {{paramName}}Detail{{/is}}{{/is}}
--------------------------------------------------------------------------------
/src/main/resources/handlebars/JavaMicronaut/beanValidation.mustache:
--------------------------------------------------------------------------------
1 | {{#required}}{{^useNullableForNotNull}}
2 | @NotNull
3 | {{/useNullableForNotNull}}{{/required}}
4 | {{#useNullableForNotNull}}{{^nullable}}
5 | @NotNull
6 | {{/nullable}}{{/useNullableForNotNull}}{{#isContainer}}{{^isPrimitiveType}}{{^isEnum}}
7 | @Valid{{/isEnum}}{{/isPrimitiveType}}{{/isContainer}}{{#isNotContainer}}{{^isPrimitiveType}}
8 | @Valid{{/isPrimitiveType}}{{/isNotContainer}}
9 | {{>beanValidationCore}}
--------------------------------------------------------------------------------
/src/main/resources/logback.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | %d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # Compiled class file
2 | *.class
3 |
4 | # Log file
5 | *.log
6 |
7 | # Temporary files
8 | *.tmp
9 | tmp/
10 |
11 | # BlueJ files
12 | *.ctxt
13 |
14 | # Visual Studio Code
15 | .project
16 | .vscode
17 |
18 | # Mobile Tools for Java (J2ME)
19 | .mtj.tmp/
20 |
21 | # virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
22 | hs_err_pid*
23 |
24 | .idea
25 | *.iml
26 | target/
27 | test-output/
28 |
29 | .classpath
30 | .settings/
31 |
--------------------------------------------------------------------------------
/src/main/resources/arguments/aspnetcore.yaml:
--------------------------------------------------------------------------------
1 | arguments:
2 | - option: "--aspnet-core-version"
3 | description: "aspnetcore version to use, current options are: 2.0, 2.1, 2.2 and 3.0 (default)"
4 | type: "string"
5 | - option: "--interface-only"
6 | description: "creates interfaces controller only"
7 | type: "boolean"
8 | - option: "--interface-controller"
9 | description: "creates interfaces and default implementation for controllers"
10 | type: "boolean"
11 |
--------------------------------------------------------------------------------
/src/main/resources/handlebars/JavaJaxRS/cxf-cdi/RestApplication.mustache:
--------------------------------------------------------------------------------
1 | package {{invokerPackage}};
2 |
3 | {{#jakarta}}
4 | import jakarta.ws.rs.ApplicationPath;
5 | import jakarta.ws.rs.core.Application;
6 | {{/jakarta}}
7 | {{^jakarta}}
8 | import javax.ws.rs.ApplicationPath;
9 | import javax.ws.rs.core.Application;
10 | {{/jakarta}}
11 |
12 | @ApplicationPath("/")
13 | public class RestApplication extends Application {
14 | // Add implementation-specific details here
15 | }
16 |
--------------------------------------------------------------------------------
/src/main/resources/handlebars/kotlin-client/enum_class.mustache:
--------------------------------------------------------------------------------
1 | /**
2 | * {{{description}}}
3 | * Values: {{#allowableValues}}{{#enumVars}}{{&name}}{{^@last}},{{/@last}}{{/enumVars}}{{/allowableValues}}
4 | */
5 | enum class {{classname}}(val value: {{dataType}}{{#isNullable}}?{{/isNullable}}){
6 | {{#allowableValues}}{{#enumVars}}
7 | {{&name}}({{#value}}{{{value}}}{{/value}}{{^value}}null{{/value}}){{^@last}},{{/@last}}{{#@last}};{{/@last}}// :/
8 | {{/enumVars}}{{/allowableValues}}
9 | }
--------------------------------------------------------------------------------
/src/main/resources/handlebars/JavaJaxRS/apiServiceFactory.mustache:
--------------------------------------------------------------------------------
1 | package {{package}}.factories;
2 |
3 | import {{package}}.{{classname}}Service;
4 | import {{package}}.impl.{{classname}}ServiceImpl;
5 |
6 | {{>generatedAnnotation}}
7 | public class {{classname}}ServiceFactory {
8 | private final static {{classname}}Service service = new {{classname}}ServiceImpl();
9 |
10 | public static {{classname}}Service get{{classname}}() {
11 | return service;
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/src/main/resources/handlebars/JavaSpring/beanValidation.mustache:
--------------------------------------------------------------------------------
1 | {{#required}}{{^useNullableForNotNull}}
2 | @NotNull
3 | {{/useNullableForNotNull}}{{/required}}
4 | {{#useNullableForNotNull}}{{^nullable}}
5 | @NotNull
6 | {{/nullable}}{{/useNullableForNotNull}}{{#isContainer}}{{^isPrimitiveType}}{{^isEnum}}
7 | @Valid{{/isEnum}}{{/isPrimitiveType}}{{/isContainer}}{{#isNotContainer}}{{^isPrimitiveType}}
8 | @Valid{{/isPrimitiveType}}{{/isNotContainer}}
9 | {{>beanValidationCore}}
10 |
--------------------------------------------------------------------------------
/src/main/resources/handlebars/JavaMicronaut/xmlAnnotation.mustache:
--------------------------------------------------------------------------------
1 | {{#withXml}}
2 | {{#jackson}}
3 | @JacksonXmlRootElement({{#xmlNamespace}}namespace="{{xmlNamespace}}", {{/xmlNamespace}}localName = "{{#xmlName}}{{xmlName}}{{/xmlName}}{{^xmlName}}{{classname}}{{/xmlName}}")
4 | {{/jackson}}
5 | @XmlRootElement({{#xmlNamespace}}namespace="{{xmlNamespace}}", {{/xmlNamespace}}name = "{{#xmlName}}{{xmlName}}{{/xmlName}}{{^xmlName}}{{classname}}{{/xmlName}}")
6 | @XmlAccessorType(XmlAccessType.FIELD){{/withXml}}
--------------------------------------------------------------------------------
/src/main/resources/handlebars/JavaSpring/xmlAnnotation.mustache:
--------------------------------------------------------------------------------
1 | {{#withXml}}
2 | {{#jackson}}
3 | @JacksonXmlRootElement({{#xmlNamespace}}namespace="{{xmlNamespace}}", {{/xmlNamespace}}localName = "{{#xmlName}}{{xmlName}}{{/xmlName}}{{^xmlName}}{{classname}}{{/xmlName}}")
4 | {{/jackson}}
5 | @XmlRootElement({{#xmlNamespace}}namespace="{{xmlNamespace}}", {{/xmlNamespace}}name = "{{#xmlName}}{{xmlName}}{{/xmlName}}{{^xmlName}}{{classname}}{{/xmlName}}")
6 | @XmlAccessorType(XmlAccessType.FIELD){{/withXml}}
--------------------------------------------------------------------------------
/src/main/resources/handlebars/JavaVertXServer/beanValidation.mustache:
--------------------------------------------------------------------------------
1 | {{#required}}{{^useNullableForNotNull}}
2 | @NotNull
3 | {{/useNullableForNotNull}}{{/required}}
4 | {{#useNullableForNotNull}}{{^nullable}}
5 | @NotNull
6 | {{/nullable}}{{/useNullableForNotNull}}{{#isContainer}}{{^isPrimitiveType}}{{^isEnum}}
7 | @Valid{{/isEnum}}{{/isPrimitiveType}}{{/isContainer}}{{#isNotContainer}}{{^isPrimitiveType}}
8 | @Valid{{/isPrimitiveType}}{{/isNotContainer}}
9 | {{>beanValidationCore}}
10 |
--------------------------------------------------------------------------------
/src/main/resources/handlebars/kotlin-server/model.mustache:
--------------------------------------------------------------------------------
1 | {{>licenseInfo}}
2 | package {{modelPackage}}
3 |
4 | {{#imports}}import {{import}}
5 | {{/imports}}
6 | {{#threetenbp}}
7 | import org.threeten.bp.LocalDateTime
8 | {{/threetenbp}}
9 |
10 | {{#models}}
11 | {{#model}}
12 | {{#is this 'alias'}}typealias {{classname}} = {{{dataType}}}{{/is}}{{#isNot this 'alias'}}{{#is this 'enum'}}{{>enum_class}}{{/is}}{{#isNot this 'enum'}}{{>data_class}}{{/isNot}}{{/isNot}}
13 | {{/model}}
14 | {{/models}}
15 |
--------------------------------------------------------------------------------
/src/main/resources/handlebars/dart/auth/http_basic_auth.mustache:
--------------------------------------------------------------------------------
1 | part of {{pubName}}.api;
2 |
3 | class HttpBasicAuth implements Authentication {
4 |
5 | String username;
6 | String password;
7 |
8 | @override
9 | void applyToParams(List queryParams, Map headerParams) {
10 | String str = (username == null ? "" : username) + ":" + (password == null ? "" : password);
11 | headerParams["Authorization"] = "Basic " + base64.encode(utf8.encode(str));
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/src/main/resources/handlebars/JavaJaxRS/spec/headerParams.mustache:
--------------------------------------------------------------------------------
1 | {{#is this 'header-param'}}{{#useBeanValidation}}{{>beanValidationQueryParams}}{{/useBeanValidation}} @HeaderParam("{{baseName}}"){{#defaultValue}} @DefaultValue("{{{defaultValue}}}"){{/defaultValue}}
2 | {{#useOas2}}{{#description}} @ApiParam("{{description}}"){{/description}} {{{dataType}}} {{paramName}}{{/useOas2}}
3 | {{^useOas2}}{{#description}} @Parameter(description = "{{description}}"){{/description}} {{{dataType}}} {{paramName}}{{/useOas2}}
4 | {{/is}}
--------------------------------------------------------------------------------
/src/main/resources/handlebars/JavaJaxRS/spec/queryParams.mustache:
--------------------------------------------------------------------------------
1 | {{#is this 'query-param'}}{{#useBeanValidation}}{{>beanValidationQueryParams}}{{/useBeanValidation}} @QueryParam("{{baseName}}"){{#defaultValue}} @DefaultValue("{{{defaultValue}}}"){{/defaultValue}}
2 | {{#useOas2}}{{#description}} @ApiParam("{{description}}"){{/description}} {{{dataType}}} {{paramName}}{{/useOas2}}
3 | {{^useOas2}}{{#description}} @Parameter(description = "{{description}}"){{/description}} {{{dataType}}} {{paramName}}{{/useOas2}}
4 | {{/is}}
--------------------------------------------------------------------------------
/src/main/resources/handlebars/typescript-angular/modelGeneric.mustache:
--------------------------------------------------------------------------------
1 | export interface {{classname}} {{#parent}}extends {{{parent}}} {{/parent}}{ {{>modelGenericAdditionalProperties}}
2 | {{#vars}}
3 | {{#description}}
4 | /**
5 | * {{{description}}}
6 | */
7 | {{/description}}
8 | {{#is this 'read-only'}}readonly {{/is}}{{name}}{{^required}}?{{/required}}: {{#is this 'enum'}}{{{datatypeWithEnum}}}{{/is}}{{#isNot this 'enum'}}{{{datatype}}}{{/isNot}};
9 | {{/vars}}
10 | }{{>modelGenericEnums}}
--------------------------------------------------------------------------------
/src/main/resources/handlebars/JavaInflector/inflector.mustache:
--------------------------------------------------------------------------------
1 | controllerPackage: {{invokerPackage}}
2 | {{#hasModel}}modelPackage: {{modelPackage}}{{/hasModel}}
3 | swaggerUrl: ./src/main/resources/openapi3.yaml
4 | modelMappings:
5 | # to enable explicit mappings, use this syntax:
6 | DefinitionFromSwaggerSpecification: fully.qualified.path.to.Model
7 | {{#models}}{{#model}}{{classname}} : {{modelPackage}}.{{classname}}{{/model}}
8 | {{/models}}
9 |
10 | entityProcessors:
11 | - json
12 | - xml
13 | - yaml
--------------------------------------------------------------------------------
/src/main/resources/handlebars/pythonFlaskConnexion/travis.mustache:
--------------------------------------------------------------------------------
1 | # ref: https://docs.travis-ci.com/user/languages/python
2 | language: python
3 | python:
4 | {{#supportPython2}}
5 | - "2.7"
6 | {{/supportPython2}}
7 | - "3.2"
8 | - "3.3"
9 | - "3.4"
10 | - "3.5"
11 | #- "3.5-dev" # 3.5 development branch
12 | #- "nightly" # points to the latest development branch e.g. 3.6-dev
13 | # command to install dependencies
14 | install: "pip install -r requirements.txt"
15 | # command to run tests
16 | script: nosetests
17 |
--------------------------------------------------------------------------------
/src/main/resources/handlebars/swift3/Configuration.mustache:
--------------------------------------------------------------------------------
1 | // Configuration.swift
2 | //
3 | // Generated by swagger-codegen
4 | // https://github.com/swagger-api/swagger-codegen
5 | //
6 |
7 | import Foundation
8 |
9 | open class Configuration {
10 |
11 | // This value is used to configure the date formatter that is used to serialize dates into JSON format.
12 | // You must set it prior to encoding any dates, and it will only be read once.
13 | open static var dateFormat = "yyyy-MM-dd'T'HH:mm:ss.SSSZZZZZ"
14 |
15 | }
16 |
--------------------------------------------------------------------------------
/src/main/resources/handlebars/swift4/Configuration.mustache:
--------------------------------------------------------------------------------
1 | // Configuration.swift
2 | //
3 | // Generated by swagger-codegen
4 | // https://github.com/swagger-api/swagger-codegen
5 | //
6 |
7 | import Foundation
8 |
9 | open class Configuration {
10 |
11 | // This value is used to configure the date formatter that is used to serialize dates into JSON format.
12 | // You must set it prior to encoding any dates, and it will only be read once.
13 | open static var dateFormat = "yyyy-MM-dd'T'HH:mm:ss.SSSZZZZZ"
14 |
15 | }
--------------------------------------------------------------------------------
/src/main/resources/handlebars/swift5/Configuration.mustache:
--------------------------------------------------------------------------------
1 | // Configuration.swift
2 | //
3 | // Generated by swagger-codegen
4 | // https://github.com/swagger-api/swagger-codegen
5 | //
6 |
7 | import Foundation
8 |
9 | open class Configuration {
10 |
11 | // This value is used to configure the date formatter that is used to serialize dates into JSON format.
12 | // You must set it prior to encoding any dates, and it will only be read once.
13 | public static var dateFormat = "yyyy-MM-dd'T'HH:mm:ss.SSSZZZZZ"
14 |
15 | }
--------------------------------------------------------------------------------
/src/main/resources/handlebars/JavaJaxRS/cxf-cdi/beans.mustache:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
12 |
13 |
--------------------------------------------------------------------------------
/src/main/resources/handlebars/kotlin-client/model.mustache:
--------------------------------------------------------------------------------
1 | {{>licenseInfo}}
2 | package {{modelPackage}}
3 |
4 | {{#imports}}import {{import}}
5 | {{/imports}}
6 | {{#threetenbp}}
7 | import org.threeten.bp.LocalDateTime
8 | {{/threetenbp}}
9 |
10 | {{#models}}
11 | {{#model}}
12 | {{#is this 'alias'}}
13 | typealias {{classname}} = {{dataType}}
14 | {{/is}}
15 | {{#isNot this 'alias'}}
16 | {{#is this 'enum'}}{{>enum_class}}{{/is}}
17 | {{#isNot this 'enum'}}{{>data_class}}{{/isNot}}
18 | {{/isNot}}
19 | {{/model}}
20 | {{/models}}
21 |
--------------------------------------------------------------------------------
/src/main/resources/handlebars/typescript-fetch/tsconfig.mustache:
--------------------------------------------------------------------------------
1 | {
2 | "compilerOptions": {
3 | "declaration": true,
4 | "target": "{{#supportsES6}}es6{{/supportsES6}}{{^supportsES6}}es5{{/supportsES6}}",
5 | "module": "commonjs",
6 | "noImplicitAny": true,
7 | "outDir": "dist",
8 | "rootDir": "."{{^supportsES6}},
9 | "lib": [
10 | "es6",
11 | "dom"
12 | ]
13 | {{/supportsES6}}
14 | },
15 | "exclude": [
16 | "dist",
17 | "node_modules",
18 | "**/*.spec.ts"
19 | ]
20 | }
21 |
--------------------------------------------------------------------------------
/src/main/resources/mustache/typescript-fetch/tsconfig.mustache:
--------------------------------------------------------------------------------
1 | {
2 | "compilerOptions": {
3 | "declaration": true,
4 | "target": "{{#supportsES6}}es6{{/supportsES6}}{{^supportsES6}}es5{{/supportsES6}}",
5 | "module": "commonjs",
6 | "noImplicitAny": true,
7 | "outDir": "dist",
8 | "rootDir": "."{{^supportsES6}},
9 | "lib": [
10 | "es6",
11 | "dom"
12 | ]
13 | {{/supportsES6}}
14 | },
15 | "exclude": [
16 | "dist",
17 | "node_modules",
18 | "**/*.spec.ts"
19 | ]
20 | }
21 |
--------------------------------------------------------------------------------
/src/main/resources/handlebars/R/description.mustache:
--------------------------------------------------------------------------------
1 | Package: {{{packageName}}}
2 | Title: R Package Client for {{{appName}}}
3 | Version: {{packageVersion}}
4 | Authors@R: person("Swagger Codegen community", email = "apiteam@swagger.io", role = c("aut", "cre"))
5 | Description: {{{appDescription}}}{{^appDescription}}R Package Client for {{{appName}}}{{/appDescription}}
6 | Depends: R (>= 3.3.3)
7 | Encoding: UTF-8
8 | License: Unlicense
9 | LazyData: true
10 | Suggests: testthat
11 | Imports: jsonlite, httr, R6
12 | RoxygenNote: 6.0.1.9000
13 |
--------------------------------------------------------------------------------
/src/main/resources/handlebars/swift4/model.mustache:
--------------------------------------------------------------------------------
1 | {{#models}}{{#model}}//
2 | // {{classname}}.swift
3 | //
4 | // Generated by swagger-codegen
5 | // https://github.com/swagger-api/swagger-codegen
6 | //
7 |
8 | import Foundation
9 |
10 | {{#description}}
11 | /** {{description}} */{{/description~}}
12 | {{#is this 'array-model'}}
13 | {{> modelArray}}
14 | {{/is}}{{#isNot this 'array-model'}}{{#is this 'enum'}}
15 | {{> modelEnum}}
16 | {{/is~}}{{#isNot this 'enum'}}
17 | {{> modelObject}}
18 | {{/isNot}}{{/isNot}}{{/model}}{{/models~}}
19 |
--------------------------------------------------------------------------------
/src/main/resources/handlebars/Java/beanValidation.mustache:
--------------------------------------------------------------------------------
1 | {{#required}}{{^useNullableForNotNull}}
2 | @NotNull
3 | {{/useNullableForNotNull}}{{/required}}
4 | {{#useNullableForNotNull}}{{^nullable}}
5 | @NotNull
6 | {{/nullable}}{{/useNullableForNotNull}}
7 | {{#is this 'container'}}
8 | {{#isNot this 'primitive-type'}}
9 | {{#isNot this 'enum'}}
10 | @Valid
11 | {{/isNot}}
12 | {{/isNot}}
13 | {{/is}}
14 | {{#isNot this 'container'}}
15 | {{#isNot this 'primitive-type'}}
16 | @Valid
17 | {{/isNot}}
18 | {{/isNot}}
19 | {{>beanValidationCore}}
--------------------------------------------------------------------------------
/src/main/resources/handlebars/dart/auth/oauth.mustache:
--------------------------------------------------------------------------------
1 | part of {{pubName}}.api;
2 |
3 | class OAuth implements Authentication {
4 | String accessToken;
5 |
6 | OAuth({this.accessToken}) {
7 | }
8 |
9 | @override
10 | void applyToParams(List queryParams, Map headerParams) {
11 | if (accessToken != null) {
12 | headerParams["Authorization"] = "Bearer " + accessToken;
13 | }
14 | }
15 |
16 | void setAccessToken(String accessToken) {
17 | this.accessToken = accessToken;
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/src/main/resources/handlebars/javascript/es6/licenseInfo.mustache:
--------------------------------------------------------------------------------
1 | /*
2 | * {{{appName}}}
3 | * {{{appDescription}}}
4 | *
5 | {{#version}}
6 | * OpenAPI spec version: {{{version}}}
7 | {{/version}}
8 | {{#infoEmail}}
9 | * Contact: {{{infoEmail}}}
10 | {{/infoEmail}}
11 | *
12 | * NOTE: This class is auto generated by the swagger code generator program.
13 | * https://github.com/swagger-api/swagger-codegen.git
14 | *
15 | * Swagger Codegen version: {{{generatorVersion}}}
16 | *
17 | * Do not edit the class manually.
18 | *
19 | */
20 |
--------------------------------------------------------------------------------
/src/main/resources/handlebars/JavaJaxRS/cxf-cdi/beanValidation.mustache:
--------------------------------------------------------------------------------
1 | {{#required}}{{^useNullableForNotNull}}
2 | @NotNull
3 | {{/useNullableForNotNull}}{{/required}}
4 | {{#useNullableForNotNull}}{{^nullable}}
5 | @NotNull
6 | {{/nullable}}{{/useNullableForNotNull}}
7 | {{#isContainer}}
8 | {{^isPrimitiveType}}
9 | {{^isEnum}}
10 | @Valid
11 | {{/isEnum}}
12 | {{/isPrimitiveType}}
13 | {{/isContainer}}
14 | {{#isNotContainer}}
15 | {{^isPrimitiveType}}
16 | @Valid
17 | {{/isPrimitiveType}}
18 | {{/isNotContainer}}
19 | {{>beanValidationCore}}
20 |
--------------------------------------------------------------------------------
/src/main/resources/handlebars/JavaJaxRS/resteasy/eap/bodyParams.mustache:
--------------------------------------------------------------------------------
1 | {{#is this 'body-param'}}{{#useOas2}}@ApiParam(value = "{{{description}}}" {{#required}},required=true{{/required}}{{#allowableValues}}, {{> allowableValues }}{{/allowableValues}}{{#defaultValue}}, defaultValue="{{{defaultValue}}}"{{/defaultValue}}) {{{dataType}}} {{paramName}}{{/useOas2}}{{^useOas2}}@Parameter(description = "{{{description}}}" {{#required}},required=true{{/required}}{{#allowableValues}}, {{> allowableValues }}{{/allowableValues}}) {{{dataType}}} {{paramName}}{{/useOas2}}{{/is}}
--------------------------------------------------------------------------------
/src/main/resources/handlebars/JavaSpring/allowableValues.mustache:
--------------------------------------------------------------------------------
1 | {{#useOas2}}
2 | {{#allowableValues}}allowableValues="{{#values}}{{{.}}}{{^@last}}, {{/@last}}{{/values}}{{^values}}range=[{{#min}}{{.}}{{/min}}{{^min}}-infinity{{/min}}, {{#max}}{{.}}{{/max}}{{^max}}infinity{{/max}}]{{/values}}"{{/allowableValues}}
3 | {{/useOas2}}
4 | {{^useOas2}}
5 | {{#allowableValues}}allowableValues={ {{#values}}"{{{.}}}"{{^@last}}, {{/@last}}{{/values}}{{^values}}{{/values}} }{{#min}}, minimum="{{.}}"{{/min}}{{#max}}, maximum="{{.}}"{{/max}}{{/allowableValues}}
6 | {{/useOas2}}
--------------------------------------------------------------------------------
/src/main/resources/handlebars/JavaSpring/libraries/spring-boot3/homeController.mustache:
--------------------------------------------------------------------------------
1 | package {{configPackage}};
2 |
3 | import org.springframework.stereotype.Controller;
4 | import org.springframework.web.bind.annotation.RequestMapping;
5 |
6 | /**
7 | * Home redirection to swagger api documentation
8 | */
9 | @Controller
10 | public class HomeController {
11 | @RequestMapping(value = "/")
12 | public String index() {
13 | System.out.println("/swagger-ui/index.html");
14 | return "redirect:/swagger-ui/";
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/src/main/resources/handlebars/pythonFlaskConnexion/__init__test.mustache:
--------------------------------------------------------------------------------
1 | import logging
2 |
3 | import connexion
4 | from flask_testing import TestCase
5 |
6 | from {{packageName}}.encoder import JSONEncoder
7 |
8 |
9 | class BaseTestCase(TestCase):
10 |
11 | def create_app(self):
12 | logging.getLogger('connexion.operation').setLevel('ERROR')
13 | app = connexion.App(__name__, specification_dir='../swagger/')
14 | app.app.json_encoder = JSONEncoder
15 | app.add_api('swagger.yaml')
16 | return app.app
17 |
--------------------------------------------------------------------------------
/src/main/resources/handlebars/JavaJaxRS/beanValidation.mustache:
--------------------------------------------------------------------------------
1 | {{#required}}{{^useNullableForNotNull}}
2 | @NotNull
3 | {{/useNullableForNotNull}}{{/required}}
4 | {{#useNullableForNotNull}}{{^nullable}}
5 | @NotNull
6 | {{/nullable}}{{/useNullableForNotNull}}
7 | {{#is this 'container'}}
8 | {{#isNot this 'primitive-type'}}
9 | {{#isNot this 'enum'}}
10 | @Valid
11 | {{/isNot}}
12 | {{/isNot}}
13 | {{/is}}
14 | {{#isNot this 'container'}}
15 | {{#isNot this 'primitive-type'}}
16 | @Valid
17 | {{/isNot}}
18 | {{/isNot}}
19 | {{>beanValidationCore}}
20 |
--------------------------------------------------------------------------------
/src/main/resources/handlebars/go-server/main.mustache:
--------------------------------------------------------------------------------
1 | {{>partial_header}}
2 | package main
3 |
4 | import (
5 | "log"
6 | "net/http"
7 |
8 | // WARNING!
9 | // Change this to a fully-qualified import path
10 | // once you place this file into your project.
11 | // For example,
12 | //
13 | // sw "github.com/myname/myrepo/{{apiPath}}"
14 | //
15 | sw "./{{apiPath}}"
16 | )
17 |
18 | func main() {
19 | log.Printf("Server started")
20 |
21 | router := sw.NewRouter()
22 |
23 | log.Fatal(http.ListenAndServe(":{{serverPort}}", router))
24 | }
25 |
--------------------------------------------------------------------------------
/src/main/resources/handlebars/kotlin-server/libraries/ktor/logback.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | %d{YYYY-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/src/main/resources/handlebars/swagger-static/model.mustache:
--------------------------------------------------------------------------------
1 | {{#models}}
2 | {{#model}}
3 |
4 | {{classname}}
5 | {{#vars}}
6 |
7 | - {{name}} : {{datatype}}
8 |
{{description}}
9 | {{#is this 'enum'}}
10 |
11 | - Enum:
12 | {{#_enum}}
13 |
- {{this}}
14 | {{/_enum}}
15 |
16 |
17 | {{/is}}
18 |
19 |
20 | {{/vars}}
21 | {{/model}}
22 | {{/models}}
23 |
--------------------------------------------------------------------------------
/src/main/resources/handlebars/JavaJaxRS/cxf-cdi/bodyParams.mustache:
--------------------------------------------------------------------------------
1 | {{#is this 'body-param'}}
2 | {{#useOas2}}@ApiParam(value = "{{{description}}}" {{#required}},required=true{{/required}}{{#allowableValues}}, {{> allowableValues }}{{/allowableValues}}{{#defaultValue}}, defaultValue="{{{defaultValue}}}"{{/defaultValue}}) {{{dataType}}} {{paramName}}{{/useOas2}}
3 | {{^useOas2}}@Parameter(description = "{{{description}}}" {{#required}},required=true{{/required}}{{#allowableValues}}, {{> allowableValues }}{{/allowableValues}}) {{{dataType}}} {{paramName}}{{/useOas2}}
4 | {{/is}}
--------------------------------------------------------------------------------
/src/main/resources/handlebars/JavaJaxRS/resteasy/bodyParams.mustache:
--------------------------------------------------------------------------------
1 | {{#is this 'body-param'}}
2 | {{#useOas2}}@ApiParam(value = "{{{description}}}" {{#required}},required=true{{/required}}{{#allowableValues}}, {{> allowableValues }}{{/allowableValues}}{{#defaultValue}}, defaultValue="{{{defaultValue}}}"{{/defaultValue}}) {{{dataType}}} {{paramName}}{{/useOas2}}
3 | {{^useOas2}}@Parameter(description = "{{{description}}}" {{#required}},required=true{{/required}}{{#allowableValues}}, {{> allowableValues }}{{/allowableValues}}) {{{dataType}}} {{paramName}}{{/useOas2}}
4 | {{/is}}
--------------------------------------------------------------------------------
/src/main/resources/handlebars/htmlDocs/bodyParam.mustache:
--------------------------------------------------------------------------------
1 | {{#is this 'body-param'}}{{baseName}} {{#baseType}}
{{baseType}}{{/baseType}} {{^required}}(optional){{/required}}{{#required}}(required){{/required}}
2 |
3 | Body Parameter — {{unescapedDescription}} {{#defaultValue}}default: {{{defaultValue}}}{{/defaultValue}}
{{/is}}
4 | {{#example}}example: {{example}}
{{/example}}
--------------------------------------------------------------------------------
/src/main/resources/handlebars/swift5/model.mustache:
--------------------------------------------------------------------------------
1 | {{#models}}{{#model}}//
2 | // {{classname}}.swift
3 | //
4 | // Generated by swagger-codegen
5 | // https://github.com/swagger-api/swagger-codegen
6 | //
7 |
8 | import Foundation
9 |
10 | {{#description}}
11 |
12 | /** {{description}} */{{/description}}
13 | {{#isArrayModel}}
14 | {{> modelArray}}
15 | {{/isArrayModel}}
16 | {{^isArrayModel}}
17 | {{#isEnum}}
18 | {{> modelEnum}}
19 | {{/isEnum}}
20 | {{^isEnum}}
21 | {{> modelObject}}
22 | {{/isEnum}}
23 | {{/isArrayModel}}
24 | {{/model}}
25 | {{/models}}
26 |
--------------------------------------------------------------------------------
/src/main/resources/handlebars/Java/libraries/retrofit2/formParams.mustache:
--------------------------------------------------------------------------------
1 | {{#is this 'form-param'}}{{#isNot this 'binary'}}{{#is this 'multipart'}}@retrofit2.http.Part{{/is}}{{#isNot this 'multipart'}}@retrofit2.http.Field{{/isNot}}("{{baseName}}") {{{dataType}}} {{paramName}}{{/isNot}}{{#is this 'binary'}}{{#is this 'multipart'}}@retrofit2.http.Part{{/is}}{{#isNot this 'multipart'}}@retrofit2.http.Field{{/isNot}}{{#usePlayWS}} okhttp3.MultipartBody.Part {{/usePlayWS}}{{^usePlayWS}}("{{baseName}}\"; filename=\"{{baseName}}") RequestBody {{/usePlayWS}}{{paramName}}{{/is}}{{/is}}
--------------------------------------------------------------------------------
/src/main/resources/handlebars/JavaJaxRS/allowableValues.mustache:
--------------------------------------------------------------------------------
1 | {{#useOas2}}
2 | {{#allowableValues}}allowableValues="{{#values}}{{{.}}}{{^@last}}, {{/@last}}{{/values}}{{^values}}range=[{{#min}}{{.}}{{/min}}{{^min}}-infinity{{/min}}, {{#max}}{{.}}{{/max}}{{^max}}infinity{{/max}}]{{/values}}"{{/allowableValues}}
3 | {{/useOas2}}
4 | {{^useOas2}}
5 | {{#allowableValues}}schema=@Schema(allowableValues={ {{#values}}"{{{.}}}"{{^@last}}, {{/@last}}{{/values}}{{^values}}{{/values}} }{{#min}}, minimum="{{.}}"{{/min}}{{#max}}, maximum="{{.}}"{{/max}}){{/allowableValues}}
6 | {{/useOas2}}
--------------------------------------------------------------------------------
/src/main/resources/handlebars/aspnetcore/formParam.mustache:
--------------------------------------------------------------------------------
1 | {{#isFormParam}}[FromForm]{{#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}}
--------------------------------------------------------------------------------
/src/main/resources/handlebars/aspnetcore/pathParam.mustache:
--------------------------------------------------------------------------------
1 | {{#isPathParam}}[FromRoute]{{#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}}
--------------------------------------------------------------------------------
/src/main/resources/handlebars/JavaJaxRS/cxf/allowableValues.mustache:
--------------------------------------------------------------------------------
1 | {{#useOas2}}
2 | {{#allowableValues}}allowableValues="{{#values}}{{{.}}}{{^@last}}, {{/@last}}{{/values}}{{^values}}range=[{{#min}}{{.}}{{/min}}{{^min}}-infinity{{/min}}, {{#max}}{{.}}{{/max}}{{^max}}infinity{{/max}}]{{/values}}"{{/allowableValues}}
3 | {{/useOas2}}
4 | {{^useOas2}}
5 | {{#allowableValues}}schema=@Schema(allowableValues={ {{#values}}"{{{.}}}"{{^@last}}, {{/@last}}{{/values}}{{^values}}{{/values}} }{{#min}}, minimum="{{.}}"{{/min}}{{#max}}, maximum="{{.}}"{{/max}}){{/allowableValues}}
6 | {{/useOas2}}
--------------------------------------------------------------------------------
/src/main/resources/handlebars/JavaJaxRS/spec/allowableValues.mustache:
--------------------------------------------------------------------------------
1 | {{#useOas2}}
2 | {{#allowableValues}}allowableValues="{{#values}}{{{.}}}{{^@last}}, {{/@last}}{{/values}}{{^values}}range=[{{#min}}{{.}}{{/min}}{{^min}}-infinity{{/min}}, {{#max}}{{.}}{{/max}}{{^max}}infinity{{/max}}]{{/values}}"{{/allowableValues}}
3 | {{/useOas2}}
4 | {{^useOas2}}
5 | {{#allowableValues}}schema=@Schema(allowableValues={ {{#values}}"{{{.}}}"{{^@last}}, {{/@last}}{{/values}}{{^values}}{{/values}} }{{#min}}, minimum="{{.}}"{{/min}}{{#max}}, maximum="{{.}}"{{/max}}){{/allowableValues}}
6 | {{/useOas2}}
--------------------------------------------------------------------------------
/src/main/resources/handlebars/aspnetcore/Dockerfile.mustache:
--------------------------------------------------------------------------------
1 | FROM microsoft/aspnetcore-build:{{aspNetCoreVersion}} AS build-env
2 | WORKDIR /app
3 |
4 | ENV DOTNET_CLI_TELEMETRY_OPTOUT 1
5 |
6 | # copy csproj and restore as distinct layers
7 | COPY *.csproj ./
8 | RUN dotnet restore
9 |
10 | # copy everything else and build
11 | COPY . ./
12 | RUN dotnet publish -c Release -o out
13 |
14 | # build runtime image
15 | FROM microsoft/aspnetcore:{{aspNetCoreVersion}}
16 | WORKDIR /app
17 | COPY --from=build-env /app/out .
18 | ENTRYPOINT ["dotnet", "{{packageName}}.dll"]
19 |
--------------------------------------------------------------------------------
/src/main/resources/handlebars/aspnetcore/queryParam.mustache:
--------------------------------------------------------------------------------
1 | {{#isQueryParam}}[FromQuery]{{#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}}
--------------------------------------------------------------------------------
/src/main/resources/handlebars/javascript/enumClass.mustache:
--------------------------------------------------------------------------------
1 | {{#emitJSDoc}}
2 | /**
3 | * Allowed values for the {{baseName}} property.
4 | * @enum {{braces "left"}}{{datatype}}{{braces "right"}}
5 | * @readonly
6 | */
7 | {{/emitJSDoc}}
8 | exports.{{datatypeWithEnum}} = {
9 | {{#allowableValues}}
10 | {{#enumVars}}
11 | {{#emitJSDoc}}
12 | /**
13 | * value: {{{value}}}
14 | * @const
15 | */
16 | {{/emitJSDoc}}
17 | "{{name}}": {{{value}}}{{^@last}},
18 | {{/@last}}
19 | {{/enumVars}}
20 | {{/allowableValues}}
21 | };
22 |
--------------------------------------------------------------------------------
/src/main/resources/handlebars/Java/auth/Authentication.mustache:
--------------------------------------------------------------------------------
1 | {{>licenseInfo}}
2 |
3 | package {{invokerPackage}}.auth;
4 |
5 | import {{invokerPackage}}.Pair;
6 |
7 | import java.util.Map;
8 | import java.util.List;
9 |
10 | public interface Authentication {
11 | /**
12 | * Apply authentication settings to header and query params.
13 | *
14 | * @param queryParams List of query parameters
15 | * @param headerParams Map of header parameters
16 | */
17 | void applyToParams(List queryParams, Map headerParams);
18 | }
19 |
--------------------------------------------------------------------------------
/src/main/resources/handlebars/Java/typeInfoAnnotation.mustache:
--------------------------------------------------------------------------------
1 | {{#jackson}}
2 | @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "{{discriminator.propertyName}}", visible = true )
3 | @JsonSubTypes({
4 | {{#children}}
5 | @JsonSubTypes.Type(value = {{classname}}.class, name = "{{^vendorExtensions.x-discriminator-value}}{{subtypeName}}{{/vendorExtensions.x-discriminator-value}}{{#vendorExtensions.x-discriminator-value}}{{{vendorExtensions.x-discriminator-value}}}{{/vendorExtensions.x-discriminator-value}}"),
6 | {{/children}}
7 | })
8 | {{/jackson}}
--------------------------------------------------------------------------------
/src/main/resources/handlebars/JavaJaxRS/cxf-cdi/allowableValues.mustache:
--------------------------------------------------------------------------------
1 | {{#useOas2}}
2 | {{#allowableValues}}allowableValues="{{#values}}{{{.}}}{{^@last}}, {{/@last}}{{/values}}{{^values}}range=[{{#min}}{{.}}{{/min}}{{^min}}-infinity{{/min}}, {{#max}}{{.}}{{/max}}{{^max}}infinity{{/max}}]{{/values}}"{{/allowableValues}}
3 | {{/useOas2}}
4 | {{^useOas2}}
5 | {{#allowableValues}}schema=@Schema(allowableValues={ {{#values}}"{{{.}}}"{{^@last}}, {{/@last}}{{/values}}{{^values}}{{/values}} }{{#min}}, minimum="{{.}}"{{/min}}{{#max}}, maximum="{{.}}"{{/max}}){{/allowableValues}}
6 | {{/useOas2}}
--------------------------------------------------------------------------------
/src/main/resources/handlebars/JavaJaxRS/resteasy/allowableValues.mustache:
--------------------------------------------------------------------------------
1 | {{#useOas2}}
2 | {{#allowableValues}}allowableValues="{{#values}}{{{.}}}{{^@last}}, {{/@last}}{{/values}}{{^values}}range=[{{#min}}{{.}}{{/min}}{{^min}}-infinity{{/min}}, {{#max}}{{.}}{{/max}}{{^max}}infinity{{/max}}]{{/values}}"{{/allowableValues}}
3 | {{/useOas2}}
4 | {{^useOas2}}
5 | {{#allowableValues}}schema=@Schema(allowableValues={ {{#values}}"{{{.}}}"{{^@last}}, {{/@last}}{{/values}}{{^values}}{{/values}} }{{#min}}, minimum="{{.}}"{{/min}}{{#max}}, maximum="{{.}}"{{/max}}){{/allowableValues}}
6 | {{/useOas2}}
--------------------------------------------------------------------------------
/src/main/resources/handlebars/JavaJaxRS/resteasy/cookieParams.mustache:
--------------------------------------------------------------------------------
1 | {{#isCookieParam}}
2 | {{#useOas2}}@ApiParam(value = "{{{description}}}" {{#required}},required=true{{/required}}{{#allowableValues}}, {{> allowableValues }}{{/allowableValues}}{{#defaultValue}}, defaultValue="{{{defaultValue}}}"{{/defaultValue}}) {{{dataType}}} {{paramName}}{{/useOas2}}
3 | {{^useOas2}}@Parameter(description = "{{{description}}}" {{#required}},required=true{{/required}}{{#allowableValues}}, {{> allowableValues }}{{/allowableValues}}) {{{dataType}}} {{paramName}}{{/useOas2}}
4 | {{/isCookieParam}}
5 |
--------------------------------------------------------------------------------
/src/main/resources/handlebars/JavaJaxRS/resteasy/eap/cookieParams.mustache:
--------------------------------------------------------------------------------
1 | {{#isCookieParam}}
2 | {{#useOas2}}@ApiParam(value = "{{{description}}}" {{#required}},required=true{{/required}}{{#allowableValues}}, {{> allowableValues }}{{/allowableValues}}{{#defaultValue}}, defaultValue="{{{defaultValue}}}"{{/defaultValue}}) {{{dataType}}} {{paramName}}{{/useOas2}}
3 | {{^useOas2}}@Parameter(description = "{{{description}}}" {{#required}},required=true{{/required}}{{#allowableValues}}, {{> allowableValues }}{{/allowableValues}}) {{{dataType}}} {{paramName}}{{/useOas2}}
4 | {{/isCookieParam}}
5 |
--------------------------------------------------------------------------------
/src/main/resources/handlebars/JavaSpring/libraries/spring-mvc/webMvcConfiguration.mustache:
--------------------------------------------------------------------------------
1 | package {{configPackage}};
2 |
3 | import org.springframework.web.servlet.config.annotation.DefaultServletHandlerConfigurer;
4 | import org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport;
5 |
6 | {{>generatedAnnotation}}
7 | public class WebMvcConfiguration extends WebMvcConfigurationSupport {
8 | @Override
9 | public void configureDefaultServletHandling(DefaultServletHandlerConfigurer configurer) {
10 | configurer.enable();
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/src/main/resources/handlebars/aspnetcore/headerParam.mustache:
--------------------------------------------------------------------------------
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}}
--------------------------------------------------------------------------------
/src/main/resources/handlebars/JavaJaxRS/resteasy/eap/allowableValues.mustache:
--------------------------------------------------------------------------------
1 | {{#useOas2}}
2 | {{#allowableValues}}allowableValues="{{#values}}{{{.}}}{{^@last}}, {{/@last}}{{/values}}{{^values}}range=[{{#min}}{{.}}{{/min}}{{^min}}-infinity{{/min}}, {{#max}}{{.}}{{/max}}{{^max}}infinity{{/max}}]{{/values}}"{{/allowableValues}}
3 | {{/useOas2}}
4 | {{^useOas2}}
5 | {{#allowableValues}}schema=@Schema(allowableValues={ {{#values}}"{{{.}}}"{{^@last}}, {{/@last}}{{/values}}{{^values}}{{/values}} }{{#min}}, minimum="{{.}}"{{/min}}{{#max}}, maximum="{{.}}"{{/max}}){{/allowableValues}}
6 | {{/useOas2}}
--------------------------------------------------------------------------------
/src/main/resources/handlebars/JavaJaxRS/resteasy/eap/web.mustache:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 | resteasy.providers
7 | {{invokerPackage}}.JacksonConfig
8 |
9 |
10 |
--------------------------------------------------------------------------------
/src/main/resources/handlebars/typescript-angular/modelGenericEnums.mustache:
--------------------------------------------------------------------------------
1 | {{#has this 'enums'}}
2 |
3 | export namespace {{classname}} {
4 | {{#vars}}
5 | {{#is this 'enum'}}
6 | export type {{enumName}} = {{#allowableValues}}{{#enumVars}}{{{value}}}{{^@last}} | {{/@last}}{{/enumVars}}{{/allowableValues}};
7 | export const {{enumName}} = {
8 | {{#allowableValues}}
9 | {{#enumVars}}
10 | {{name}}: {{{value}}} as {{enumName}}{{^@last}},{{/@last}}
11 | {{/enumVars}}
12 | {{/allowableValues}}
13 | };
14 | {{/is}}
15 | {{/vars}}
16 | }{{/has}}
--------------------------------------------------------------------------------
/src/main/resources/handlebars/JavaSpring/TestUtils.mustache:
--------------------------------------------------------------------------------
1 | package {{basePackage}};
2 |
3 | import java.util.Random;
4 | import java.util.concurrent.atomic.AtomicLong;
5 |
6 | public class TestUtils {
7 | private static final AtomicLong atomicId = createAtomicId();
8 |
9 | public static long nextId() {
10 | return atomicId.getAndIncrement();
11 | }
12 |
13 | private static AtomicLong createAtomicId() {
14 | int baseId = new Random(System.currentTimeMillis()).nextInt(1000000) + 20000;
15 | return new AtomicLong((long) baseId);
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/src/main/resources/handlebars/JavaSpring/typeInfoAnnotation.mustache:
--------------------------------------------------------------------------------
1 | {{#jackson}}
2 | @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "{{discriminator.propertyName}}", visible = true )
3 | @JsonSubTypes({
4 | {{#if discriminator.mapping}}
5 | {{#each discriminator.mapping}}
6 | @JsonSubTypes.Type(value = {{this}}.class, name = "{{@key}}"),
7 | {{/each}}
8 | {{else}}
9 | {{#children}}
10 | @JsonSubTypes.Type(value = {{classname}}.class, name = "{{name}}"),
11 | {{/children}}
12 | {{/if}}
13 | })
14 | {{/jackson}}
--------------------------------------------------------------------------------
/src/main/resources/handlebars/javascript/es6/enumClass.mustache:
--------------------------------------------------------------------------------
1 | {{#emitJSDoc}} /**
2 | * Allowed values for the {{baseName}} property.
3 | * @enum {{braces "left"}}{{datatype}}{{braces "right"}}
4 | * @readonly
5 | */{{/emitJSDoc}}
6 | export default {{datatypeWithEnum}} = {
7 | {{#allowableValues}}
8 | {{#enumVars}}
9 | {{#emitJSDoc}}
10 | /**
11 | * value: {{{value}}}
12 | * @const
13 | */
14 | {{/emitJSDoc}}
15 | "{{name}}": {{{value}}}{{^@last}},
16 | {{/@last}}
17 | {{/enumVars}}
18 | {{/allowableValues}}
19 | };
20 |
--------------------------------------------------------------------------------
/src/main/resources/handlebars/typescript-angular/model.mustache:
--------------------------------------------------------------------------------
1 | {{>licenseInfo}}
2 | {{#models}}
3 | {{#model}}
4 |
5 | {{#tsImports}}
6 | import { {{classname}} } from './{{filename}}';
7 | {{/tsImports}}
8 |
9 | {{#description}}
10 | /**
11 | * {{{description}}}
12 | */
13 | {{/description}}
14 | {{#is this 'enum'}}{{>modelEnum}}{{/is}}{{#isNot this 'enum'}}{{#is this 'alias'}}{{>modelAlias}}{{/is}}{{#isNot this 'alias'}}{{#taggedUnions}}{{>modelTaggedUnion}}{{/taggedUnions}}{{^taggedUnions}}{{>modelGeneric}}{{/taggedUnions}}{{/isNot}}{{/isNot}}
15 | {{/model}}
16 | {{/models}}
17 |
--------------------------------------------------------------------------------
/src/main/resources/handlebars/JavaJaxRS/cookieParams.mustache:
--------------------------------------------------------------------------------
1 | {{#isCookieParam}}
2 | {{#useOas2}}@ApiParam(value = "{{{description}}}" {{#required}},required=true{{/required}}{{#allowableValues}}, {{> allowableValues }}{{/allowableValues}}{{#defaultValue}}, defaultValue="{{{defaultValue}}}"{{/defaultValue}}) {{{dataType}}} {{paramName}}{{/useOas2}}
3 | {{^useOas2}}@Parameter(in = ParameterIn.COOKIE, description = "{{{description}}}" {{#required}},required=true{{/required}}{{#allowableValues}}, {{> allowableValues }}{{/allowableValues}}) {{{dataType}}} {{paramName}}{{/useOas2}}
4 | {{/isCookieParam}}
5 |
--------------------------------------------------------------------------------
/src/main/resources/handlebars/JavaJaxRS/typeInfoAnnotation.mustache:
--------------------------------------------------------------------------------
1 | {{#jackson}}
2 | @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "{{discriminator.propertyName}}", visible = true )
3 | @JsonSubTypes({
4 | {{#if discriminator.mapping}}
5 | {{#each discriminator.mapping}}
6 | @JsonSubTypes.Type(value = {{this}}.class, name = "{{@key}}"),
7 | {{/each}}
8 | {{else}}
9 | {{#children}}
10 | @JsonSubTypes.Type(value = {{classname}}.class, name = "{{name}}"),
11 | {{/children}}
12 | {{/if}}
13 | })
14 | {{/jackson}}
15 |
--------------------------------------------------------------------------------
/src/main/resources/handlebars/JavaSpring/project/plugins.sbt:
--------------------------------------------------------------------------------
1 | addSbtPlugin("com.eed3si9n" % "sbt-assembly" % "0.8.4")
2 |
3 | libraryDependencies <+= sbtVersion(v => v match {
4 | case "0.11.0" => "com.github.siasia" %% "xsbt-web-plugin" % "0.11.0-0.2.8"
5 | case "0.11.1" => "com.github.siasia" %% "xsbt-web-plugin" % "0.11.1-0.2.10"
6 | case "0.11.2" => "com.github.siasia" %% "xsbt-web-plugin" % "0.11.2-0.2.11"
7 | case "0.11.3" => "com.github.siasia" %% "xsbt-web-plugin" % "0.11.3-0.2.11.1"
8 | case x if (x.startsWith("0.12")) => "com.github.siasia" %% "xsbt-web-plugin" % "0.12.0-0.2.11.1"
9 | })
--------------------------------------------------------------------------------
/src/main/resources/handlebars/JavaVertXServer/typeInfoAnnotation.mustache:
--------------------------------------------------------------------------------
1 | {{#jackson}}
2 | @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "{{discriminator.propertyName}}", visible = true )
3 | @JsonSubTypes({
4 | {{#if discriminator.mapping}}
5 | {{#each discriminator.mapping}}
6 | @JsonSubTypes.Type(value = {{this}}.class, name = "{{@key}}"),
7 | {{/each}}
8 | {{else}}
9 | {{#children}}
10 | @JsonSubTypes.Type(value = {{classname}}.class, name = "{{name}}"),
11 | {{/children}}
12 | {{/if}}
13 | })
14 | {{/jackson}}
--------------------------------------------------------------------------------
/src/main/resources/handlebars/javascript/es6/partial_model_inner_enum.mustache:
--------------------------------------------------------------------------------
1 | {{#emitJSDoc}}
2 | /**
3 | * Allowed values for the {{name}} property.
4 | * @enum {{braces "left"}}{{datatype}}{{braces "right"}}
5 | * @readonly
6 | */
7 | {{/emitJSDoc}}
8 | {{classname}}.{{datatypeWithEnum}} = {
9 | {{#allowableValues}}
10 | {{#enumVars}}
11 | {{#emitJSDoc}}
12 | /**
13 | * value: {{{value}}}
14 | * @const
15 | */
16 | {{/emitJSDoc}}
17 | {{name}}: {{{value}}}{{^@last}},
18 |
19 | {{/@last}}
20 | {{/enumVars}}
21 | {{/allowableValues}}
22 |
23 | };
24 |
--------------------------------------------------------------------------------
/src/main/resources/handlebars/python/__init__package.mustache:
--------------------------------------------------------------------------------
1 | # coding: utf-8
2 |
3 | # flake8: noqa
4 |
5 | {{>partial_header}}
6 |
7 | from __future__ import absolute_import
8 |
9 | # import apis into sdk package
10 | {{#apiInfo}}{{#apis}}from {{importPath}} import {{classname}}
11 | {{/apis}}{{/apiInfo}}
12 | # import ApiClient
13 | from {{packageName}}.api_client import ApiClient
14 | from {{packageName}}.configuration import Configuration
15 | # import models into sdk package
16 | {{#models}}{{#model}}from {{modelPackage}}.{{classFilename}} import {{classname}}
17 | {{/model}}{{/models}}
--------------------------------------------------------------------------------
/src/main/resources/handlebars/ruby/model_doc.mustache:
--------------------------------------------------------------------------------
1 | {{#models}}{{#model}}# {{moduleName}}::{{classname}}
2 |
3 | ## Properties
4 | Name | Type | Description | Notes
5 | ------------ | ------------- | ------------- | -------------
6 | {{#vars}}**{{name}}** | {{#isPrimitiveType}}**{{datatype}}**{{/isPrimitiveType}}{{^isPrimitiveType}}[**{{datatype}}**]({{complexType}}.md){{/isPrimitiveType}} | {{description}} | {{^required}}[optional] {{/required}}{{#readOnly}}[readonly] {{/readOnly}}{{#defaultValue}}[default to {{defaultValue}}]{{/defaultValue}}
7 | {{/vars}}
8 |
9 | {{/model}}{{/models}}
10 |
--------------------------------------------------------------------------------
/src/main/resources/handlebars/typescript-axios/tsconfig.mustache:
--------------------------------------------------------------------------------
1 | {
2 | "compilerOptions": {
3 | "declaration": true,
4 | "target": "{{#supportsES6}}es6{{/supportsES6}}{{^supportsES6}}es5{{/supportsES6}}",
5 | "module": "commonjs",
6 | "noImplicitAny": true,
7 | "outDir": "dist",
8 | "rootDir": ".",
9 | {{^supportsES6}}
10 | "lib": [
11 | "es6",
12 | "dom"
13 | ],
14 | {{/supportsES6}}
15 | "typeRoots": [
16 | "node_modules/@types"
17 | ]
18 | },
19 | "exclude": [
20 | "dist",
21 | "node_modules"
22 | ]
23 | }
24 |
--------------------------------------------------------------------------------
/src/main/resources/handlebars/JavaInflector/typeInfoAnnotation.mustache:
--------------------------------------------------------------------------------
1 | {{#jackson}}
2 | @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "{{discriminator.propertyName}}", visible = true )
3 | @JsonSubTypes({
4 | {{#if discriminator.mapping}}
5 | {{#each discriminator.mapping}}
6 | @JsonSubTypes.Type(value = {{this}}.class, name = "{{@key}}"),
7 | {{/each}}
8 | {{else}}
9 | {{#children}}
10 | @JsonSubTypes.Type(value = {{classname}}.class, name = "{{name}}"),
11 | {{/children}}
12 | {{/if}}
13 | })
14 | {{/jackson}}
15 |
--------------------------------------------------------------------------------
/src/main/resources/handlebars/JavaMicronaut/project/plugins.sbt:
--------------------------------------------------------------------------------
1 | addSbtPlugin("com.eed3si9n" % "sbt-assembly" % "0.8.4")
2 |
3 | libraryDependencies <+= sbtVersion(v => v match {
4 | case "0.11.0" => "com.github.siasia" %% "xsbt-web-plugin" % "0.11.0-0.2.8"
5 | case "0.11.1" => "com.github.siasia" %% "xsbt-web-plugin" % "0.11.1-0.2.10"
6 | case "0.11.2" => "com.github.siasia" %% "xsbt-web-plugin" % "0.11.2-0.2.11"
7 | case "0.11.3" => "com.github.siasia" %% "xsbt-web-plugin" % "0.11.3-0.2.11.1"
8 | case x if (x.startsWith("0.12")) => "com.github.siasia" %% "xsbt-web-plugin" % "0.12.0-0.2.11.1"
9 | })
--------------------------------------------------------------------------------
/src/main/resources/handlebars/JavaMicronaut/typeInfoAnnotation.mustache:
--------------------------------------------------------------------------------
1 | {{#jackson}}
2 | @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "{{discriminator.propertyName}}", visible = true )
3 | @JsonSubTypes({
4 | {{#if discriminator.mapping}}
5 | {{#each discriminator.mapping}}
6 | @JsonSubTypes.Type(value = {{this}}.class, name = "{{@key}}"),
7 | {{/each}}
8 | {{else}}
9 | {{#children}}
10 | @JsonSubTypes.Type(value = {{classname}}.class, name = "{{name}}"),
11 | {{/children}}
12 | {{/if}}
13 | })
14 | {{/jackson}}
15 |
--------------------------------------------------------------------------------
/src/main/resources/handlebars/aspnetcore/2.1/Dockerfile.mustache:
--------------------------------------------------------------------------------
1 | FROM mcr.microsoft.com/dotnet/core/sdk:{{aspNetCoreVersion}} AS build-env
2 | WORKDIR /app
3 |
4 | ENV DOTNET_CLI_TELEMETRY_OPTOUT 1
5 |
6 | # copy csproj and restore as distinct layers
7 | COPY *.csproj ./
8 | RUN dotnet restore
9 |
10 | # copy everything else and build
11 | COPY . ./
12 | RUN dotnet publish -c Release -o out
13 |
14 | # build runtime image
15 | FROM mcr.microsoft.com/dotnet/core/aspnet:{{aspNetCoreVersion}}
16 | WORKDIR /app
17 | COPY --from=build-env /app/out .
18 | ENTRYPOINT ["dotnet", "{{packageName}}.dll"]
19 |
--------------------------------------------------------------------------------
/src/main/resources/handlebars/javascript/partial_model_inner_enum.mustache:
--------------------------------------------------------------------------------
1 | {{#emitJSDoc}}/**
2 | * Allowed values for the {{baseName}} property.
3 | * @enum {{braces "left"}}{{datatype}}{{braces "right"}}
4 | * @readonly
5 | */{{/emitJSDoc}}
6 | static {{datatypeWithEnum}} = {
7 | {{#allowableValues}}{{#enumVars}}
8 | {{#emitJSDoc}}/**
9 | * value: {{{value}}}
10 | * @const
11 | */{{/emitJSDoc}}
12 | "{{name}}": {{{value}}}{{^@last}},
13 | {{/@last}}
14 | {{/enumVars}}{{/allowableValues}}
15 | };
16 |
--------------------------------------------------------------------------------
/src/main/resources/handlebars/JavaJaxRS/bodyParams.mustache:
--------------------------------------------------------------------------------
1 | {{#is this 'body-param'}}
2 | {{#useOas2}}
3 | @ApiParam(value = "{{{description}}}" {{#required}},required=true{{/required}}{{#allowableValues}}, {{> allowableValues }}{{/allowableValues}}{{#defaultValue}}, defaultValue="{{{defaultValue}}}"{{/defaultValue}}) {{{dataType}}} {{paramName}}
4 | {{/useOas2}}
5 | {{^useOas2}}
6 | @Parameter(in = ParameterIn.DEFAULT, description = "{{{description}}}" {{#required}},required=true{{/required}}{{#allowableValues}}, {{> allowableValues }}{{/allowableValues}}) {{{dataType}}} {{paramName}}
7 | {{/useOas2}}
8 | {{/is}}
--------------------------------------------------------------------------------
/src/main/resources/handlebars/JavaJaxRS/resteasy/headerParams.mustache:
--------------------------------------------------------------------------------
1 | {{#is this 'header-param'}}{{#useOas2}}@ApiParam(value = "{{{description}}}" {{#required}},required=true{{/required}}{{#allowableValues}}, {{> allowableValues }}{{/allowableValues}}{{#defaultValue}}, defaultValue="{{{defaultValue}}}"{{/defaultValue}})@HeaderParam("{{baseName}}") {{{dataType}}} {{paramName}}{{/useOas2}}{{^useOas2}}@Parameter(description = "{{{description}}}" {{#required}},required=true{{/required}}{{#allowableValues}}, {{> allowableValues }}{{/allowableValues}})@HeaderParam("{{baseName}}") {{{dataType}}} {{paramName}}{{/useOas2}}{{/is}}
--------------------------------------------------------------------------------
/src/main/resources/handlebars/JavaMicronaut/application.mustache:
--------------------------------------------------------------------------------
1 | micronaut:
2 | application:
3 | name: {{artifactId}}
4 | router:
5 | static-resources:
6 | swagger:
7 | paths: classpath:META-INF/swagger
8 | mapping: /swagger/**
9 | server:
10 | cors:
11 | enabled: true
12 | configurations:
13 | web:
14 | allowedOrigins: *
15 | allowedMethods:
16 | - GET
17 | - POST
18 | - DELETE
19 | - PUT
20 | allowedHeaders:
21 | - Content-Type
22 | - Authorization
--------------------------------------------------------------------------------
/src/main/resources/handlebars/aspnetcore/3.0/Dockerfile.mustache:
--------------------------------------------------------------------------------
1 | FROM mcr.microsoft.com/dotnet/core/sdk:{{aspNetCoreVersion}} AS build-env
2 | WORKDIR /app
3 |
4 | ENV DOTNET_CLI_TELEMETRY_OPTOUT 1
5 |
6 | # copy csproj and restore as distinct layers
7 | COPY *.csproj ./
8 | RUN dotnet restore
9 |
10 | # copy everything else and build
11 | COPY . ./
12 | RUN dotnet publish -c Release -o out
13 |
14 | # build runtime image
15 | FROM mcr.microsoft.com/dotnet/core/aspnet:{{aspNetCoreVersion}}
16 | WORKDIR /app
17 | COPY --from=build-env /app/out .
18 |
19 | ENTRYPOINT ["dotnet", "{{packageName}}.dll"]
20 |
--------------------------------------------------------------------------------
/src/main/resources/handlebars/go-server/logger.mustache:
--------------------------------------------------------------------------------
1 | {{>partial_header}}
2 | package {{packageName}}
3 |
4 | import (
5 | "log"
6 | "net/http"
7 | "time"
8 | )
9 |
10 | func Logger(inner http.Handler, name string) http.Handler {
11 | return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
12 | start := time.Now()
13 |
14 | inner.ServeHTTP(w, r)
15 |
16 | log.Printf(
17 | "%s %s %s %s",
18 | r.Method,
19 | r.RequestURI,
20 | name,
21 | time.Since(start),
22 | )
23 | })
24 | }
25 |
--------------------------------------------------------------------------------
/src/main/resources/handlebars/JavaJaxRS/libraries/jersey1/project/plugins.sbt:
--------------------------------------------------------------------------------
1 | addSbtPlugin("com.eed3si9n" % "sbt-assembly" % "0.8.4")
2 |
3 | libraryDependencies <+= sbtVersion(v => v match {
4 | case "0.11.0" => "com.github.siasia" %% "xsbt-web-plugin" % "0.11.0-0.2.8"
5 | case "0.11.1" => "com.github.siasia" %% "xsbt-web-plugin" % "0.11.1-0.2.10"
6 | case "0.11.2" => "com.github.siasia" %% "xsbt-web-plugin" % "0.11.2-0.2.11"
7 | case "0.11.3" => "com.github.siasia" %% "xsbt-web-plugin" % "0.11.3-0.2.11.1"
8 | case x if (x.startsWith("0.12")) => "com.github.siasia" %% "xsbt-web-plugin" % "0.12.0-0.2.11.1"
9 | })
--------------------------------------------------------------------------------
/src/main/resources/handlebars/JavaJaxRS/resteasy/eap/headerParams.mustache:
--------------------------------------------------------------------------------
1 | {{#is this 'header-param'}}{{#useOas2}}@ApiParam(value = "{{{description}}}" {{#required}},required=true{{/required}}{{#allowableValues}}, {{> allowableValues }}{{/allowableValues}}{{#defaultValue}}, defaultValue="{{{defaultValue}}}"{{/defaultValue}})@HeaderParam("{{baseName}}") {{{dataType}}} {{paramName}}{{/useOas2}}{{^useOas2}}@Parameter(description = "{{{description}}}" {{#required}},required=true{{/required}}{{#allowableValues}}, {{> allowableValues }}{{/allowableValues}})@HeaderParam("{{baseName}}") {{{dataType}}} {{paramName}}{{/useOas2}}{{/is}}
--------------------------------------------------------------------------------
/src/main/resources/handlebars/csharp-dotnet2/compile-mono.sh.mustache:
--------------------------------------------------------------------------------
1 | curl --location --request GET 'https://dist.nuget.org/win-x86-commandline/latest/nuget.exe' --output './nuget.exe'
2 | mozroots --import --sync
3 | mono nuget.exe install vendor/packages.config -o vendor;
4 | mkdir -p bin;
5 | mcs -sdk:2 -r:vendor/Newtonsoft.Json.7.0.1/lib/net20/Newtonsoft.Json.dll,\
6 | vendor/RestSharp.Net2.1.1.11/lib/net20/RestSharp.Net2.dll,\
7 | System.Runtime.Serialization.dll \
8 | -target:library \
9 | -out:bin/{{packageName}}.dll \
10 | -recurse:'src/*.cs' \
11 | -doc:bin/{{packageName}}.xml \
12 | -platform:anycpu
13 |
--------------------------------------------------------------------------------
/src/main/resources/handlebars/Java/libraries/resttemplate/auth/Authentication.mustache:
--------------------------------------------------------------------------------
1 | package {{invokerPackage}}.auth;
2 |
3 | import org.springframework.http.HttpHeaders;
4 | import org.springframework.util.MultiValueMap;
5 |
6 | public interface Authentication {
7 | /**
8 | * Apply authentication settings to header and / or query parameters.
9 | * @param queryParams The query parameters for the request
10 | * @param headerParams The header parameters for the request
11 | */
12 | public void applyToParams(MultiValueMap queryParams, HttpHeaders headerParams);
13 | }
14 |
--------------------------------------------------------------------------------
/src/main/resources/handlebars/JavaJaxRS/pathParams.mustache:
--------------------------------------------------------------------------------
1 | {{~#is this 'path-param'}}{{#useOas2}}@ApiParam(value = "{{{description}}}"{{#required}},required=true{{/required}}{{#allowableValues}}, {{> allowableValues }}{{/allowableValues}}{{#defaultValue}}, defaultValue="{{{defaultValue}}}"{{/defaultValue}}) @PathParam("{{baseName}}") {{{dataType}}} {{paramName}}{{/useOas2}}{{^useOas2}}@Parameter(in = ParameterIn.PATH, description = "{{{description}}}"{{#required}},required=true{{/required}}{{#allowableValues}}, {{> allowableValues }}{{/allowableValues}}) @PathParam("{{baseName}}") {{{dataType}}} {{paramName}}{{/useOas2}}{{/is}}
--------------------------------------------------------------------------------
/src/main/resources/handlebars/Java/libraries/feign/ParamExpander.mustache:
--------------------------------------------------------------------------------
1 | package {{invokerPackage}};
2 |
3 | import feign.Param;
4 |
5 | import java.text.DateFormat;
6 | import java.util.Date;
7 |
8 | /**
9 | * Param Expander to convert {@link Date} to RFC3339
10 | */
11 | public class ParamExpander implements Param.Expander {
12 |
13 | private static final DateFormat dateformat = new RFC3339DateFormat();
14 |
15 | @Override
16 | public String expand(Object value) {
17 | if (value instanceof Date) {
18 | return dateformat.format(value);
19 | }
20 | return value.toString();
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/src/main/resources/handlebars/JavaJaxRS/cxf-cdi/headerParams.mustache:
--------------------------------------------------------------------------------
1 | {{#is this 'header-param'}}
2 | {{#useOas2}}@ApiParam(value = "{{{description}}}" {{#required}},required=true{{/required}}{{#allowableValues}}, {{> allowableValues }}{{/allowableValues}}{{#defaultValue}}, defaultValue="{{{defaultValue}}}"{{/defaultValue}})@HeaderParam("{{baseName}}") {{{dataType}}} {{paramName}}{{/useOas2}}
3 | {{^useOas2}}@Parameter(description = "{{{description}}}" {{#required}},required=true{{/required}}{{#allowableValues}}, {{> allowableValues }}{{/allowableValues}})@HeaderParam("{{baseName}}") {{{dataType}}} {{paramName}}{{/useOas2}}
4 | {{/is}}
--------------------------------------------------------------------------------
/src/main/resources/arguments/inflector.yaml:
--------------------------------------------------------------------------------
1 | arguments:
2 | - option: "--model-docs"
3 | description: "generate models documentation."
4 | type: "boolean"
5 | - option: "--api-docs"
6 | description: "generate apis documentation."
7 | type: "boolean"
8 | - option: "--model-tests"
9 | description: "generate model tests."
10 | type: "boolean"
11 | - option: "--api-tests"
12 | description: "generate apis tests."
13 | type: "boolean"
14 | - option: "--use-oas2"
15 | description: "use OpenAPI v2.0 (Swagger 1.5.x) annotations (by default, OpenAPI v3.0 is used)."
16 | type: "boolean"
17 |
--------------------------------------------------------------------------------
/src/main/resources/handlebars/pythonFlaskConnexion/__main__.mustache:
--------------------------------------------------------------------------------
1 | {{#supportPython2}}
2 | #!/usr/bin/env python
3 | {{/supportPython2}}
4 | {{^supportPython2}}
5 | #!/usr/bin/env python3
6 | {{/supportPython2}}
7 |
8 | import connexion
9 |
10 | from {{packageName}} import encoder
11 |
12 |
13 | def main():
14 | app = connexion.App(__name__, specification_dir='./swagger/')
15 | app.app.json_encoder = encoder.JSONEncoder
16 | app.add_api('swagger.yaml', arguments={'title': '{{appName}}'}, pythonic_params=True)
17 | app.run(port={{serverPort}})
18 |
19 |
20 | if __name__ == '__main__':
21 | main()
22 |
--------------------------------------------------------------------------------
/src/main/resources/handlebars/scala/client/client.mustache:
--------------------------------------------------------------------------------
1 | package {{invokerPackage}}
2 |
3 | {{#imports}}import {{import}}
4 | {{/imports}}
5 | import {{apiPackage}}._
6 |
7 | import com.wordnik.swagger.client._
8 |
9 | import java.io.Closeable
10 |
11 | class {{clientName}}(config: SwaggerConfig) extends Closeable {
12 | lazy val locator: ServiceLocator = config.locator
13 | lazy val name: String = config.name
14 |
15 | private[this] val client = transportClient
16 |
17 | protected def transportClient: TransportClient = new RestClient(config)
18 |
19 | def close() {
20 | client.close()
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/src/main/resources/handlebars/JavaJaxRS/resteasy/formParams.mustache:
--------------------------------------------------------------------------------
1 | {{#is this 'form-param'}}{{#isNot this 'binary'}}{{#useOas2}}@ApiParam(value = "{{{description}}}"{{#required}}, required=true{{/required}}{{#allowableValues}}, {{> allowableValues }}{{/allowableValues}}{{#defaultValue}}, defaultValue="{{{defaultValue}}}"{{/defaultValue}})@FormParam("{{baseName}}") {{{dataType}}} {{paramName}}{{/useOas2}}{{^useOas2}}@Parameter(description = "{{{description}}}"{{#required}}, required=true{{/required}}{{#allowableValues}}, {{> allowableValues }}{{/allowableValues}})@FormParam("{{baseName}}") {{{dataType}}} {{paramName}}{{/useOas2}}{{/isNot}}{{/is}}
--------------------------------------------------------------------------------
/src/main/resources/handlebars/csharp/packages_test.config.mustache:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/src/main/resources/handlebars/JavaJaxRS/headerParams.mustache:
--------------------------------------------------------------------------------
1 | {{#is this 'header-param'}}
2 | {{#useOas2}}@ApiParam(value = "{{{description}}}" {{#required}},required=true{{/required}}{{#allowableValues}}, {{> allowableValues }}{{/allowableValues}}{{#defaultValue}}, defaultValue="{{{defaultValue}}}"{{/defaultValue}})@HeaderParam("{{baseName}}") {{{dataType}}} {{paramName}}{{/useOas2}}
3 | {{^useOas2}}@Parameter(in = ParameterIn.HEADER, description = "{{{description}}}" {{#required}},required=true{{/required}}{{#allowableValues}}, {{> allowableValues }}{{/allowableValues}})@HeaderParam("{{baseName}}") {{{dataType}}} {{paramName}}{{/useOas2}}
4 | {{/is}}
--------------------------------------------------------------------------------
/src/main/resources/handlebars/JavaJaxRS/resteasy/eap/formParams.mustache:
--------------------------------------------------------------------------------
1 | {{#is this 'form-param'}}{{#isNot this 'binary'}}{{#useOas2}}@ApiParam(value = "{{{description}}}"{{#required}}, required=true{{/required}}{{#allowableValues}}, {{> allowableValues }}{{/allowableValues}}{{#defaultValue}}, defaultValue="{{{defaultValue}}}"{{/defaultValue}})@FormParam("{{baseName}}") {{{dataType}}} {{paramName}}{{/useOas2}}{{^useOas2}}@Parameter(description = "{{{description}}}"{{#required}}, required=true{{/required}}{{#allowableValues}}, {{> allowableValues }}{{/allowableValues}})@FormParam("{{baseName}}") {{{dataType}}} {{paramName}}{{/useOas2}}{{/isNot}}{{/is}}
--------------------------------------------------------------------------------
/src/main/resources/handlebars/JavaSpring/allowableValuesAndDefaultValue.mustache:
--------------------------------------------------------------------------------
1 | {{#useOas2}}{{#allowableValues}}, allowableValues = "{{#values}}{{{.}}}{{^@last}}, {{/@last}}{{#@last}}{{/@last}}{{/values}}"{{/allowableValues}}{{#defaultValue}}, defaultValue = "{{{defaultValue}}}"{{/defaultValue}}{{/useOas2}}{{^useOas2}}, schema=@Schema({{#allowableValues}}allowableValues={ {{#values}}"{{{.}}}"{{^@last}}, {{/@last}}{{/values}}{{^values}}{{/values}} }{{#min}}, minimum="{{.}}"{{/min}}{{#max}}, maximum="{{.}}"{{/max}}{{/allowableValues}}{{#defaultValue}}{{#allowableValues}}, {{/allowableValues}}defaultValue="{{{defaultValue}}}"{{/defaultValue}}){{/useOas2}}
--------------------------------------------------------------------------------
/bin/utils/detect_carriage_return.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 |
4 | # grep for \r in the templates
5 | grep -RUIl $'\r$' src/main/resources/*
6 |
7 | if [ $? -ne 1 ]; then
8 | echo "Templates contain carriage return '/r'. Please remove it and try again."
9 | exit 1;
10 | fi
11 |
12 |
13 | # grep for \r in the generators
14 | #grep -RUIl $'\r$' modules/swagger-codegen/src/main/java/io/swagger/codegen/v3/*.java
15 | find src/main/java/ -type f -iname "*.java" -exec grep -RUIl $'\r$' {} \; | wc -l
16 |
17 | if [ $? -ne 0 ]; then
18 | echo "Generators contain carriage return '/r'. Please remove it and try again."
19 | exit 1;
20 | fi
21 |
--------------------------------------------------------------------------------
/src/main/resources/handlebars/JavaSpring/libraries/spring-boot/homeController.mustache:
--------------------------------------------------------------------------------
1 | package {{configPackage}};
2 |
3 | import org.springframework.stereotype.Controller;
4 | import org.springframework.web.bind.annotation.RequestMapping;
5 |
6 | /**
7 | * Home redirection to swagger api documentation
8 | */
9 | @Controller
10 | public class HomeController {
11 | @RequestMapping(value = "/")
12 | public String index() {
13 | {{#useOas2}}
14 | return "redirect:swagger-ui.html";
15 | {{/useOas2}}
16 | {{^useOas2}}
17 | return "redirect:/swagger-ui/";
18 | {{/useOas2}}
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/src/main/resources/handlebars/R/element.mustache:
--------------------------------------------------------------------------------
1 | #' Element Class
2 | #'
3 | #' Element Class
4 | #' @export
5 | Element <- R6::R6Class(
6 | 'Element',
7 | public = list(
8 | id = NULL,
9 | name = NULL,
10 | initialize = function(id,name){
11 | if (!missing(id)) {
12 | stopifnot(is.numeric(id), length(id) == 1)
13 | self$id <- id
14 | }
15 | if (!missing(name)) {
16 | stopifnot(is.character(name), length(name) == 1)
17 | self$name <- name
18 | }
19 | },
20 | toJSON = function() {
21 | sprintf('{"id":%d,"name":"%s"}', self$id, self$name)
22 | }
23 | )
24 | )
--------------------------------------------------------------------------------
/src/main/resources/handlebars/kotlin-client/infrastructure/Serializer.kt.mustache:
--------------------------------------------------------------------------------
1 | package {{packageName}}.infrastructure
2 |
3 | import com.squareup.moshi.Moshi
4 | import com.squareup.moshi.adapters.Rfc3339DateJsonAdapter
5 | import com.squareup.moshi.kotlin.reflect.KotlinJsonAdapterFactory
6 | import java.util.Date
7 |
8 | object Serializer {
9 | @JvmStatic
10 | val moshi: Moshi = Moshi.Builder()
11 | .add(KotlinJsonAdapterFactory())
12 | .add(Date::class.java, Rfc3339DateJsonAdapter().nullSafe())
13 | .add(LocalDateTimeAdapter())
14 | .add(LocalDateAdapter())
15 | .build()
16 | }
--------------------------------------------------------------------------------
/src/main/resources/handlebars/nodejs/package.mustache:
--------------------------------------------------------------------------------
1 | {
2 | "name": "{{projectName}}",
3 | "version": "{{appVersion}}",
4 | "description": "{{{appDescription}}}",
5 | "main": "index.js",
6 | {{^googleCloudFunctions}}
7 | "scripts": {
8 | "prestart": "npm install",
9 | "start": "node index.js"
10 | },
11 | {{/googleCloudFunctions}}
12 | "keywords": [
13 | "swagger"
14 | ],
15 | "license": "Unlicense",
16 | "private": true,
17 | "dependencies": {
18 | {{^googleCloudFunctions}}
19 | "connect": "^3.2.0",
20 | {{/googleCloudFunctions}}
21 | "js-yaml": "^3.3.0",
22 | "oas3-tools": "^2.2.3"
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/src/main/resources/handlebars/aspnetcore/web.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/src/main/resources/handlebars/csharp-471/ExceptionFactory.mustache:
--------------------------------------------------------------------------------
1 | {{>partial_header}}
2 |
3 | using System;
4 | {{#netStandard}}
5 | using RestSharp.Portable;
6 | {{/netStandard}}
7 | {{^netStandard}}
8 | using RestSharp;
9 | {{/netStandard}}
10 |
11 | namespace {{packageName}}.Client
12 | {
13 | ///
14 | /// A delegate to ExceptionFactory method
15 | ///
16 | /// Method name
17 | /// Response
18 | /// Exceptions
19 | {{>visibility}} delegate Exception ExceptionFactory(string methodName, RestResponse response);
20 | }
21 |
--------------------------------------------------------------------------------
/src/main/resources/handlebars/csharp/ExceptionFactory.mustache:
--------------------------------------------------------------------------------
1 | {{>partial_header}}
2 |
3 | using System;
4 | {{#netStandard}}
5 | using RestSharp.Portable;
6 | {{/netStandard}}
7 | {{^netStandard}}
8 | using RestSharp;
9 | {{/netStandard}}
10 |
11 | namespace {{packageName}}.Client
12 | {
13 | ///
14 | /// A delegate to ExceptionFactory method
15 | ///
16 | /// Method name
17 | /// Response
18 | /// Exceptions
19 | {{>visibility}} delegate Exception ExceptionFactory(string methodName, IRestResponse response);
20 | }
21 |
--------------------------------------------------------------------------------
/src/main/resources/handlebars/ruby/partial_model_enum_class.mustache:
--------------------------------------------------------------------------------
1 | class {{classname}}
2 | {{#allowableValues}}
3 | {{#enumVars}}
4 | {{{name}}} = {{{value}}}.freeze
5 | {{/enumVars}}
6 | {{/allowableValues}}
7 |
8 | # Builds the enum from string
9 | # @param [String] The enum value in the form of the string
10 | # @return [String] The enum value
11 | def build_from_hash(value)
12 | constantValues = {{classname}}.constants.select { |c| {{classname}}::const_get(c) == value }
13 | raise "Invalid ENUM value #{value} for class #{{{classname}}}" if constantValues.empty?
14 | value
15 | end
16 | end
--------------------------------------------------------------------------------
/src/main/resources/handlebars/JavaInflector/model.mustache:
--------------------------------------------------------------------------------
1 | package {{package}};
2 | {{^x-is-composed-model}}
3 | import java.util.Objects;
4 | {{#imports}}import {{import}};
5 | {{/imports}}
6 |
7 | {{#serializableModel}}import java.io.Serializable;{{/serializableModel}}
8 | {{/x-is-composed-model}}
9 | {{#models}}
10 | {{#model}}
11 | {{#description}}
12 | /**
13 | * {{description}}
14 | **/
15 | {{/description}}
16 | {{#isComposedModel}}
17 | {{>interface}}
18 | {{/isComposedModel}}
19 | {{^isComposedModel}}
20 | {{#is this 'enum'}}
21 | {{>enumOuterClass}}
22 | {{/is}}
23 | {{#isNot this 'enum'}}{{>pojo}}{{/isNot}}
24 | {{/isComposedModel}}
25 | {{/model}}
26 | {{/models}}
27 |
--------------------------------------------------------------------------------
/src/main/resources/handlebars/JavaJaxRS/cxf-cdi/pathParams.mustache:
--------------------------------------------------------------------------------
1 | {{#is this 'path-param'}}{{#useBeanValidation}}{{>beanValidationPathParams}}{{/useBeanValidation}}
2 | {{#useOas2}}@ApiParam(value = "{{{description}}}"{{#required}},required=true{{/required}}{{#allowableValues}}, {{> allowableValues }}{{/allowableValues}}{{#defaultValue}}, defaultValue="{{{defaultValue}}}"{{/defaultValue}}) @PathParam("{{baseName}}") {{{dataType}}} {{paramName}}{{/useOas2}}
3 | {{^useOas2}}@Parameter(description = "{{{description}}}"{{#required}},required=true{{/required}}{{#allowableValues}}, {{> allowableValues }}{{/allowableValues}}) @PathParam("{{baseName}}") {{{dataType}}} {{paramName}}{{/useOas2}}
4 | {{/is}}
--------------------------------------------------------------------------------
/src/main/resources/handlebars/kotlin-client/infrastructure/RequestConfig.kt.mustache:
--------------------------------------------------------------------------------
1 | package {{packageName}}.infrastructure
2 |
3 | /**
4 | * Defines a config object for a given request.
5 | * NOTE: This object doesn't include 'body' because it
6 | * allows for caching of the constructed object
7 | * for many request definitions.
8 | * NOTE: Headers is a Map because rfc2616 defines
9 | * multi-valued headers as csv-only.
10 | */
11 | data class RequestConfig(
12 | val method: RequestMethod,
13 | val path: String,
14 | val headers: Map = mapOf(),
15 | val query: Map> = mapOf()
16 | )
--------------------------------------------------------------------------------
/src/main/resources/handlebars/JavaJaxRS/resteasy/web.mustache:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
7 | ApiOriginFilter
8 | {{apiPackage}}.ApiOriginFilter
9 |
10 |
11 | ApiOriginFilter
12 | /*
13 |
14 |
15 |
--------------------------------------------------------------------------------
/src/main/resources/handlebars/JavaJaxRS/RFC3339DateFormat.mustache:
--------------------------------------------------------------------------------
1 | package {{apiPackage}};
2 |
3 | import com.fasterxml.jackson.databind.util.ISO8601DateFormat;
4 | import com.fasterxml.jackson.databind.util.ISO8601Utils;
5 |
6 | import java.text.FieldPosition;
7 | import java.util.Date;
8 |
9 | public class RFC3339DateFormat extends ISO8601DateFormat {
10 |
11 | // Same as ISO8601DateFormat but serializing milliseconds.
12 | @Override
13 | public StringBuffer format(Date date, StringBuffer toAppendTo, FieldPosition fieldPosition) {
14 | String value = ISO8601Utils.format(date, true);
15 | toAppendTo.append(value);
16 | return toAppendTo;
17 | }
18 |
19 | }
--------------------------------------------------------------------------------
/src/main/resources/handlebars/JavaSpring/application.mustache:
--------------------------------------------------------------------------------
1 | {{#useOas2}}
2 | springfox.documentation.swagger.v2.path=/api-docs
3 | server.contextPath={{^contextPathWithoutHost}}/{{/contextPathWithoutHost}}{{#contextPathWithoutHost}}{{contextPathWithoutHost}}{{/contextPathWithoutHost}}
4 | {{/useOas2}}
5 | {{^useOas2}}
6 | springdoc.api-docs.path=/api-docs
7 | {{/useOas2}}
8 | server.servlet.contextPath={{^contextPathWithoutHost}}/{{/contextPathWithoutHost}}{{#contextPathWithoutHost}}{{contextPathWithoutHost}}{{/contextPathWithoutHost}}
9 | server.port={{serverPort}}
10 | spring.jackson.date-format={{basePackage}}.RFC3339DateFormat
11 | spring.jackson.serialization.WRITE_DATES_AS_TIMESTAMPS=false
--------------------------------------------------------------------------------
/src/main/resources/handlebars/php/model_enum.mustache:
--------------------------------------------------------------------------------
1 | class {{classname}}
2 | {
3 | /**
4 | * Possible values of this enum
5 | */
6 | {{#allowableValues}}
7 | {{#enumVars}}
8 | const {{{name}}} = {{{value}}};
9 | {{/enumVars}}
10 | {{/allowableValues}}
11 | /**
12 | * Gets allowable values of the enum
13 | * @return string[]
14 | */
15 | public static function getAllowableEnumValues()
16 | {
17 | return [
18 | {{#allowableValues}}
19 | {{#enumVars}}
20 | self::{{{name}}}{{#hasMore}},{{/hasMore}}
21 | {{/enumVars}}
22 | {{/allowableValues}}
23 | ];
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/src/main/resources/handlebars/Java/RFC3339DateFormat.mustache:
--------------------------------------------------------------------------------
1 | {{>licenseInfo}}
2 | package {{invokerPackage}};
3 |
4 | import com.fasterxml.jackson.databind.util.ISO8601DateFormat;
5 | import com.fasterxml.jackson.databind.util.ISO8601Utils;
6 |
7 | import java.text.FieldPosition;
8 | import java.util.Date;
9 |
10 |
11 | public class RFC3339DateFormat extends ISO8601DateFormat {
12 |
13 | // Same as ISO8601DateFormat but serializing milliseconds.
14 | @Override
15 | public StringBuffer format(Date date, StringBuffer toAppendTo, FieldPosition fieldPosition) {
16 | String value = ISO8601Utils.format(date, true);
17 | toAppendTo.append(value);
18 | return toAppendTo;
19 | }
20 |
21 | }
--------------------------------------------------------------------------------
/src/main/resources/handlebars/JavaJaxRS/cxf/model.mustache:
--------------------------------------------------------------------------------
1 | package {{package}};
2 |
3 | {{^isComposedModel}}
4 | {{#imports}}import {{import}};
5 | {{/imports}}
6 | {{#useBeanValidation}}
7 | {{#jakarta}}
8 | import jakarta.validation.constraints.*;
9 | {{/jakarta}}
10 | {{^jakarta}}
11 | import javax.validation.constraints.*;
12 | {{/jakarta}}
13 | {{/useBeanValidation}}
14 | {{/isComposedModel}}
15 |
16 | {{#models}}
17 | {{#model}}
18 | {{#isComposedModel}}
19 | {{>interface}}
20 | {{/isComposedModel}}
21 | {{^isComposedModel}}
22 | {{#is this 'enum'}}
23 | {{>enumOuterClass}}
24 | {{/is}}
25 | {{#isNot this 'enum'}}
26 | {{>pojo}}
27 | {{/isNot}}
28 | {{/isComposedModel}}
29 | {{/model}}
30 | {{/models}}
31 |
--------------------------------------------------------------------------------
/src/main/resources/handlebars/JavaJaxRS/resteasy/RFC3339DateFormat.mustache:
--------------------------------------------------------------------------------
1 | package {{invokerPackage}};
2 |
3 | import com.fasterxml.jackson.databind.util.ISO8601DateFormat;
4 | import com.fasterxml.jackson.databind.util.ISO8601Utils;
5 |
6 | import java.text.FieldPosition;
7 | import java.util.Date;
8 |
9 | public class RFC3339DateFormat extends ISO8601DateFormat {
10 |
11 | // Same as ISO8601DateFormat but serializing milliseconds.
12 | @Override
13 | public StringBuffer format(Date date, StringBuffer toAppendTo, FieldPosition fieldPosition) {
14 | String value = ISO8601Utils.format(date, true);
15 | toAppendTo.append(value);
16 | return toAppendTo;
17 | }
18 |
19 | }
--------------------------------------------------------------------------------
/src/main/resources/handlebars/kotlin-server/libraries/ktor/_api_body.mustache:
--------------------------------------------------------------------------------
1 | {{#hasAuthMethods}}
2 | {{>libraries/ktor/_principal}}
3 | if (principal == null) {
4 | call.respond(HttpStatusCode.Unauthorized)
5 | } else {
6 | {{#examples}}
7 | {{#@first}}
8 | {{>libraries/ktor/_response}}
9 | {{/@first}}
10 | {{/examples}}
11 | {{^examples}}
12 | call.respond(HttpStatusCode.NotImplemented)
13 | {{/examples}}
14 | }
15 | {{/hasAuthMethods}}
16 | {{^hasAuthMethods}}
17 | {{#examples}}
18 | {{#@first}}
19 | {{>libraries/ktor/_response}}
20 | {{/@first}}
21 | {{/examples}}
22 | {{^examples}}
23 | call.respond(HttpStatusCode.NotImplemented)
24 | {{/examples}}
25 | {{/hasAuthMethods}}
--------------------------------------------------------------------------------
/src/main/resources/handlebars/kotlin-server/libraries/ktor/application.conf.mustache:
--------------------------------------------------------------------------------
1 | ktor {
2 | deployment {
3 | environment = development
4 | port = 8080
5 | autoreload = true
6 | watch = [ {{packageName}} ]
7 | }
8 |
9 | application {
10 | modules = [ {{packageName}}.AppMainKt.main ]
11 | }
12 | }
13 |
14 | # Typesafe config allows multiple ways to provide configuration values without hard-coding them here.
15 | # Please see https://github.com/lightbend/config for details.
16 | auth {
17 | oauth {
18 | {{#authMethods}}
19 | {{#isOAuth}}
20 | {{name}} {
21 | clientId = ""
22 | clientSecret = ""
23 | }
24 | {{/isOAuth}}
25 | {{/authMethods}}
26 | }
27 | }
--------------------------------------------------------------------------------
/src/main/resources/handlebars/JavaSpring/NotUndefined.mustache:
--------------------------------------------------------------------------------
1 | package {{configPackage}};
2 |
3 | {{#jakarta}}
4 | import jakarta.validation.Constraint;
5 | import jakarta.validation.Payload;
6 | {{/jakarta}}
7 | {{^jakarta}}
8 | import javax.validation.Constraint;
9 | import javax.validation.Payload;
10 | {{/jakarta}}
11 | import java.lang.annotation.*;
12 |
13 | @Target({ElementType.TYPE})
14 | @Retention(RetentionPolicy.RUNTIME)
15 | @Documented
16 | @Constraint(validatedBy = NotUndefinedValidator.class)
17 | public @interface NotUndefined {
18 | String message() default "field cannot be undefined";
19 | Class>[] groups() default {};
20 | Class extends Payload>[] payload() default {};
21 | }
22 |
--------------------------------------------------------------------------------
/src/main/resources/handlebars/scala/akka-http-server/model.mustache:
--------------------------------------------------------------------------------
1 | package {{package}}
2 |
3 | {{#imports}}
4 | import {{import}}
5 | {{/imports}}
6 |
7 | {{#models}}
8 | {{#model}}
9 | /**
10 | {{#title}} * = {{{title}}} =
11 | *
12 | {{/title}}
13 | {{#description}} * {{{description}}}
14 | *
15 | {{/description}}
16 | {{#vars}}
17 | * @param {{{name}}} {{#description}}{{{description}}}{{/description}}{{#example}} for example: ''{{{example}}}''{{/example}}
18 | {{/vars}}
19 | */
20 | case class {{classname}} (
21 | {{#vars}}
22 | {{{name}}}: {{^required}}Option[{{/required}}{{datatype}}{{^required}}]{{/required}}{{#hasMore}},{{/hasMore}}
23 | {{/vars}}
24 | )
25 |
26 | {{/model}}
27 | {{/models}}
28 |
--------------------------------------------------------------------------------
/src/main/resources/handlebars/dart/apilib.mustache:
--------------------------------------------------------------------------------
1 | library {{pubName}}.api;
2 |
3 | import 'dart:async';
4 | import 'dart:convert';{{#browserClient}}
5 | import 'package:http/browser_client.dart';{{/browserClient}}
6 | import 'package:http/http.dart';
7 |
8 | part 'api_client.dart';
9 | part 'api_helper.dart';
10 | part 'api_exception.dart';
11 | part 'auth/authentication.dart';
12 | part 'auth/api_key_auth.dart';
13 | part 'auth/oauth.dart';
14 | part 'auth/http_basic_auth.dart';
15 |
16 | {{#apiInfo}}{{#apis}}part 'api/{{classFilename}}.dart';
17 | {{/apis}}{{/apiInfo}}
18 | {{#models}}{{#model}}part 'model/{{classFilename}}.dart';
19 | {{/model}}{{/models}}
20 |
21 | ApiClient defaultApiClient = new ApiClient();
22 |
--------------------------------------------------------------------------------
/src/main/java/io/swagger/codegen/v3/generators/features/SpringFeatures.java:
--------------------------------------------------------------------------------
1 | package io.swagger.codegen.v3.generators.features;
2 |
3 | public interface SpringFeatures extends BeanValidationFeatures {
4 |
5 | String GENERATE_SPRING_APPLICATION = "generateSpringApplication";
6 |
7 | String GENERATE_SPRING_BOOT_APPLICATION = "generateSpringBootApplication";
8 |
9 | String USE_SPRING_ANNOTATION_CONFIG = "useSpringAnnotationConfig";
10 |
11 | void setGenerateSpringApplication(boolean useGenerateSpringApplication);
12 |
13 | void setGenerateSpringBootApplication(boolean generateSpringBootApplication);
14 |
15 | void setUseSpringAnnotationConfig(boolean useSpringAnnotationConfig);
16 |
17 |
18 | }
19 |
--------------------------------------------------------------------------------
/src/main/resources/handlebars/typescript-fetch/modelAlias.mustache:
--------------------------------------------------------------------------------
1 | /**
2 | * {{{description}}}
3 | * @export
4 | */
5 | export type {{classname}} = {{#parent}}{{{parent}}}{{/parent}}{{^parent}}{{{dataType}}}{{/parent}}{{#hasEnums}}
6 |
7 | /**
8 | * @export
9 | * @namespace {{classname}}
10 | */
11 | export namespace {{classname}} {
12 | {{#vars}}
13 | {{#isEnum}}
14 | /**
15 | * @export
16 | * @enum {string}
17 | */
18 | export enum {{enumName}} {
19 | {{#allowableValues}}
20 | {{#enumVars}}
21 | {{{name}}} = {{{value}}}{{^@last}},{{/@last}}
22 | {{/enumVars}}
23 | {{/allowableValues}}
24 | }
25 | {{/isEnum}}
26 | {{/vars}}
27 | }{{/hasEnums}}
28 |
--------------------------------------------------------------------------------