From 33c68487b1c80ca73f918a64ff98d7eb593915d7 Mon Sep 17 00:00:00 2001 From: wing328 Date: Thu, 13 Feb 2020 20:36:56 +0000 Subject: [PATCH] Deploy website version based on 346cfc62f3f1a4d4964f85baab1939a49ee9c20f --- 03abeb31.12f495f9.js | 1 + 03abeb31.37322d4d.js | 1 - 0cae4475.6201276e.js | 1 + 0cae4475.c6f8648e.js | 1 - 10211c0a.8bbaf167.js | 1 + 10211c0a.ccd9c59b.js | 1 - 1777f326.32a18bc0.js | 1 - 1777f326.8c5295f1.js | 1 + 342fbc7e.51c07a64.js | 1 - 342fbc7e.a741014c.js | 1 + 404.html | 2 +- 7eeb204a.5c285426.js | 1 - 7eeb204a.84095b24.js | 1 + 838bab07.5dced905.js | 1 - 838bab07.766e1507.js | 1 + 9972b359.af569423.js | 1 - 9972b359.e3e46d50.js | 1 + 9b517c7f.1811e6b6.js | 1 + 9b517c7f.c5afed65.js | 1 - 9cbcc25e.194c5467.js | 1 + 9cbcc25e.28a04cad.js | 1 - ac8b7f2e.80cc92ad.js | 1 - ac8b7f2e.f127e4ec.js | 1 + blog/2018/12/24/new-website/index.html | 2 +- blog/index.html | 2 +- d9b8b8b3.59a976fe.js | 1 - d9b8b8b3.741bcd20.js | 1 + docs/code-of-conduct/index.html | 6 +++--- docs/contribute-building/index.html | 6 +++--- docs/contributing/index.html | 6 +++--- docs/core-team/index.html | 6 +++--- docs/customization/index.html | 2 +- docs/debugging/index.html | 6 +++--- docs/faq-contributing/index.html | 2 +- docs/faq-extending/index.html | 2 +- docs/faq-generators/index.html | 2 +- docs/faq/index.html | 2 +- docs/fork-qna/index.html | 2 +- docs/generators/README/index.html | 6 +++--- docs/generators/ada-server/index.html | 2 +- docs/generators/ada/index.html | 2 +- docs/generators/android/index.html | 2 +- docs/generators/apache2/index.html | 2 +- docs/generators/apex/index.html | 2 +- docs/generators/asciidoc/index.html | 2 +- docs/generators/aspnetcore/index.html | 2 +- docs/generators/avro-schema/index.html | 2 +- docs/generators/bash/index.html | 2 +- docs/generators/c/index.html | 2 +- docs/generators/clojure/index.html | 2 +- docs/generators/cpp-pistache-server/index.html | 2 +- docs/generators/cpp-qt5-client/index.html | 2 +- docs/generators/cpp-qt5-qhttpengine-server/index.html | 2 +- docs/generators/cpp-restbed-server/index.html | 2 +- docs/generators/cpp-restsdk/index.html | 2 +- docs/generators/cpp-tizen/index.html | 2 +- docs/generators/csharp-dotnet2/index.html | 2 +- docs/generators/csharp-nancyfx/index.html | 2 +- docs/generators/csharp-netcore/index.html | 2 +- docs/generators/csharp/index.html | 2 +- docs/generators/cwiki/index.html | 2 +- docs/generators/dart-dio/index.html | 2 +- docs/generators/dart-jaguar/index.html | 2 +- docs/generators/dart/index.html | 2 +- docs/generators/dynamic-html/index.html | 2 +- docs/generators/eiffel/index.html | 2 +- docs/generators/elixir/index.html | 2 +- docs/generators/elm/index.html | 2 +- docs/generators/erlang-client/index.html | 2 +- docs/generators/erlang-proper/index.html | 2 +- docs/generators/erlang-server/index.html | 2 +- docs/generators/flash/index.html | 2 +- docs/generators/fsharp-functions/index.html | 2 +- docs/generators/fsharp-giraffe-server/index.html | 2 +- docs/generators/go-experimental/index.html | 2 +- docs/generators/go-gin-server/index.html | 2 +- docs/generators/go-server/index.html | 2 +- docs/generators/go/index.html | 2 +- docs/generators/graphql-nodejs-express-server/index.html | 2 +- docs/generators/graphql-schema/index.html | 2 +- docs/generators/groovy/index.html | 2 +- docs/generators/haskell-http-client/index.html | 2 +- docs/generators/haskell/index.html | 2 +- docs/generators/html/index.html | 2 +- docs/generators/html2/index.html | 2 +- docs/generators/index.html | 6 +++--- docs/generators/java-inflector/index.html | 2 +- docs/generators/java-msf4j/index.html | 2 +- docs/generators/java-pkmst/index.html | 2 +- docs/generators/java-play-framework/index.html | 2 +- docs/generators/java-undertow-server/index.html | 2 +- docs/generators/java-vertx-web/index.html | 2 +- docs/generators/java-vertx/index.html | 2 +- docs/generators/java/index.html | 2 +- docs/generators/javascript-closure-angular/index.html | 2 +- docs/generators/javascript-flowtyped/index.html | 2 +- docs/generators/javascript/index.html | 2 +- docs/generators/jaxrs-cxf-cdi/index.html | 2 +- docs/generators/jaxrs-cxf-client/index.html | 2 +- docs/generators/jaxrs-cxf-extended/index.html | 2 +- docs/generators/jaxrs-cxf/index.html | 2 +- docs/generators/jaxrs-jersey/index.html | 2 +- docs/generators/jaxrs-resteasy-eap/index.html | 2 +- docs/generators/jaxrs-resteasy/index.html | 2 +- docs/generators/jaxrs-spec/index.html | 2 +- docs/generators/jmeter/index.html | 2 +- docs/generators/kotlin-server/index.html | 2 +- docs/generators/kotlin-spring/index.html | 2 +- docs/generators/kotlin-vertx/index.html | 2 +- docs/generators/kotlin/index.html | 2 +- docs/generators/lua/index.html | 2 +- docs/generators/markdown/index.html | 2 +- docs/generators/mysql-schema/index.html | 2 +- docs/generators/nim/index.html | 2 +- docs/generators/nodejs-express-server/index.html | 2 +- docs/generators/nodejs-server-deprecated/index.html | 2 +- docs/generators/objc/index.html | 2 +- docs/generators/ocaml/index.html | 2 +- docs/generators/openapi-yaml/index.html | 2 +- docs/generators/openapi/index.html | 2 +- docs/generators/perl/index.html | 2 +- docs/generators/php-laravel/index.html | 2 +- docs/generators/php-lumen/index.html | 2 +- docs/generators/php-silex/index.html | 2 +- docs/generators/php-slim-deprecated/index.html | 2 +- docs/generators/php-slim4/index.html | 2 +- docs/generators/php-symfony/index.html | 2 +- docs/generators/php-ze-ph/index.html | 2 +- docs/generators/php/index.html | 2 +- docs/generators/powershell/index.html | 2 +- docs/generators/protobuf-schema/index.html | 2 +- docs/generators/python-aiohttp/index.html | 2 +- docs/generators/python-blueplanet/index.html | 2 +- docs/generators/python-experimental/index.html | 2 +- docs/generators/python-flask/index.html | 2 +- docs/generators/python/index.html | 2 +- docs/generators/r/index.html | 2 +- docs/generators/ruby-on-rails/index.html | 2 +- docs/generators/ruby-sinatra/index.html | 2 +- docs/generators/ruby/index.html | 2 +- docs/generators/rust-server/index.html | 2 +- docs/generators/rust/index.html | 2 +- docs/generators/scala-akka/index.html | 2 +- docs/generators/scala-finch/index.html | 2 +- docs/generators/scala-gatling/index.html | 2 +- docs/generators/scala-httpclient-deprecated/index.html | 2 +- docs/generators/scala-lagom-server/index.html | 2 +- docs/generators/scala-play-server/index.html | 2 +- docs/generators/scalatra/index.html | 2 +- docs/generators/scalaz/index.html | 2 +- docs/generators/spring/index.html | 2 +- docs/generators/swift2-deprecated/index.html | 2 +- docs/generators/swift3-deprecated/index.html | 2 +- docs/generators/swift4/index.html | 2 +- docs/generators/swift5/index.html | 2 +- docs/generators/typescript-angular/index.html | 2 +- docs/generators/typescript-angularjs/index.html | 2 +- docs/generators/typescript-aurelia/index.html | 2 +- docs/generators/typescript-axios/index.html | 2 +- docs/generators/typescript-fetch/index.html | 2 +- docs/generators/typescript-inversify/index.html | 2 +- docs/generators/typescript-jquery/index.html | 2 +- docs/generators/typescript-node/index.html | 2 +- docs/generators/typescript-redux-query/index.html | 2 +- docs/generators/typescript-rxjs/index.html | 2 +- docs/installation/index.html | 2 +- docs/integrations/index.html | 6 +++--- docs/new-generator/index.html | 6 +++--- docs/online/index.html | 6 +++--- docs/plugins/index.html | 6 +++--- docs/release-3-0-0/index.html | 2 +- docs/release-summary/index.html | 6 +++--- docs/roadmap/index.html | 6 +++--- docs/spec-info/index.html | 6 +++--- docs/swagger-codegen-migration/index.html | 6 +++--- docs/templating/index.html | 2 +- docs/usage/index.html | 2 +- e360e27f.90bd5915.js | 1 - e360e27f.fcaa36ac.js | 1 + ecfe08ed.09b92d9a.js | 1 - ecfe08ed.6ed7e62c.js | 1 + f70cb32f.163e337f.js | 1 + f70cb32f.e6b60417.js | 1 - index.html | 2 +- runtime~main.7b72ee12.js => runtime~main.5cdf8e0c.js | 2 +- team/index.html | 2 +- users.html | 2 +- users/index.html | 2 +- 188 files changed, 203 insertions(+), 203 deletions(-) create mode 100644 03abeb31.12f495f9.js delete mode 100644 03abeb31.37322d4d.js create mode 100644 0cae4475.6201276e.js delete mode 100644 0cae4475.c6f8648e.js create mode 100644 10211c0a.8bbaf167.js delete mode 100644 10211c0a.ccd9c59b.js delete mode 100644 1777f326.32a18bc0.js create mode 100644 1777f326.8c5295f1.js delete mode 100644 342fbc7e.51c07a64.js create mode 100644 342fbc7e.a741014c.js delete mode 100644 7eeb204a.5c285426.js create mode 100644 7eeb204a.84095b24.js delete mode 100644 838bab07.5dced905.js create mode 100644 838bab07.766e1507.js delete mode 100644 9972b359.af569423.js create mode 100644 9972b359.e3e46d50.js create mode 100644 9b517c7f.1811e6b6.js delete mode 100644 9b517c7f.c5afed65.js create mode 100644 9cbcc25e.194c5467.js delete mode 100644 9cbcc25e.28a04cad.js delete mode 100644 ac8b7f2e.80cc92ad.js create mode 100644 ac8b7f2e.f127e4ec.js delete mode 100644 d9b8b8b3.59a976fe.js create mode 100644 d9b8b8b3.741bcd20.js delete mode 100644 e360e27f.90bd5915.js create mode 100644 e360e27f.fcaa36ac.js delete mode 100644 ecfe08ed.09b92d9a.js create mode 100644 ecfe08ed.6ed7e62c.js create mode 100644 f70cb32f.163e337f.js delete mode 100644 f70cb32f.e6b60417.js rename runtime~main.7b72ee12.js => runtime~main.5cdf8e0c.js (91%) diff --git a/03abeb31.12f495f9.js b/03abeb31.12f495f9.js new file mode 100644 index 00000000000..f8bf97dd5f3 --- /dev/null +++ b/03abeb31.12f495f9.js @@ -0,0 +1 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[5],{129:function(e,t,n){"use strict";n.r(t),n.d(t,"frontMatter",(function(){return i})),n.d(t,"metadata",(function(){return l})),n.d(t,"rightToc",(function(){return c})),n.d(t,"default",(function(){return p}));var r=n(1),o=n(9),a=(n(0),n(293)),i={id:"debugging",title:"Debugging"},l={id:"debugging",title:"Debugging",description:"## Templates",source:"@site/../docs/debugging.md",permalink:"/docs/debugging",editUrl:"https://github.com/OpenAPITools/openapi-generator/edit/master/website/../docs/debugging.md",lastUpdatedBy:"Akihito Nakano",lastUpdatedAt:1580871678,sidebar:"docs",previous:{title:"Customization",permalink:"/docs/customization"},next:{title:"Workflow Integrations",permalink:"/docs/integrations"}},c=[{value:"Templates",id:"templates",children:[]},{value:"Runtime",id:"runtime",children:[]},{value:"Logs",id:"logs",children:[]}],b={rightToc:c};function p(e){var t=e.components,n=Object(o.a)(e,["components"]);return Object(a.b)("wrapper",Object(r.a)({},b,n,{components:t,mdxType:"MDXLayout"}),Object(a.b)("h2",{id:"templates"},"Templates"),Object(a.b)("p",null,"Sometimes, you may have issues with variables in your templates. As discussed in the ",Object(a.b)("a",Object(r.a)({parentName:"p"},{href:"/docs/templating"}),"templating")," docs, we offer a variety of system properties for inspecting the models bound to templates."),Object(a.b)("dl",null,Object(a.b)("dt",null,Object(a.b)("code",null,"-DdebugOpenAPI")),Object(a.b)("dd",null,"Prints out the JSON model of the OpenAPI Document, as seen by OpenAPI Generator"),Object(a.b)("dt",null,Object(a.b)("code",null,"-DdebugModels")),Object(a.b)("dd",null,"Prints out the JSON model passed to model templates"),Object(a.b)("dt",null,Object(a.b)("code",null,"-DdebugOperations")),Object(a.b)("dd",null,"Prints out the JSON model passed to operation (api) templates"),Object(a.b)("dt",null,Object(a.b)("code",null,"-DdebugSupportingFiles")),Object(a.b)("dd",null,"Prints out the JSON model passed to supporting files")),Object(a.b)("p",null,"One or more of these properties can be passed alongside other command line options:"),Object(a.b)("pre",null,Object(a.b)("code",Object(r.a)({parentName:"pre"},{className:"language-bash"}),"openapi-generator generate -g go \\\n -o out \\\n -i petstore-minimal.yaml \\\n -DdebugModels \\\n -DdebugOperations\n")),Object(a.b)("p",null,"Or you can add these to your ",Object(a.b)("inlineCode",{parentName:"p"},"JAVA_OPTS")," environment variable (this applies to every invocation of the tool):"),Object(a.b)("pre",null,Object(a.b)("code",Object(r.a)({parentName:"pre"},{className:"language-bash"}),'export JAVA_OPTS="${JAVA_OPTS} -DdebugModels -DdebugOperations"\n')),Object(a.b)("blockquote",null,Object(a.b)("p",{parentName:"blockquote"},"NOTE: Globally available system options like these will apply to all invocations of the generator (CLI and plugins)")),Object(a.b)("h2",{id:"runtime"},"Runtime"),Object(a.b)("p",null,"When you're working with a custom generator, a new generator, or otherwise trying to understand the behavior of the toolset, you may need to attach a remote debugger in order to step through the code."),Object(a.b)("p",null,"The steps are shown here for a specific version of the generator, but apply the same if you're working off master or a feature branch."),Object(a.b)("ul",null,Object(a.b)("li",{parentName:"ul"},"Determine the version of ",Object(a.b)("inlineCode",{parentName:"li"},"openapi-generator")," you're using. For the CLI, this is: ",Object(a.b)("pre",{parentName:"li"},Object(a.b)("code",Object(r.a)({parentName:"pre"},{}),"openapi-generator version\n"))),Object(a.b)("li",{parentName:"ul"},"Navigate to the ",Object(a.b)("inlineCode",{parentName:"li"},"openapi-generator")," source directory (see ",Object(a.b)("a",Object(r.a)({parentName:"li"},{href:"/docs/contribute-building"}),"building")," docs for obtaining source code and brief introduction)."),Object(a.b)("li",{parentName:"ul"},"Checkout the branch/tag for the target version. Branches are not prefixed, but tags are prefixed with a ",Object(a.b)("inlineCode",{parentName:"li"},"v"),". For instance if you're using version ",Object(a.b)("inlineCode",{parentName:"li"},"3.3.0"),", you will execute:",Object(a.b)("pre",{parentName:"li"},Object(a.b)("code",Object(r.a)({parentName:"pre"},{}),"git checkout v3.3.0\n"))),Object(a.b)("li",{parentName:"ul"},"Open the project in your IDE."),Object(a.b)("li",{parentName:"ul"},"Setup your IDE for remote debugging. You'll want to define a port used for connecting the remote debugger. For this example, we'll use ",Object(a.b)("inlineCode",{parentName:"li"},"5005"),". See external tutorials for ",Object(a.b)("a",Object(r.a)({parentName:"li"},{href:"https://www.jetbrains.com/help/idea/run-debug-configuration-remote-debug.html"}),"IntelliJ")," and ",Object(a.b)("a",Object(r.a)({parentName:"li"},{href:"https://www.ibm.com/developerworks/library/os-eclipse-javadebug/index.html"}),"Eclipse")),Object(a.b)("li",{parentName:"ul"},"Export the debug configuration, specifying ",Object(a.b)("inlineCode",{parentName:"li"},"suspend=y")," so you have time to attach a remote debugger. These are passed as Java system properties, either on command line or as part of the ",Object(a.b)("inlineCode",{parentName:"li"},"JAVA_OPTS")," environment variable. This will look like:",Object(a.b)("pre",{parentName:"li"},Object(a.b)("code",Object(r.a)({parentName:"pre"},{}),'export JAVA_OPTS="${JAVA_OPTS} -agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=5005"\n'))),Object(a.b)("li",{parentName:"ul"},"Execute the generator with your desired options. You should see the application output ",Object(a.b)("em",{parentName:"li"},"only"),Object(a.b)("pre",{parentName:"li"},Object(a.b)("code",Object(r.a)({parentName:"pre"},{}),"Listening for transport dt_socket at address: 5005\n"))),Object(a.b)("li",{parentName:"ul"},"Set breakpoints in code, and then attach your remote debugger from your IDE (see above). The generator will automatically unblock once the remote debugger is attached. You can now step through the code.")),Object(a.b)("h2",{id:"logs"},"Logs"),Object(a.b)("p",null,"You can try to enable debugging log with ",Object(a.b)("inlineCode",{parentName:"p"},"-Dlog.level=debug")," option to the ",Object(a.b)("inlineCode",{parentName:"p"},"JAVA_OPTS")," environment variable to see more information:"),Object(a.b)("pre",null,Object(a.b)("code",Object(r.a)({parentName:"pre"},{className:"language-bash"}),'export JAVA_OPTS="${JAVA_OPTS} -Dlog.level=debug"\n')),Object(a.b)("p",null,"Set the option then DEBUG logs are printed out:"),Object(a.b)("pre",null,Object(a.b)("code",Object(r.a)({parentName:"pre"},{className:"language-bash"}),"openapi-generator generate -g go ...\n\n...\n...\n[main] DEBUG o.o.codegen.DefaultCodegen - debugging fromProperty for files : class Schema {\n type: null\n format: null\n $ref: #/components/schemas/File\n...\n...\n")))}p.isMDXComponent=!0},293:function(e,t,n){"use strict";n.d(t,"a",(function(){return s})),n.d(t,"b",(function(){return m}));var r=n(0),o=n.n(r);function a(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function i(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function l(e){for(var t=1;t=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}var b=o.a.createContext({}),p=function(e){var t=o.a.useContext(b),n=t;return e&&(n="function"==typeof e?e(t):l({},t,{},e)),n},s=function(e){var t=p(e.components);return o.a.createElement(b.Provider,{value:t},e.children)},u={inlineCode:"code",wrapper:function(e){var t=e.children;return o.a.createElement(o.a.Fragment,{},t)}},d=Object(r.forwardRef)((function(e,t){var n=e.components,r=e.mdxType,a=e.originalType,i=e.parentName,b=c(e,["components","mdxType","originalType","parentName"]),s=p(n),d=r,m=s["".concat(i,".").concat(d)]||s[d]||u[d]||a;return n?o.a.createElement(m,l({ref:t},b,{components:n})):o.a.createElement(m,l({ref:t},b))}));function m(e,t){var n=arguments,r=t&&t.mdxType;if("string"==typeof e||r){var a=n.length,i=new Array(a);i[0]=d;var l={};for(var c in t)hasOwnProperty.call(t,c)&&(l[c]=t[c]);l.originalType=e,l.mdxType="string"==typeof e?e:r,i[1]=l;for(var b=2;b=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}var b=o.a.createContext({}),p=function(e){var t=o.a.useContext(b),n=t;return e&&(n="function"==typeof e?e(t):l({},t,{},e)),n},s=function(e){var t=p(e.components);return o.a.createElement(b.Provider,{value:t},e.children)},u={inlineCode:"code",wrapper:function(e){var t=e.children;return o.a.createElement(o.a.Fragment,{},t)}},d=Object(r.forwardRef)((function(e,t){var n=e.components,r=e.mdxType,a=e.originalType,i=e.parentName,b=c(e,["components","mdxType","originalType","parentName"]),s=p(n),d=r,m=s["".concat(i,".").concat(d)]||s[d]||u[d]||a;return n?o.a.createElement(m,l({ref:t},b,{components:n})):o.a.createElement(m,l({ref:t},b))}));function m(e,t){var n=arguments,r=t&&t.mdxType;if("string"==typeof e||r){var a=n.length,i=new Array(a);i[0]=d;var l={};for(var c in t)hasOwnProperty.call(t,c)&&(l[c]=t[c]);l.originalType=e,l.mdxType="string"==typeof e?e:r,i[1]=l;for(var b=2;b=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);for(a=0;a=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}var i=o.a.createContext({}),s=function(e){var t=o.a.useContext(i),n=t;return e&&(n="function"==typeof e?e(t):c({},t,{},e)),n},b=function(e){var t=s(e.components);return o.a.createElement(i.Provider,{value:t},e.children)},u={inlineCode:"code",wrapper:function(e){var t=e.children;return o.a.createElement(o.a.Fragment,{},t)}},d=Object(a.forwardRef)((function(e,t){var n=e.components,a=e.mdxType,r=e.originalType,p=e.parentName,i=l(e,["components","mdxType","originalType","parentName"]),b=s(n),d=a,m=b["".concat(p,".").concat(d)]||b[d]||u[d]||r;return n?o.a.createElement(m,c({ref:t},i,{components:n})):o.a.createElement(m,c({ref:t},i))}));function m(e,t){var n=arguments,a=t&&t.mdxType;if("string"==typeof e||a){var r=n.length,p=new Array(r);p[0]=d;var c={};for(var l in t)hasOwnProperty.call(t,l)&&(c[l]=t[l]);c.originalType=e,c.mdxType="string"==typeof e?e:a,p[1]=c;for(var i=2;i=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);for(a=0;a=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}var i=o.a.createContext({}),s=function(e){var t=o.a.useContext(i),n=t;return e&&(n="function"==typeof e?e(t):c({},t,{},e)),n},b=function(e){var t=s(e.components);return o.a.createElement(i.Provider,{value:t},e.children)},u={inlineCode:"code",wrapper:function(e){var t=e.children;return o.a.createElement(o.a.Fragment,{},t)}},d=Object(a.forwardRef)((function(e,t){var n=e.components,a=e.mdxType,r=e.originalType,p=e.parentName,i=l(e,["components","mdxType","originalType","parentName"]),b=s(n),d=a,m=b["".concat(p,".").concat(d)]||b[d]||u[d]||r;return n?o.a.createElement(m,c({ref:t},i,{components:n})):o.a.createElement(m,c({ref:t},i))}));function m(e,t){var n=arguments,a=t&&t.mdxType;if("string"==typeof e||a){var r=n.length,p=new Array(r);p[0]=d;var c={};for(var l in t)hasOwnProperty.call(t,l)&&(c[l]=t[l]);c.originalType=e,c.mdxType="string"==typeof e?e:a,p[1]=c;for(var i=2;i\n## Documentation for API Endpoints\n\nAll URIs are relative to *{{{basePath}}}*\n\nClass | Method | HTTP request | Description\n------------ | ------------- | ------------- | -------------\n{{#apiInfo}}{{#apis}}{{#operations}}{{#operation}}*{{classname}}* | [**{{operationId}}**](Apis/{{apiDocPath}}{{classname}}.md#{{operationIdLowerCase}}) | **{{httpMethod}}** {{path}} | {{#summary}}{{{summary}}}{{/summary}}\n{{/operation}}{{/operations}}{{/apis}}{{/apiInfo}}\n{{/generateApiDocs}}\n\n{{#generateModelDocs}}\n\n## Documentation for Models\n\n{{#modelPackage}}\n{{#models}}{{#model}} - [{{{modelPackage}}}.{{{classname}}}](Models/{{modelDocPath}}{{{classname}}}.md)\n{{/model}}{{/models}}\n{{/modelPackage}}\n{{^modelPackage}}\nNo model defined in this package\n{{/modelPackage}}\n{{/generateModelDocs}}\n\n{{! TODO: optional documentation for authorization? }}\n## Documentation for Authorization\n\n{{^authMethods}}\nAll endpoints do not require authorization.\n{{/authMethods}}\n{{#authMethods}}\n{{#last}}\nAuthentication schemes defined for the API:\n{{/last}}\n{{/authMethods}}\n{{#authMethods}}\n\n### {{name}}\n\n{{#isApiKey}}- **Type**: API key\n- **API key parameter name**: {{keyParamName}}\n- **Location**: {{#isKeyInQuery}}URL query string{{/isKeyInQuery}}{{#isKeyInHeader}}HTTP header{{/isKeyInHeader}}\n{{/isApiKey}}\n{{#isBasic}}- **Type**: HTTP basic authentication\n{{/isBasic}}\n{{#isOAuth}}- **Type**: OAuth\n- **Flow**: {{flow}}\n- **Authorization URL**: {{authorizationUrl}}\n- **Scopes**: {{^scopes}}N/A{{/scopes}}\n{{#scopes}} - {{scope}}: {{description}}\n{{/scopes}}\n{{/isOAuth}}\n\n{{/authMethods}}\n')),Object(r.b)("p",null,"Let's not focus too much on the contents of this file. You may refer to ",Object(r.b)("a",Object(a.a)({parentName:"p"},{href:"/docs/templating"}),"templating")," for more details on the variables bound to these files and to ",Object(r.b)("a",Object(a.a)({parentName:"p"},{href:"/docs/debugging"}),"debugging"),' how to debug the structures. Of note here is that we\'re generating structures in markdown as defined by the objects constructed by our new "Config" class.'),Object(r.b)("h4",{id:"apimustache"},"api.mustache"),Object(r.b)("p",null,"The API documentation might look like this:"),Object(r.b)("pre",null,Object(r.b)("code",Object(a.a)({parentName:"pre"},{className:"language-mustache"}),'# {{classname}}{{#description}}\n{{description}}{{/description}}\n\nAll URIs are relative to *{{basePath}}*\n\nMethod | HTTP request | Description\n------------- | ------------- | -------------\n{{#operations}}{{#operation}}[**{{operationId}}**]({{classname}}.md#{{operationId}}) | **{{httpMethod}}** {{path}} | {{#summary}}{{summary}}{{/summary}}\n{{/operation}}{{/operations}}\n\n{{#operations}}\n{{#operation}}\n\n# **{{operationId}}**\n> {{#returnType}}{{returnType}} {{/returnType}}{{operationId}}({{#allParams}}{{{paramName}}}{{#hasMore}}, {{/hasMore}}{{/allParams}})\n\n{{summary}}{{#notes}}\n\n{{notes}}{{/notes}}\n\n### Parameters\n{{^allParams}}This endpoint does not need any parameter.{{/allParams}}{{#allParams}}{{#-last}}\nName | Type | Description | Notes\n------------- | ------------- | ------------- | -------------{{/-last}}{{/allParams}}\n{{#allParams}} **{{paramName}}** | {{#isPrimitiveType}}**{{dataType}}**{{/isPrimitiveType}}{{^isPrimitiveType}}{{#isFile}}**{{dataType}}**{{/isFile}}{{^isFile}}{{#generateModelDocs}}[**{{dataType}}**]({{baseType}}.md){{/generateModelDocs}}{{^generateModelDocs}}**{{dataType}}**{{/generateModelDocs}}{{/isFile}}{{/isPrimitiveType}}| {{description}} |{{^required}} [optional]{{/required}}{{#defaultValue}} [default to {{defaultValue}}]{{/defaultValue}}{{#allowableValues}} [enum: {{#values}}{{{.}}}{{^-last}}, {{/-last}}{{/values}}]{{/allowableValues}}\n{{/allParams}}\n\n### Return type\n\n{{#returnType}}{{#returnTypeIsPrimitive}}**{{returnType}}**{{/returnTypeIsPrimitive}}{{^returnTypeIsPrimitive}}{{#generateModelDocs}}[**{{returnType}}**]({{returnBaseType}}.md){{/generateModelDocs}}{{^generateModelDocs}}**{{returnType}}**{{/generateModelDocs}}{{/returnTypeIsPrimitive}}{{/returnType}}{{^returnType}}null (empty response body){{/returnType}}\n\n### Authorization\n\n{{^authMethods}}No authorization required{{/authMethods}}{{#authMethods}}[{{name}}](../README.md#{{name}}){{^-last}}, {{/-last}}{{/authMethods}}\n\n### HTTP request headers\n\n - **Content-Type**: {{#consumes}}{{{mediaType}}}{{#hasMore}}, {{/hasMore}}{{/consumes}}{{^consumes}}Not defined{{/consumes}}\n - **Accept**: {{#produces}}{{{mediaType}}}{{#hasMore}}, {{/hasMore}}{{/produces}}{{^produces}}Not defined{{/produces}}\n\n{{/operation}}\n{{/operations}}\n\n')),Object(r.b)("h4",{id:"modelmustache"},"model.mustache"),Object(r.b)("p",null,"The models file could resemble the following."),Object(r.b)("pre",null,Object(r.b)("code",Object(a.a)({parentName:"pre"},{className:"language-mustache"}),"{{#models}}\n{{#model}}\n# {{{packageName}}}.{{modelPackage}}.{{{classname}}}\n## Properties\n\nName | Type | Description | Notes\n------------ | ------------- | ------------- | -------------\n{{#parent}}\n{{#parentVars}}\n**{{name}}** | {{#isPrimitiveType}}**{{dataType}}**{{/isPrimitiveType}}{{^isPrimitiveType}}[**{{dataType}}**]({{complexType}}.md){{/isPrimitiveType}} | {{description}} | {{^required}}[optional] {{/required}}{{#readOnly}}[readonly] {{/readOnly}}{{#defaultValue}}[default to {{{.}}}]{{/defaultValue}}\n{{/parentVars}}\n{{/parent}}\n{{#vars}}**{{name}}** | {{#isPrimitiveType}}**{{dataType}}**{{/isPrimitiveType}}{{^isPrimitiveType}}[**{{dataType}}**]({{complexType}}.md){{/isPrimitiveType}} | {{description}} | {{^required}}[optional] {{/required}}{{#readOnly}}[readonly] {{/readOnly}}{{#defaultValue}}[default to {{{.}}}]{{/defaultValue}}\n{{/vars}}\n\n[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)\n\n{{/model}}\n{{/models}}\n")),Object(r.b)("h3",{id:"build-it"},"Build it"),Object(r.b)("p",null,"To compile quickly to test this out, you can run ",Object(r.b)("inlineCode",{parentName:"p"},"mvn clean package -DskipTests"),"."),Object(r.b)("blockquote",null,Object(r.b)("p",{parentName:"blockquote"},"When implementing a more robust generator, you'll want to run all tests as well: ",Object(r.b)("inlineCode",{parentName:"p"},"mvn clean package"))),Object(r.b)("h3",{id:"compile-sample"},"Compile Sample"),Object(r.b)("p",null,"The ",Object(r.b)("inlineCode",{parentName:"p"},"new.sh")," script created ",Object(r.b)("inlineCode",{parentName:"p"},"bin/common-mark-documentation-petstore.sh"),":"),Object(r.b)("pre",null,Object(r.b)("code",Object(a.a)({parentName:"pre"},{className:"language-bash"}),'#!/bin/sh\n\nSCRIPT="$0"\n\nwhile [ -h "$SCRIPT" ] ; do\n ls=$(ls -ld "$SCRIPT")\n link=$(expr "$ls" : \'.*-> \\(.*\\)$\')\n if expr "$link" : \'/.*\' > /dev/null; then\n SCRIPT="$link"\n else\n SCRIPT=$(dirname "$SCRIPT")/"$link"\n fi\ndone\n\nif [ ! -d "${APP_DIR}" ]; then\n APP_DIR=$(dirname "$SCRIPT")/..\n APP_DIR=$(cd "${APP_DIR}"; pwd)\nfi\n\nexecutable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar"\n\nif [ ! -f "$executable" ]\nthen\n mvn clean package\nfi\n\n# if you\'ve executed sbt assembly previously it will use that instead.\nexport JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties"\nags="$@ generate -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g common-mark -o samples/documentation/petstore/common/mark"\n\njava ${JAVA_OPTS} -jar ${executable} ${ags}\n')),Object(r.b)("p",null,"This script is often used to apply default options for generation. A common option in most of these script is to define the template directory as the generator's directory under ",Object(r.b)("inlineCode",{parentName:"p"},"resources"),". This allows template maintainers to modify and test out template changes which don't require recompilation of the entire project. You'd still need to recompile the project in full if you add or modify behaviors to the generator (such as adding a ",Object(r.b)("inlineCode",{parentName:"p"},"CliOption"),")."),Object(r.b)("p",null,"Add ",Object(r.b)("inlineCode",{parentName:"p"},"-t modules/openapi-generator/src/main/resources/common-mark-documentation")," to ",Object(r.b)("inlineCode",{parentName:"p"},"ags")," line to simplify the evaluation of template-only modifications:"),Object(r.b)("pre",null,Object(r.b)("code",Object(a.a)({parentName:"pre"},{className:"language-diff"}),'diff --git a/bin/markdown-documentation-petstore.sh b/bin/markdown-documentation-petstore.sh\nindex d816771478..94b4ce6d12 100644\n--- a/bin/markdown-documentation-petstore.sh\n+++ b/bin/markdown-documentation-petstore.sh\n@@ -26,6 +26,6 @@ fi\n\n # if you\'ve executed sbt assembly previously it will use that instead.\n export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties"\n-ags="$@ generate -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g common-mark -o samples/documentation/petstore/common-mark"\n+ags="$@ generate -t modules/openapi-generator/src/main/resources/common-mark-documentation -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g common-mark -o samples/documentation/petstore/common/markdown"\n\n java ${JAVA_OPTS} -jar ${executable} ${ags}\n')),Object(r.b)("h3",{id:"verify-output"},"Verify output"),Object(r.b)("p",null,"Creating a new generator will be an iterative task. Once you've generated the sample, you'll want to try it out. For compiled client/server outputs, this would mean running the code or creating a small sample project to consume your artifact just to make sure it works."),Object(r.b)("p",null,"For markdown, you can open in Visual Studio Code or any other editor with a markdown preview. Not all editors support relative links to other markdown documents. To test the output in this guide, install ",Object(r.b)("inlineCode",{parentName:"p"},"markserv"),":"),Object(r.b)("pre",null,Object(r.b)("code",Object(a.a)({parentName:"pre"},{className:"language-bash"}),"npm install --global markserv\n")),Object(r.b)("p",null,"Now, you can serve the output directory directly and test your links:"),Object(r.b)("pre",null,Object(r.b)("code",Object(a.a)({parentName:"pre"},{className:"language-bash"}),"markserv samples/documentation/petstore/common/markdown\n")),Object(r.b)("p",null,"That's it! You've created your first generator!"))}c.isMDXComponent=!0},293:function(e,t,n){"use strict";n.d(t,"a",(function(){return m})),n.d(t,"b",(function(){return b}));var a=n(0),o=n.n(a);function r(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function i(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}function s(e){for(var t=1;t=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);for(a=0;a=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}var p=o.a.createContext({}),c=function(e){var t=o.a.useContext(p),n=t;return e&&(n="function"==typeof e?e(t):s({},t,{},e)),n},m=function(e){var t=c(e.components);return o.a.createElement(p.Provider,{value:t},e.children)},d={inlineCode:"code",wrapper:function(e){var t=e.children;return o.a.createElement(o.a.Fragment,{},t)}},u=Object(a.forwardRef)((function(e,t){var n=e.components,a=e.mdxType,r=e.originalType,i=e.parentName,p=l(e,["components","mdxType","originalType","parentName"]),m=c(n),u=a,b=m["".concat(i,".").concat(u)]||m[u]||d[u]||r;return n?o.a.createElement(b,s({ref:t},p,{components:n})):o.a.createElement(b,s({ref:t},p))}));function b(e,t){var n=arguments,a=t&&t.mdxType;if("string"==typeof e||a){var r=n.length,i=new Array(r);i[0]=u;var s={};for(var l in t)hasOwnProperty.call(t,l)&&(s[l]=t[l]);s.originalType=e,s.mdxType="string"==typeof e?e:a,i[1]=s;for(var p=2;p\n## Documentation for API Endpoints\n\nAll URIs are relative to *{{{basePath}}}*\n\nClass | Method | HTTP request | Description\n------------ | ------------- | ------------- | -------------\n{{#apiInfo}}{{#apis}}{{#operations}}{{#operation}}*{{classname}}* | [**{{operationId}}**](Apis/{{apiDocPath}}{{classname}}.md#{{operationIdLowerCase}}) | **{{httpMethod}}** {{path}} | {{#summary}}{{{summary}}}{{/summary}}\n{{/operation}}{{/operations}}{{/apis}}{{/apiInfo}}\n{{/generateApiDocs}}\n\n{{#generateModelDocs}}\n\n## Documentation for Models\n\n{{#modelPackage}}\n{{#models}}{{#model}} - [{{{modelPackage}}}.{{{classname}}}](Models/{{modelDocPath}}{{{classname}}}.md)\n{{/model}}{{/models}}\n{{/modelPackage}}\n{{^modelPackage}}\nNo model defined in this package\n{{/modelPackage}}\n{{/generateModelDocs}}\n\n{{! TODO: optional documentation for authorization? }}\n## Documentation for Authorization\n\n{{^authMethods}}\nAll endpoints do not require authorization.\n{{/authMethods}}\n{{#authMethods}}\n{{#last}}\nAuthentication schemes defined for the API:\n{{/last}}\n{{/authMethods}}\n{{#authMethods}}\n\n### {{name}}\n\n{{#isApiKey}}- **Type**: API key\n- **API key parameter name**: {{keyParamName}}\n- **Location**: {{#isKeyInQuery}}URL query string{{/isKeyInQuery}}{{#isKeyInHeader}}HTTP header{{/isKeyInHeader}}\n{{/isApiKey}}\n{{#isBasic}}- **Type**: HTTP basic authentication\n{{/isBasic}}\n{{#isOAuth}}- **Type**: OAuth\n- **Flow**: {{flow}}\n- **Authorization URL**: {{authorizationUrl}}\n- **Scopes**: {{^scopes}}N/A{{/scopes}}\n{{#scopes}} - {{scope}}: {{description}}\n{{/scopes}}\n{{/isOAuth}}\n\n{{/authMethods}}\n')),Object(o.b)("p",null,"Let's not focus too much on the contents of this file. You may refer to ",Object(o.b)("a",Object(a.a)({parentName:"p"},{href:"/docs/templating"}),"templating")," for more details on the variables bound to these files and to ",Object(o.b)("a",Object(a.a)({parentName:"p"},{href:"/docs/debugging"}),"debugging"),' how to debug the structures. Of note here is that we\'re generating structures in markdown as defined by the objects constructed by our new "Config" class.'),Object(o.b)("h4",{id:"apimustache"},"api.mustache"),Object(o.b)("p",null,"The API documentation might look like this:"),Object(o.b)("pre",null,Object(o.b)("code",Object(a.a)({parentName:"pre"},{className:"language-mustache"}),'# {{classname}}{{#description}}\n{{description}}{{/description}}\n\nAll URIs are relative to *{{basePath}}*\n\nMethod | HTTP request | Description\n------------- | ------------- | -------------\n{{#operations}}{{#operation}}[**{{operationId}}**]({{classname}}.md#{{operationId}}) | **{{httpMethod}}** {{path}} | {{#summary}}{{summary}}{{/summary}}\n{{/operation}}{{/operations}}\n\n{{#operations}}\n{{#operation}}\n\n# **{{operationId}}**\n> {{#returnType}}{{returnType}} {{/returnType}}{{operationId}}({{#allParams}}{{{paramName}}}{{#hasMore}}, {{/hasMore}}{{/allParams}})\n\n{{summary}}{{#notes}}\n\n{{notes}}{{/notes}}\n\n### Parameters\n{{^allParams}}This endpoint does not need any parameter.{{/allParams}}{{#allParams}}{{#-last}}\nName | Type | Description | Notes\n------------- | ------------- | ------------- | -------------{{/-last}}{{/allParams}}\n{{#allParams}} **{{paramName}}** | {{#isPrimitiveType}}**{{dataType}}**{{/isPrimitiveType}}{{^isPrimitiveType}}{{#isFile}}**{{dataType}}**{{/isFile}}{{^isFile}}{{#generateModelDocs}}[**{{dataType}}**]({{baseType}}.md){{/generateModelDocs}}{{^generateModelDocs}}**{{dataType}}**{{/generateModelDocs}}{{/isFile}}{{/isPrimitiveType}}| {{description}} |{{^required}} [optional]{{/required}}{{#defaultValue}} [default to {{defaultValue}}]{{/defaultValue}}{{#allowableValues}} [enum: {{#values}}{{{.}}}{{^-last}}, {{/-last}}{{/values}}]{{/allowableValues}}\n{{/allParams}}\n\n### Return type\n\n{{#returnType}}{{#returnTypeIsPrimitive}}**{{returnType}}**{{/returnTypeIsPrimitive}}{{^returnTypeIsPrimitive}}{{#generateModelDocs}}[**{{returnType}}**]({{returnBaseType}}.md){{/generateModelDocs}}{{^generateModelDocs}}**{{returnType}}**{{/generateModelDocs}}{{/returnTypeIsPrimitive}}{{/returnType}}{{^returnType}}null (empty response body){{/returnType}}\n\n### Authorization\n\n{{^authMethods}}No authorization required{{/authMethods}}{{#authMethods}}[{{name}}](../README.md#{{name}}){{^-last}}, {{/-last}}{{/authMethods}}\n\n### HTTP request headers\n\n - **Content-Type**: {{#consumes}}{{{mediaType}}}{{#hasMore}}, {{/hasMore}}{{/consumes}}{{^consumes}}Not defined{{/consumes}}\n - **Accept**: {{#produces}}{{{mediaType}}}{{#hasMore}}, {{/hasMore}}{{/produces}}{{^produces}}Not defined{{/produces}}\n\n{{/operation}}\n{{/operations}}\n\n')),Object(o.b)("h4",{id:"modelmustache"},"model.mustache"),Object(o.b)("p",null,"The models file could resemble the following."),Object(o.b)("pre",null,Object(o.b)("code",Object(a.a)({parentName:"pre"},{className:"language-mustache"}),"{{#models}}\n{{#model}}\n# {{{packageName}}}.{{modelPackage}}.{{{classname}}}\n## Properties\n\nName | Type | Description | Notes\n------------ | ------------- | ------------- | -------------\n{{#parent}}\n{{#parentVars}}\n**{{name}}** | {{#isPrimitiveType}}**{{dataType}}**{{/isPrimitiveType}}{{^isPrimitiveType}}[**{{dataType}}**]({{complexType}}.md){{/isPrimitiveType}} | {{description}} | {{^required}}[optional] {{/required}}{{#readOnly}}[readonly] {{/readOnly}}{{#defaultValue}}[default to {{{.}}}]{{/defaultValue}}\n{{/parentVars}}\n{{/parent}}\n{{#vars}}**{{name}}** | {{#isPrimitiveType}}**{{dataType}}**{{/isPrimitiveType}}{{^isPrimitiveType}}[**{{dataType}}**]({{complexType}}.md){{/isPrimitiveType}} | {{description}} | {{^required}}[optional] {{/required}}{{#readOnly}}[readonly] {{/readOnly}}{{#defaultValue}}[default to {{{.}}}]{{/defaultValue}}\n{{/vars}}\n\n[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)\n\n{{/model}}\n{{/models}}\n")),Object(o.b)("h3",{id:"build-it"},"Build it"),Object(o.b)("p",null,"To compile quickly to test this out, you can run ",Object(o.b)("inlineCode",{parentName:"p"},"mvn clean package -DskipTests"),"."),Object(o.b)("blockquote",null,Object(o.b)("p",{parentName:"blockquote"},"When implementing a more robust generator, you'll want to run all tests as well: ",Object(o.b)("inlineCode",{parentName:"p"},"mvn clean package"))),Object(o.b)("h3",{id:"compile-sample"},"Compile Sample"),Object(o.b)("p",null,"The ",Object(o.b)("inlineCode",{parentName:"p"},"new.sh")," script created ",Object(o.b)("inlineCode",{parentName:"p"},"bin/common-mark-documentation-petstore.sh"),":"),Object(o.b)("pre",null,Object(o.b)("code",Object(a.a)({parentName:"pre"},{className:"language-bash"}),'#!/bin/sh\n\nSCRIPT="$0"\n\nwhile [ -h "$SCRIPT" ] ; do\n ls=$(ls -ld "$SCRIPT")\n link=$(expr "$ls" : \'.*-> \\(.*\\)$\')\n if expr "$link" : \'/.*\' > /dev/null; then\n SCRIPT="$link"\n else\n SCRIPT=$(dirname "$SCRIPT")/"$link"\n fi\ndone\n\nif [ ! -d "${APP_DIR}" ]; then\n APP_DIR=$(dirname "$SCRIPT")/..\n APP_DIR=$(cd "${APP_DIR}"; pwd)\nfi\n\nexecutable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar"\n\nif [ ! -f "$executable" ]\nthen\n mvn clean package\nfi\n\n# if you\'ve executed sbt assembly previously it will use that instead.\nexport JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties"\nags="$@ generate -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g common-mark -o samples/documentation/petstore/common/mark"\n\njava ${JAVA_OPTS} -jar ${executable} ${ags}\n')),Object(o.b)("p",null,"This script is often used to apply default options for generation. A common option in most of these script is to define the template directory as the generator's directory under ",Object(o.b)("inlineCode",{parentName:"p"},"resources"),". This allows template maintainers to modify and test out template changes which don't require recompilation of the entire project. You'd still need to recompile the project in full if you add or modify behaviors to the generator (such as adding a ",Object(o.b)("inlineCode",{parentName:"p"},"CliOption"),")."),Object(o.b)("p",null,"Add ",Object(o.b)("inlineCode",{parentName:"p"},"-t modules/openapi-generator/src/main/resources/common-mark-documentation")," to ",Object(o.b)("inlineCode",{parentName:"p"},"ags")," line to simplify the evaluation of template-only modifications:"),Object(o.b)("pre",null,Object(o.b)("code",Object(a.a)({parentName:"pre"},{className:"language-diff"}),'diff --git a/bin/markdown-documentation-petstore.sh b/bin/markdown-documentation-petstore.sh\nindex d816771478..94b4ce6d12 100644\n--- a/bin/markdown-documentation-petstore.sh\n+++ b/bin/markdown-documentation-petstore.sh\n@@ -26,6 +26,6 @@ fi\n\n # if you\'ve executed sbt assembly previously it will use that instead.\n export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties"\n-ags="$@ generate -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g common-mark -o samples/documentation/petstore/common-mark"\n+ags="$@ generate -t modules/openapi-generator/src/main/resources/common-mark-documentation -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g common-mark -o samples/documentation/petstore/common/markdown"\n\n java ${JAVA_OPTS} -jar ${executable} ${ags}\n')),Object(o.b)("h3",{id:"verify-output"},"Verify output"),Object(o.b)("p",null,"Creating a new generator will be an iterative task. Once you've generated the sample, you'll want to try it out. For compiled client/server outputs, this would mean running the code or creating a small sample project to consume your artifact just to make sure it works."),Object(o.b)("p",null,"For markdown, you can open in Visual Studio Code or any other editor with a markdown preview. Not all editors support relative links to other markdown documents. To test the output in this guide, install ",Object(o.b)("inlineCode",{parentName:"p"},"markserv"),":"),Object(o.b)("pre",null,Object(o.b)("code",Object(a.a)({parentName:"pre"},{className:"language-bash"}),"npm install --global markserv\n")),Object(o.b)("p",null,"Now, you can serve the output directory directly and test your links:"),Object(o.b)("pre",null,Object(o.b)("code",Object(a.a)({parentName:"pre"},{className:"language-bash"}),"markserv samples/documentation/petstore/common/markdown\n")),Object(o.b)("p",null,"That's it! You've created your first generator!"))}c.isMDXComponent=!0},293:function(e,t,n){"use strict";n.d(t,"a",(function(){return m})),n.d(t,"b",(function(){return b}));var a=n(0),r=n.n(a);function o(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function i(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}function s(e){for(var t=1;t=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(a=0;a=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var p=r.a.createContext({}),c=function(e){var t=r.a.useContext(p),n=t;return e&&(n="function"==typeof e?e(t):s({},t,{},e)),n},m=function(e){var t=c(e.components);return r.a.createElement(p.Provider,{value:t},e.children)},d={inlineCode:"code",wrapper:function(e){var t=e.children;return r.a.createElement(r.a.Fragment,{},t)}},u=Object(a.forwardRef)((function(e,t){var n=e.components,a=e.mdxType,o=e.originalType,i=e.parentName,p=l(e,["components","mdxType","originalType","parentName"]),m=c(n),u=a,b=m["".concat(i,".").concat(u)]||m[u]||d[u]||o;return n?r.a.createElement(b,s({ref:t},p,{components:n})):r.a.createElement(b,s({ref:t},p))}));function b(e,t){var n=arguments,a=t&&t.mdxType;if("string"==typeof e||a){var o=n.length,i=new Array(o);i[0]=u;var s={};for(var l in t)hasOwnProperty.call(t,l)&&(s[l]=t[l]);s.originalType=e,s.mdxType="string"==typeof e?e:a,i[1]=s;for(var p=2;p use Swagger core v3 (see ",Object(o.b)("a",Object(a.a)({parentName:"li"},{href:"https://github.com/OpenAPITools/openapi-generator/issues/27%5B#27%5D"}),"https://github.com/OpenAPITools/openapi-generator/issues/27[#27]"),")"))),Object(o.b)("li",{parentName:"ul"},"Documentation"),Object(o.b)("li",{parentName:"ul"},"Static pages, preferably on gh-pages, devoted to each generator"),Object(o.b)("li",{parentName:"ul"},"Explain generator options"),Object(o.b)("li",{parentName:"ul"},"Centralized docs on generated code usage/examples/configuration")),Object(o.b)("h2",{id:"medium-term"},"Medium-term"),Object(o.b)("blockquote",null,Object(o.b)("p",{parentName:"blockquote"},"Feature set, well-defined API (code and templates), and extensibility improvements.")),Object(o.b)("h3",{id:"api"},"API"),Object(o.b)("ul",null,Object(o.b)("li",{parentName:"ul"},"Typed representation of the model bound to our templates. As it is, everything is treated an an Object, and this can lead to changes in the interface which might be unexpected from the template perspective."),Object(o.b)("li",{parentName:"ul"},"Feature set (potential generators to add; not an exhaustive list)",Object(o.b)("ul",{parentName:"li"},Object(o.b)("li",{parentName:"ul"},"Azure functions (node.js, server)"),Object(o.b)("li",{parentName:"ul"},"Finagle HTTP Client (Scala, client)"),Object(o.b)("li",{parentName:"ul"},"Finagle Http Server (Scala, server)"),Object(o.b)("li",{parentName:"ul"},"Finatra (Scala, server)"),Object(o.b)("li",{parentName:"ul"},"Kotlin Spring MVC/Springboot (server)"),Object(o.b)("li",{parentName:"ul"},"C++ Server, any framework (server)")))),Object(o.b)("h3",{id:"general"},"General"),Object(o.b)("ul",null,Object(o.b)("li",{parentName:"ul"},"Migrate from Maven to Gradle"),Object(o.b)("li",{parentName:"ul"},"Java 9+ support"),Object(o.b)("li",{parentName:"ul"},"Feature set (other options to investigate)"),Object(o.b)("li",{parentName:"ul"},"SPI plugins",Object(o.b)("ul",{parentName:"li"},Object(o.b)("li",{parentName:"ul"},"Templating engine"),Object(o.b)("li",{parentName:"ul"},"Language extensions"),Object(o.b)("li",{parentName:"ul"},"Custom extensions (e.g. allowing users to load support for ",Object(o.b)("a",Object(a.a)({parentName:"li"},{href:"https://github.com/Azure/azure-rest-api-specs%5Bazure-rest-api-specs%5D"}),"https://github.com/Azure/azure-rest-api-specs[azure-rest-api-specs]"),")"))),Object(o.b)("li",{parentName:"ul"},"Customizable templating engines (handlebars support)"),Object(o.b)("li",{parentName:"ul"},"Unit-testing templates (to previously mentioned explicit type as an interface to the template)"),Object(o.b)("li",{parentName:"ul"},"Reduce coupling"),Object(o.b)("li",{parentName:"ul"},"Make types extending ",Object(o.b)("inlineCode",{parentName:"li"},"CodegenConfig")," become the generation entrypoint"),Object(o.b)("li",{parentName:"ul"},"Allow current ",Object(o.b)("inlineCode",{parentName:"li"},"CodegenConfig")," types to define templating engine"),Object(o.b)("li",{parentName:"ul"},"Allow current ",Object(o.b)("inlineCode",{parentName:"li"},"CodegenConfig")," types to modify workflow (currently encapsulated in ",Object(o.b)("inlineCode",{parentName:"li"},"DefaultGenerator")," and tightly coupled to the template engine"),Object(o.b)("li",{parentName:"ul"},'Clearer reuse of "language" features, outside of "generator" types. That is, rather than enforcing polymorphic sharing of "language" which currently allows the super type to redefine framework-specific mapping functionality, generators could compose one or more language support types.'),Object(o.b)("li",{parentName:"ul"},"Define template deprecation/removal process")),Object(o.b)("h2",{id:"long-term"},"Long-term"),Object(o.b)("blockquote",null,Object(o.b)("p",{parentName:"blockquote"},"Expanding tooling offered, integrations, potentially SaaS offering to partially fund efforts.")),Object(o.b)("ul",null,Object(o.b)("li",{parentName:"ul"},"Generator UI wrappers",Object(o.b)("ul",{parentName:"li"},Object(o.b)("li",{parentName:"ul"},"Move jimschubert/intellij-swagger-codegen plugin under the org, and rename"),Object(o.b)("li",{parentName:"ul"},"Look into an Eclipse UI wrapper around the generator"),Object(o.b)("li",{parentName:"ul"},"Look at Visual Studio Code (and/or Atom, sublime text) integration"))),Object(o.b)("li",{parentName:"ul"},"Provide a native GUI for viewing/editing specs. Most tools are currently geared toward developers, but often times it may be non-technical business users who are interested in an API."),Object(o.b)("li",{parentName:"ul"},"A paid service (SaaS) for generation may be enticing for some users. Such a service would allow for statistics (mentioned earlier in telemetry)"),Object(o.b)("li",{parentName:"ul"},"Additional tools"),Object(o.b)("li",{parentName:"ul"},"node.js build system(s) integration (grunt/gulp/webpack/etc)"),Object(o.b)("li",{parentName:"ul"},"ruby gem"),Object(o.b)("li",{parentName:"ul"},"others (which may require previously mentioned SaaS API)")))}p.isMDXComponent=!0},293:function(e,t,r){"use strict";r.d(t,"a",(function(){return s})),r.d(t,"b",(function(){return d}));var a=r(0),n=r.n(a);function o(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function i(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,a)}return r}function l(e){for(var t=1;t=0||(n[r]=e[r]);return n}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(a=0;a=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}var u=n.a.createContext({}),p=function(e){var t=n.a.useContext(u),r=t;return e&&(r="function"==typeof e?e(t):l({},t,{},e)),r},s=function(e){var t=p(e.components);return n.a.createElement(u.Provider,{value:t},e.children)},b={inlineCode:"code",wrapper:function(e){var t=e.children;return n.a.createElement(n.a.Fragment,{},t)}},m=Object(a.forwardRef)((function(e,t){var r=e.components,a=e.mdxType,o=e.originalType,i=e.parentName,u=c(e,["components","mdxType","originalType","parentName"]),s=p(r),m=a,d=s["".concat(i,".").concat(m)]||s[m]||b[m]||o;return r?n.a.createElement(d,l({ref:t},u,{components:r})):n.a.createElement(d,l({ref:t},u))}));function d(e,t){var r=arguments,a=t&&t.mdxType;if("string"==typeof e||a){var o=r.length,i=new Array(o);i[0]=m;var l={};for(var c in t)hasOwnProperty.call(t,c)&&(l[c]=t[c]);l.originalType=e,l.mdxType="string"==typeof e?e:a,i[1]=l;for(var u=2;u use Swagger core v3 (see ",Object(o.b)("a",Object(a.a)({parentName:"li"},{href:"https://github.com/OpenAPITools/openapi-generator/issues/27%5B#27%5D"}),"https://github.com/OpenAPITools/openapi-generator/issues/27[#27]"),")"))),Object(o.b)("li",{parentName:"ul"},"Documentation"),Object(o.b)("li",{parentName:"ul"},"Static pages, preferably on gh-pages, devoted to each generator"),Object(o.b)("li",{parentName:"ul"},"Explain generator options"),Object(o.b)("li",{parentName:"ul"},"Centralized docs on generated code usage/examples/configuration")),Object(o.b)("h2",{id:"medium-term"},"Medium-term"),Object(o.b)("blockquote",null,Object(o.b)("p",{parentName:"blockquote"},"Feature set, well-defined API (code and templates), and extensibility improvements.")),Object(o.b)("h3",{id:"api"},"API"),Object(o.b)("ul",null,Object(o.b)("li",{parentName:"ul"},"Typed representation of the model bound to our templates. As it is, everything is treated an an Object, and this can lead to changes in the interface which might be unexpected from the template perspective."),Object(o.b)("li",{parentName:"ul"},"Feature set (potential generators to add; not an exhaustive list)",Object(o.b)("ul",{parentName:"li"},Object(o.b)("li",{parentName:"ul"},"Azure functions (node.js, server)"),Object(o.b)("li",{parentName:"ul"},"Finagle HTTP Client (Scala, client)"),Object(o.b)("li",{parentName:"ul"},"Finagle Http Server (Scala, server)"),Object(o.b)("li",{parentName:"ul"},"Finatra (Scala, server)"),Object(o.b)("li",{parentName:"ul"},"Kotlin Spring MVC/Springboot (server)"),Object(o.b)("li",{parentName:"ul"},"C++ Server, any framework (server)")))),Object(o.b)("h3",{id:"general"},"General"),Object(o.b)("ul",null,Object(o.b)("li",{parentName:"ul"},"Migrate from Maven to Gradle"),Object(o.b)("li",{parentName:"ul"},"Java 9+ support"),Object(o.b)("li",{parentName:"ul"},"Feature set (other options to investigate)"),Object(o.b)("li",{parentName:"ul"},"SPI plugins",Object(o.b)("ul",{parentName:"li"},Object(o.b)("li",{parentName:"ul"},"Templating engine"),Object(o.b)("li",{parentName:"ul"},"Language extensions"),Object(o.b)("li",{parentName:"ul"},"Custom extensions (e.g. allowing users to load support for ",Object(o.b)("a",Object(a.a)({parentName:"li"},{href:"https://github.com/Azure/azure-rest-api-specs%5Bazure-rest-api-specs%5D"}),"https://github.com/Azure/azure-rest-api-specs[azure-rest-api-specs]"),")"))),Object(o.b)("li",{parentName:"ul"},"Customizable templating engines (handlebars support)"),Object(o.b)("li",{parentName:"ul"},"Unit-testing templates (to previously mentioned explicit type as an interface to the template)"),Object(o.b)("li",{parentName:"ul"},"Reduce coupling"),Object(o.b)("li",{parentName:"ul"},"Make types extending ",Object(o.b)("inlineCode",{parentName:"li"},"CodegenConfig")," become the generation entrypoint"),Object(o.b)("li",{parentName:"ul"},"Allow current ",Object(o.b)("inlineCode",{parentName:"li"},"CodegenConfig")," types to define templating engine"),Object(o.b)("li",{parentName:"ul"},"Allow current ",Object(o.b)("inlineCode",{parentName:"li"},"CodegenConfig")," types to modify workflow (currently encapsulated in ",Object(o.b)("inlineCode",{parentName:"li"},"DefaultGenerator")," and tightly coupled to the template engine"),Object(o.b)("li",{parentName:"ul"},'Clearer reuse of "language" features, outside of "generator" types. That is, rather than enforcing polymorphic sharing of "language" which currently allows the super type to redefine framework-specific mapping functionality, generators could compose one or more language support types.'),Object(o.b)("li",{parentName:"ul"},"Define template deprecation/removal process")),Object(o.b)("h2",{id:"long-term"},"Long-term"),Object(o.b)("blockquote",null,Object(o.b)("p",{parentName:"blockquote"},"Expanding tooling offered, integrations, potentially SaaS offering to partially fund efforts.")),Object(o.b)("ul",null,Object(o.b)("li",{parentName:"ul"},"Generator UI wrappers",Object(o.b)("ul",{parentName:"li"},Object(o.b)("li",{parentName:"ul"},"Move jimschubert/intellij-swagger-codegen plugin under the org, and rename"),Object(o.b)("li",{parentName:"ul"},"Look into an Eclipse UI wrapper around the generator"),Object(o.b)("li",{parentName:"ul"},"Look at Visual Studio Code (and/or Atom, sublime text) integration"))),Object(o.b)("li",{parentName:"ul"},"Provide a native GUI for viewing/editing specs. Most tools are currently geared toward developers, but often times it may be non-technical business users who are interested in an API."),Object(o.b)("li",{parentName:"ul"},"A paid service (SaaS) for generation may be enticing for some users. Such a service would allow for statistics (mentioned earlier in telemetry)"),Object(o.b)("li",{parentName:"ul"},"Additional tools"),Object(o.b)("li",{parentName:"ul"},"node.js build system(s) integration (grunt/gulp/webpack/etc)"),Object(o.b)("li",{parentName:"ul"},"ruby gem"),Object(o.b)("li",{parentName:"ul"},"others (which may require previously mentioned SaaS API)")))}u.isMDXComponent=!0},293:function(e,t,r){"use strict";r.d(t,"a",(function(){return s})),r.d(t,"b",(function(){return d}));var a=r(0),n=r.n(a);function o(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function i(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,a)}return r}function l(e){for(var t=1;t=0||(n[r]=e[r]);return n}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(a=0;a=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}var p=n.a.createContext({}),u=function(e){var t=n.a.useContext(p),r=t;return e&&(r="function"==typeof e?e(t):l({},t,{},e)),r},s=function(e){var t=u(e.components);return n.a.createElement(p.Provider,{value:t},e.children)},b={inlineCode:"code",wrapper:function(e){var t=e.children;return n.a.createElement(n.a.Fragment,{},t)}},m=Object(a.forwardRef)((function(e,t){var r=e.components,a=e.mdxType,o=e.originalType,i=e.parentName,p=c(e,["components","mdxType","originalType","parentName"]),s=u(r),m=a,d=s["".concat(i,".").concat(m)]||s[m]||b[m]||o;return r?n.a.createElement(d,l({ref:t},p,{components:r})):n.a.createElement(d,l({ref:t},p))}));function d(e,t){var r=arguments,a=t&&t.mdxType;if("string"==typeof e||a){var o=r.length,i=new Array(o);i[0]=m;var l={};for(var c in t)hasOwnProperty.call(t,c)&&(l[c]=t[c]);l.originalType=e,l.mdxType="string"==typeof e?e:a,i[1]=l;for(var p=2;p=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}var l=o.a.createContext({}),s=function(e){var t=o.a.useContext(l),n=t;return e&&(n="function"==typeof e?e(t):c({},t,{},e)),n},u=function(e){var t=s(e.components);return o.a.createElement(l.Provider,{value:t},e.children)},f={inlineCode:"code",wrapper:function(e){var t=e.children;return o.a.createElement(o.a.Fragment,{},t)}},b=Object(r.forwardRef)((function(e,t){var n=e.components,r=e.mdxType,i=e.originalType,a=e.parentName,l=p(e,["components","mdxType","originalType","parentName"]),u=s(n),b=r,d=u["".concat(a,".").concat(b)]||u[b]||f[b]||i;return n?o.a.createElement(d,c({ref:t},l,{components:n})):o.a.createElement(d,c({ref:t},l))}));function d(e,t){var n=arguments,r=t&&t.mdxType;if("string"==typeof e||r){var i=n.length,a=new Array(i);a[0]=b;var c={};for(var p in t)hasOwnProperty.call(t,p)&&(c[p]=t[p]);c.originalType=e,c.mdxType="string"==typeof e?e:r,a[1]=c;for(var l=2;l=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}var l=o.a.createContext({}),s=function(e){var t=o.a.useContext(l),n=t;return e&&(n="function"==typeof e?e(t):c({},t,{},e)),n},u=function(e){var t=s(e.components);return o.a.createElement(l.Provider,{value:t},e.children)},f={inlineCode:"code",wrapper:function(e){var t=e.children;return o.a.createElement(o.a.Fragment,{},t)}},b=Object(r.forwardRef)((function(e,t){var n=e.components,r=e.mdxType,i=e.originalType,a=e.parentName,l=p(e,["components","mdxType","originalType","parentName"]),u=s(n),b=r,d=u["".concat(a,".").concat(b)]||u[b]||f[b]||i;return n?o.a.createElement(d,c({ref:t},l,{components:n})):o.a.createElement(d,c({ref:t},l))}));function d(e,t){var n=arguments,r=t&&t.mdxType;if("string"==typeof e||r){var i=n.length,a=new Array(i);a[0]=b;var c={};for(var p in t)hasOwnProperty.call(t,p)&&(c[p]=t[p]);c.originalType=e,c.mdxType="string"==typeof e?e:r,a[1]=c;for(var l=2;l - + diff --git a/7eeb204a.5c285426.js b/7eeb204a.5c285426.js deleted file mode 100644 index 8068af9e253..00000000000 --- a/7eeb204a.5c285426.js +++ /dev/null @@ -1 +0,0 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[69],{195:function(e,a,t){"use strict";t.r(a),t.d(a,"frontMatter",(function(){return n})),t.d(a,"metadata",(function(){return l})),t.d(a,"rightToc",(function(){return s})),t.d(a,"default",(function(){return o}));var r=t(1),c=t(9),b=(t(0),t(293)),n={},l={id:"generators/README",title:"README",description:"\x3c!-- Generate with: openapi-generator list --github-nested-index --\x3e",source:"@site/../docs/generators/README.md",permalink:"/docs/generators/README",editUrl:"https://github.com/OpenAPITools/openapi-generator/edit/master/website/../docs/generators/README.md",lastUpdatedBy:"Tatsuro Shibamura",lastUpdatedAt:1580871108},s=[{value:"CLIENT generators",id:"client-generators",children:[]},{value:"SERVER generators",id:"server-generators",children:[]},{value:"DOCUMENTATION generators",id:"documentation-generators",children:[]},{value:"SCHEMA generators",id:"schema-generators",children:[]},{value:"CONFIG generators",id:"config-generators",children:[]}],p={rightToc:s};function o(e){var a=e.components,t=Object(c.a)(e,["components"]);return Object(b.b)("wrapper",Object(r.a)({},p,t,{components:a,mdxType:"MDXLayout"}),Object(b.b)("p",null,"The following generators are available:"),Object(b.b)("h2",{id:"client-generators"},"CLIENT generators"),Object(b.b)("ul",null,Object(b.b)("li",{parentName:"ul"},Object(b.b)("a",Object(r.a)({parentName:"li"},{href:"/docs/generators/ada"}),"ada")," "),Object(b.b)("li",{parentName:"ul"},Object(b.b)("a",Object(r.a)({parentName:"li"},{href:"/docs/generators/android"}),"android")," "),Object(b.b)("li",{parentName:"ul"},Object(b.b)("a",Object(r.a)({parentName:"li"},{href:"/docs/generators/apex"}),"apex")," "),Object(b.b)("li",{parentName:"ul"},Object(b.b)("a",Object(r.a)({parentName:"li"},{href:"/docs/generators/bash"}),"bash")," "),Object(b.b)("li",{parentName:"ul"},Object(b.b)("a",Object(r.a)({parentName:"li"},{href:"/docs/generators/c"}),"c")," "),Object(b.b)("li",{parentName:"ul"},Object(b.b)("a",Object(r.a)({parentName:"li"},{href:"/docs/generators/clojure"}),"clojure")," "),Object(b.b)("li",{parentName:"ul"},Object(b.b)("a",Object(r.a)({parentName:"li"},{href:"/docs/generators/cpp-qt5-client"}),"cpp-qt5-client")," "),Object(b.b)("li",{parentName:"ul"},Object(b.b)("a",Object(r.a)({parentName:"li"},{href:"/docs/generators/cpp-restsdk"}),"cpp-restsdk")," "),Object(b.b)("li",{parentName:"ul"},Object(b.b)("a",Object(r.a)({parentName:"li"},{href:"/docs/generators/cpp-tizen"}),"cpp-tizen")," "),Object(b.b)("li",{parentName:"ul"},Object(b.b)("a",Object(r.a)({parentName:"li"},{href:"/docs/generators/csharp"}),"csharp")," "),Object(b.b)("li",{parentName:"ul"},Object(b.b)("a",Object(r.a)({parentName:"li"},{href:"/docs/generators/csharp-netcore"}),"csharp-netcore")," "),Object(b.b)("li",{parentName:"ul"},Object(b.b)("a",Object(r.a)({parentName:"li"},{href:"/docs/generators/dart"}),"dart")," "),Object(b.b)("li",{parentName:"ul"},Object(b.b)("a",Object(r.a)({parentName:"li"},{href:"/docs/generators/dart-dio"}),"dart-dio")," "),Object(b.b)("li",{parentName:"ul"},Object(b.b)("a",Object(r.a)({parentName:"li"},{href:"/docs/generators/dart-jaguar"}),"dart-jaguar")," "),Object(b.b)("li",{parentName:"ul"},Object(b.b)("a",Object(r.a)({parentName:"li"},{href:"/docs/generators/eiffel"}),"eiffel")," "),Object(b.b)("li",{parentName:"ul"},Object(b.b)("a",Object(r.a)({parentName:"li"},{href:"/docs/generators/elixir"}),"elixir")," "),Object(b.b)("li",{parentName:"ul"},Object(b.b)("a",Object(r.a)({parentName:"li"},{href:"/docs/generators/elm"}),"elm")," "),Object(b.b)("li",{parentName:"ul"},Object(b.b)("a",Object(r.a)({parentName:"li"},{href:"/docs/generators/erlang-client"}),"erlang-client")," "),Object(b.b)("li",{parentName:"ul"},Object(b.b)("a",Object(r.a)({parentName:"li"},{href:"/docs/generators/erlang-proper"}),"erlang-proper")," "),Object(b.b)("li",{parentName:"ul"},Object(b.b)("a",Object(r.a)({parentName:"li"},{href:"/docs/generators/flash"}),"flash")," "),Object(b.b)("li",{parentName:"ul"},Object(b.b)("a",Object(r.a)({parentName:"li"},{href:"/docs/generators/go"}),"go")," "),Object(b.b)("li",{parentName:"ul"},Object(b.b)("a",Object(r.a)({parentName:"li"},{href:"/docs/generators/go-experimental"}),"go-experimental (experimental)")," "),Object(b.b)("li",{parentName:"ul"},Object(b.b)("a",Object(r.a)({parentName:"li"},{href:"/docs/generators/groovy"}),"groovy")," "),Object(b.b)("li",{parentName:"ul"},Object(b.b)("a",Object(r.a)({parentName:"li"},{href:"/docs/generators/haskell-http-client"}),"haskell-http-client")," "),Object(b.b)("li",{parentName:"ul"},Object(b.b)("a",Object(r.a)({parentName:"li"},{href:"/docs/generators/java"}),"java")," "),Object(b.b)("li",{parentName:"ul"},Object(b.b)("a",Object(r.a)({parentName:"li"},{href:"/docs/generators/javascript"}),"javascript")," "),Object(b.b)("li",{parentName:"ul"},Object(b.b)("a",Object(r.a)({parentName:"li"},{href:"/docs/generators/javascript-closure-angular"}),"javascript-closure-angular")," "),Object(b.b)("li",{parentName:"ul"},Object(b.b)("a",Object(r.a)({parentName:"li"},{href:"/docs/generators/javascript-flowtyped"}),"javascript-flowtyped")," "),Object(b.b)("li",{parentName:"ul"},Object(b.b)("a",Object(r.a)({parentName:"li"},{href:"/docs/generators/jaxrs-cxf-client"}),"jaxrs-cxf-client")," "),Object(b.b)("li",{parentName:"ul"},Object(b.b)("a",Object(r.a)({parentName:"li"},{href:"/docs/generators/jmeter"}),"jmeter")," "),Object(b.b)("li",{parentName:"ul"},Object(b.b)("a",Object(r.a)({parentName:"li"},{href:"/docs/generators/kotlin"}),"kotlin")," "),Object(b.b)("li",{parentName:"ul"},Object(b.b)("a",Object(r.a)({parentName:"li"},{href:"/docs/generators/lua"}),"lua")," "),Object(b.b)("li",{parentName:"ul"},Object(b.b)("a",Object(r.a)({parentName:"li"},{href:"/docs/generators/nim"}),"nim (beta)")," "),Object(b.b)("li",{parentName:"ul"},Object(b.b)("a",Object(r.a)({parentName:"li"},{href:"/docs/generators/objc"}),"objc")," "),Object(b.b)("li",{parentName:"ul"},Object(b.b)("a",Object(r.a)({parentName:"li"},{href:"/docs/generators/ocaml"}),"ocaml")," "),Object(b.b)("li",{parentName:"ul"},Object(b.b)("a",Object(r.a)({parentName:"li"},{href:"/docs/generators/perl"}),"perl")," "),Object(b.b)("li",{parentName:"ul"},Object(b.b)("a",Object(r.a)({parentName:"li"},{href:"/docs/generators/php"}),"php")," "),Object(b.b)("li",{parentName:"ul"},Object(b.b)("a",Object(r.a)({parentName:"li"},{href:"/docs/generators/powershell"}),"powershell")," "),Object(b.b)("li",{parentName:"ul"},Object(b.b)("a",Object(r.a)({parentName:"li"},{href:"/docs/generators/python"}),"python")," "),Object(b.b)("li",{parentName:"ul"},Object(b.b)("a",Object(r.a)({parentName:"li"},{href:"/docs/generators/python-experimental"}),"python-experimental (experimental)")," "),Object(b.b)("li",{parentName:"ul"},Object(b.b)("a",Object(r.a)({parentName:"li"},{href:"/docs/generators/r"}),"r")," "),Object(b.b)("li",{parentName:"ul"},Object(b.b)("a",Object(r.a)({parentName:"li"},{href:"/docs/generators/ruby"}),"ruby")," "),Object(b.b)("li",{parentName:"ul"},Object(b.b)("a",Object(r.a)({parentName:"li"},{href:"/docs/generators/rust"}),"rust")," "),Object(b.b)("li",{parentName:"ul"},Object(b.b)("a",Object(r.a)({parentName:"li"},{href:"/docs/generators/scala-akka"}),"scala-akka")," "),Object(b.b)("li",{parentName:"ul"},Object(b.b)("a",Object(r.a)({parentName:"li"},{href:"/docs/generators/scala-gatling"}),"scala-gatling")," "),Object(b.b)("li",{parentName:"ul"},Object(b.b)("a",Object(r.a)({parentName:"li"},{href:"/docs/generators/scalaz"}),"scalaz")," "),Object(b.b)("li",{parentName:"ul"},Object(b.b)("a",Object(r.a)({parentName:"li"},{href:"/docs/generators/swift4"}),"swift4")," "),Object(b.b)("li",{parentName:"ul"},Object(b.b)("a",Object(r.a)({parentName:"li"},{href:"/docs/generators/swift5"}),"swift5 (beta)")," "),Object(b.b)("li",{parentName:"ul"},Object(b.b)("a",Object(r.a)({parentName:"li"},{href:"/docs/generators/typescript-angular"}),"typescript-angular")," "),Object(b.b)("li",{parentName:"ul"},Object(b.b)("a",Object(r.a)({parentName:"li"},{href:"/docs/generators/typescript-angularjs"}),"typescript-angularjs")," "),Object(b.b)("li",{parentName:"ul"},Object(b.b)("a",Object(r.a)({parentName:"li"},{href:"/docs/generators/typescript-aurelia"}),"typescript-aurelia")," "),Object(b.b)("li",{parentName:"ul"},Object(b.b)("a",Object(r.a)({parentName:"li"},{href:"/docs/generators/typescript-axios"}),"typescript-axios")," "),Object(b.b)("li",{parentName:"ul"},Object(b.b)("a",Object(r.a)({parentName:"li"},{href:"/docs/generators/typescript-fetch"}),"typescript-fetch")," "),Object(b.b)("li",{parentName:"ul"},Object(b.b)("a",Object(r.a)({parentName:"li"},{href:"/docs/generators/typescript-inversify"}),"typescript-inversify")," "),Object(b.b)("li",{parentName:"ul"},Object(b.b)("a",Object(r.a)({parentName:"li"},{href:"/docs/generators/typescript-jquery"}),"typescript-jquery")," "),Object(b.b)("li",{parentName:"ul"},Object(b.b)("a",Object(r.a)({parentName:"li"},{href:"/docs/generators/typescript-node"}),"typescript-node")," "),Object(b.b)("li",{parentName:"ul"},Object(b.b)("a",Object(r.a)({parentName:"li"},{href:"/docs/generators/typescript-redux-query"}),"typescript-redux-query")," "),Object(b.b)("li",{parentName:"ul"},Object(b.b)("a",Object(r.a)({parentName:"li"},{href:"/docs/generators/typescript-rxjs"}),"typescript-rxjs")," ")),Object(b.b)("h2",{id:"server-generators"},"SERVER generators"),Object(b.b)("ul",null,Object(b.b)("li",{parentName:"ul"},Object(b.b)("a",Object(r.a)({parentName:"li"},{href:"/docs/generators/ada-server"}),"ada-server")," "),Object(b.b)("li",{parentName:"ul"},Object(b.b)("a",Object(r.a)({parentName:"li"},{href:"/docs/generators/aspnetcore"}),"aspnetcore")," "),Object(b.b)("li",{parentName:"ul"},Object(b.b)("a",Object(r.a)({parentName:"li"},{href:"/docs/generators/cpp-pistache-server"}),"cpp-pistache-server")," "),Object(b.b)("li",{parentName:"ul"},Object(b.b)("a",Object(r.a)({parentName:"li"},{href:"/docs/generators/cpp-qt5-qhttpengine-server"}),"cpp-qt5-qhttpengine-server")," "),Object(b.b)("li",{parentName:"ul"},Object(b.b)("a",Object(r.a)({parentName:"li"},{href:"/docs/generators/cpp-restbed-server"}),"cpp-restbed-server")," "),Object(b.b)("li",{parentName:"ul"},Object(b.b)("a",Object(r.a)({parentName:"li"},{href:"/docs/generators/csharp-nancyfx"}),"csharp-nancyfx")," "),Object(b.b)("li",{parentName:"ul"},Object(b.b)("a",Object(r.a)({parentName:"li"},{href:"/docs/generators/erlang-server"}),"erlang-server")," "),Object(b.b)("li",{parentName:"ul"},Object(b.b)("a",Object(r.a)({parentName:"li"},{href:"/docs/generators/fsharp-functions"}),"fsharp-functions (beta)")," "),Object(b.b)("li",{parentName:"ul"},Object(b.b)("a",Object(r.a)({parentName:"li"},{href:"/docs/generators/fsharp-giraffe-server"}),"fsharp-giraffe-server (beta)")," "),Object(b.b)("li",{parentName:"ul"},Object(b.b)("a",Object(r.a)({parentName:"li"},{href:"/docs/generators/go-gin-server"}),"go-gin-server")," "),Object(b.b)("li",{parentName:"ul"},Object(b.b)("a",Object(r.a)({parentName:"li"},{href:"/docs/generators/go-server"}),"go-server")," "),Object(b.b)("li",{parentName:"ul"},Object(b.b)("a",Object(r.a)({parentName:"li"},{href:"/docs/generators/graphql-nodejs-express-server"}),"graphql-nodejs-express-server")," "),Object(b.b)("li",{parentName:"ul"},Object(b.b)("a",Object(r.a)({parentName:"li"},{href:"/docs/generators/haskell"}),"haskell")," "),Object(b.b)("li",{parentName:"ul"},Object(b.b)("a",Object(r.a)({parentName:"li"},{href:"/docs/generators/java-inflector"}),"java-inflector")," "),Object(b.b)("li",{parentName:"ul"},Object(b.b)("a",Object(r.a)({parentName:"li"},{href:"/docs/generators/java-msf4j"}),"java-msf4j")," "),Object(b.b)("li",{parentName:"ul"},Object(b.b)("a",Object(r.a)({parentName:"li"},{href:"/docs/generators/java-pkmst"}),"java-pkmst")," "),Object(b.b)("li",{parentName:"ul"},Object(b.b)("a",Object(r.a)({parentName:"li"},{href:"/docs/generators/java-play-framework"}),"java-play-framework")," "),Object(b.b)("li",{parentName:"ul"},Object(b.b)("a",Object(r.a)({parentName:"li"},{href:"/docs/generators/java-undertow-server"}),"java-undertow-server")," "),Object(b.b)("li",{parentName:"ul"},Object(b.b)("a",Object(r.a)({parentName:"li"},{href:"/docs/generators/java-vertx"}),"java-vertx")," "),Object(b.b)("li",{parentName:"ul"},Object(b.b)("a",Object(r.a)({parentName:"li"},{href:"/docs/generators/java-vertx-web"}),"java-vertx-web (beta)")," "),Object(b.b)("li",{parentName:"ul"},Object(b.b)("a",Object(r.a)({parentName:"li"},{href:"/docs/generators/jaxrs-cxf"}),"jaxrs-cxf")," "),Object(b.b)("li",{parentName:"ul"},Object(b.b)("a",Object(r.a)({parentName:"li"},{href:"/docs/generators/jaxrs-cxf-cdi"}),"jaxrs-cxf-cdi")," "),Object(b.b)("li",{parentName:"ul"},Object(b.b)("a",Object(r.a)({parentName:"li"},{href:"/docs/generators/jaxrs-cxf-extended"}),"jaxrs-cxf-extended")," "),Object(b.b)("li",{parentName:"ul"},Object(b.b)("a",Object(r.a)({parentName:"li"},{href:"/docs/generators/jaxrs-jersey"}),"jaxrs-jersey")," "),Object(b.b)("li",{parentName:"ul"},Object(b.b)("a",Object(r.a)({parentName:"li"},{href:"/docs/generators/jaxrs-resteasy"}),"jaxrs-resteasy")," "),Object(b.b)("li",{parentName:"ul"},Object(b.b)("a",Object(r.a)({parentName:"li"},{href:"/docs/generators/jaxrs-resteasy-eap"}),"jaxrs-resteasy-eap")," "),Object(b.b)("li",{parentName:"ul"},Object(b.b)("a",Object(r.a)({parentName:"li"},{href:"/docs/generators/jaxrs-spec"}),"jaxrs-spec")," "),Object(b.b)("li",{parentName:"ul"},Object(b.b)("a",Object(r.a)({parentName:"li"},{href:"/docs/generators/kotlin-server"}),"kotlin-server")," "),Object(b.b)("li",{parentName:"ul"},Object(b.b)("a",Object(r.a)({parentName:"li"},{href:"/docs/generators/kotlin-spring"}),"kotlin-spring")," "),Object(b.b)("li",{parentName:"ul"},Object(b.b)("a",Object(r.a)({parentName:"li"},{href:"/docs/generators/kotlin-vertx"}),"kotlin-vertx (beta)")," "),Object(b.b)("li",{parentName:"ul"},Object(b.b)("a",Object(r.a)({parentName:"li"},{href:"/docs/generators/nodejs-express-server"}),"nodejs-express-server (beta)")," "),Object(b.b)("li",{parentName:"ul"},Object(b.b)("a",Object(r.a)({parentName:"li"},{href:"/docs/generators/php-laravel"}),"php-laravel")," "),Object(b.b)("li",{parentName:"ul"},Object(b.b)("a",Object(r.a)({parentName:"li"},{href:"/docs/generators/php-lumen"}),"php-lumen")," "),Object(b.b)("li",{parentName:"ul"},Object(b.b)("a",Object(r.a)({parentName:"li"},{href:"/docs/generators/php-silex"}),"php-silex")," "),Object(b.b)("li",{parentName:"ul"},Object(b.b)("a",Object(r.a)({parentName:"li"},{href:"/docs/generators/php-slim4"}),"php-slim4")," "),Object(b.b)("li",{parentName:"ul"},Object(b.b)("a",Object(r.a)({parentName:"li"},{href:"/docs/generators/php-symfony"}),"php-symfony")," "),Object(b.b)("li",{parentName:"ul"},Object(b.b)("a",Object(r.a)({parentName:"li"},{href:"/docs/generators/php-ze-ph"}),"php-ze-ph")," "),Object(b.b)("li",{parentName:"ul"},Object(b.b)("a",Object(r.a)({parentName:"li"},{href:"/docs/generators/python-aiohttp"}),"python-aiohttp")," "),Object(b.b)("li",{parentName:"ul"},Object(b.b)("a",Object(r.a)({parentName:"li"},{href:"/docs/generators/python-blueplanet"}),"python-blueplanet")," "),Object(b.b)("li",{parentName:"ul"},Object(b.b)("a",Object(r.a)({parentName:"li"},{href:"/docs/generators/python-flask"}),"python-flask")," "),Object(b.b)("li",{parentName:"ul"},Object(b.b)("a",Object(r.a)({parentName:"li"},{href:"/docs/generators/ruby-on-rails"}),"ruby-on-rails")," "),Object(b.b)("li",{parentName:"ul"},Object(b.b)("a",Object(r.a)({parentName:"li"},{href:"/docs/generators/ruby-sinatra"}),"ruby-sinatra")," "),Object(b.b)("li",{parentName:"ul"},Object(b.b)("a",Object(r.a)({parentName:"li"},{href:"/docs/generators/rust-server"}),"rust-server")," "),Object(b.b)("li",{parentName:"ul"},Object(b.b)("a",Object(r.a)({parentName:"li"},{href:"/docs/generators/scala-finch"}),"scala-finch")," "),Object(b.b)("li",{parentName:"ul"},Object(b.b)("a",Object(r.a)({parentName:"li"},{href:"/docs/generators/scala-lagom-server"}),"scala-lagom-server")," "),Object(b.b)("li",{parentName:"ul"},Object(b.b)("a",Object(r.a)({parentName:"li"},{href:"/docs/generators/scala-play-server"}),"scala-play-server")," "),Object(b.b)("li",{parentName:"ul"},Object(b.b)("a",Object(r.a)({parentName:"li"},{href:"/docs/generators/scalatra"}),"scalatra")," "),Object(b.b)("li",{parentName:"ul"},Object(b.b)("a",Object(r.a)({parentName:"li"},{href:"/docs/generators/spring"}),"spring")," ")),Object(b.b)("h2",{id:"documentation-generators"},"DOCUMENTATION generators"),Object(b.b)("ul",null,Object(b.b)("li",{parentName:"ul"},Object(b.b)("a",Object(r.a)({parentName:"li"},{href:"/docs/generators/asciidoc"}),"asciidoc")," "),Object(b.b)("li",{parentName:"ul"},Object(b.b)("a",Object(r.a)({parentName:"li"},{href:"/docs/generators/cwiki"}),"cwiki")," "),Object(b.b)("li",{parentName:"ul"},Object(b.b)("a",Object(r.a)({parentName:"li"},{href:"/docs/generators/dynamic-html"}),"dynamic-html")," "),Object(b.b)("li",{parentName:"ul"},Object(b.b)("a",Object(r.a)({parentName:"li"},{href:"/docs/generators/html"}),"html")," "),Object(b.b)("li",{parentName:"ul"},Object(b.b)("a",Object(r.a)({parentName:"li"},{href:"/docs/generators/html2"}),"html2")," "),Object(b.b)("li",{parentName:"ul"},Object(b.b)("a",Object(r.a)({parentName:"li"},{href:"/docs/generators/markdown"}),"markdown (beta)")," "),Object(b.b)("li",{parentName:"ul"},Object(b.b)("a",Object(r.a)({parentName:"li"},{href:"/docs/generators/openapi"}),"openapi")," "),Object(b.b)("li",{parentName:"ul"},Object(b.b)("a",Object(r.a)({parentName:"li"},{href:"/docs/generators/openapi-yaml"}),"openapi-yaml")," ")),Object(b.b)("h2",{id:"schema-generators"},"SCHEMA generators"),Object(b.b)("ul",null,Object(b.b)("li",{parentName:"ul"},Object(b.b)("a",Object(r.a)({parentName:"li"},{href:"/docs/generators/avro-schema"}),"avro-schema (beta)")," "),Object(b.b)("li",{parentName:"ul"},Object(b.b)("a",Object(r.a)({parentName:"li"},{href:"/docs/generators/mysql-schema"}),"mysql-schema")," ")),Object(b.b)("h2",{id:"config-generators"},"CONFIG generators"),Object(b.b)("ul",null,Object(b.b)("li",{parentName:"ul"},Object(b.b)("a",Object(r.a)({parentName:"li"},{href:"/docs/generators/apache2"}),"apache2")," "),Object(b.b)("li",{parentName:"ul"},Object(b.b)("a",Object(r.a)({parentName:"li"},{href:"/docs/generators/graphql-schema"}),"graphql-schema")," "),Object(b.b)("li",{parentName:"ul"},Object(b.b)("a",Object(r.a)({parentName:"li"},{href:"/docs/generators/protobuf-schema"}),"protobuf-schema (beta)")," ")))}o.isMDXComponent=!0},293:function(e,a,t){"use strict";t.d(a,"a",(function(){return i})),t.d(a,"b",(function(){return m}));var r=t(0),c=t.n(r);function b(e,a,t){return a in e?Object.defineProperty(e,a,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[a]=t,e}function n(e,a){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);a&&(r=r.filter((function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable}))),t.push.apply(t,r)}return t}function l(e){for(var a=1;a=0||(c[t]=e[t]);return c}(e,a);if(Object.getOwnPropertySymbols){var b=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(c[t]=e[t])}return c}var p=c.a.createContext({}),o=function(e){var a=c.a.useContext(p),t=a;return e&&(t="function"==typeof e?e(a):l({},a,{},e)),t},i=function(e){var a=o(e.components);return c.a.createElement(p.Provider,{value:a},e.children)},j={inlineCode:"code",wrapper:function(e){var a=e.children;return c.a.createElement(c.a.Fragment,{},a)}},O=Object(r.forwardRef)((function(e,a){var t=e.components,r=e.mdxType,b=e.originalType,n=e.parentName,p=s(e,["components","mdxType","originalType","parentName"]),i=o(t),O=r,m=i["".concat(n,".").concat(O)]||i[O]||j[O]||b;return t?c.a.createElement(m,l({ref:a},p,{components:t})):c.a.createElement(m,l({ref:a},p))}));function m(e,a){var t=arguments,r=a&&a.mdxType;if("string"==typeof e||r){var b=t.length,n=new Array(b);n[0]=O;var l={};for(var s in a)hasOwnProperty.call(a,s)&&(l[s]=a[s]);l.originalType=e,l.mdxType="string"==typeof e?e:r,n[1]=l;for(var p=2;p=0||(c[t]=e[t]);return c}(e,a);if(Object.getOwnPropertySymbols){var b=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(c[t]=e[t])}return c}var p=c.a.createContext({}),o=function(e){var a=c.a.useContext(p),t=a;return e&&(t="function"==typeof e?e(a):l({},a,{},e)),t},i=function(e){var a=o(e.components);return c.a.createElement(p.Provider,{value:a},e.children)},j={inlineCode:"code",wrapper:function(e){var a=e.children;return c.a.createElement(c.a.Fragment,{},a)}},O=Object(r.forwardRef)((function(e,a){var t=e.components,r=e.mdxType,b=e.originalType,n=e.parentName,p=s(e,["components","mdxType","originalType","parentName"]),i=o(t),O=r,m=i["".concat(n,".").concat(O)]||i[O]||j[O]||b;return t?c.a.createElement(m,l({ref:a},p,{components:t})):c.a.createElement(m,l({ref:a},p))}));function m(e,a){var t=arguments,r=a&&a.mdxType;if("string"==typeof e||r){var b=t.length,n=new Array(b);n[0]=O;var l={};for(var s in a)hasOwnProperty.call(a,s)&&(l[s]=a[s]);l.originalType=e,l.mdxType="string"==typeof e?e:r,n[1]=l;for(var p=2;p=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var p=a.a.createContext({}),u=function(e){var t=a.a.useContext(p),n=t;return e&&(n="function"==typeof e?e(t):i({},t,{},e)),n},b=function(e){var t=u(e.components);return a.a.createElement(p.Provider,{value:t},e.children)},s={inlineCode:"code",wrapper:function(e){var t=e.children;return a.a.createElement(a.a.Fragment,{},t)}},d=Object(r.forwardRef)((function(e,t){var n=e.components,r=e.mdxType,o=e.originalType,c=e.parentName,p=l(e,["components","mdxType","originalType","parentName"]),b=u(n),d=r,g=b["".concat(c,".").concat(d)]||b[d]||s[d]||o;return n?a.a.createElement(g,i({ref:t},p,{components:n})):a.a.createElement(g,i({ref:t},p))}));function g(e,t){var n=arguments,r=t&&t.mdxType;if("string"==typeof e||r){var o=n.length,c=new Array(o);c[0]=d;var i={};for(var l in t)hasOwnProperty.call(t,l)&&(i[l]=t[l]);i.originalType=e,i.mdxType="string"==typeof e?e:r,c[1]=i;for(var p=2;p=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var p=a.a.createContext({}),u=function(e){var t=a.a.useContext(p),n=t;return e&&(n="function"==typeof e?e(t):c({},t,{},e)),n},b=function(e){var t=u(e.components);return a.a.createElement(p.Provider,{value:t},e.children)},s={inlineCode:"code",wrapper:function(e){var t=e.children;return a.a.createElement(a.a.Fragment,{},t)}},d=Object(r.forwardRef)((function(e,t){var n=e.components,r=e.mdxType,o=e.originalType,i=e.parentName,p=l(e,["components","mdxType","originalType","parentName"]),b=u(n),d=r,g=b["".concat(i,".").concat(d)]||b[d]||s[d]||o;return n?a.a.createElement(g,c({ref:t},p,{components:n})):a.a.createElement(g,c({ref:t},p))}));function g(e,t){var n=arguments,r=t&&t.mdxType;if("string"==typeof e||r){var o=n.length,i=new Array(o);i[0]=d;var c={};for(var l in t)hasOwnProperty.call(t,l)&&(c[l]=t[l]);c.originalType=e,c.mdxType="string"==typeof e?e:r,i[1]=c;for(var p=2;p=0||(c[t]=e[t]);return c}(e,a);if(Object.getOwnPropertySymbols){var b=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(c[t]=e[t])}return c}var p=c.a.createContext({}),o=function(e){var a=c.a.useContext(p),t=a;return e&&(t="function"==typeof e?e(a):l({},a,{},e)),t},i=function(e){var a=o(e.components);return c.a.createElement(p.Provider,{value:a},e.children)},j={inlineCode:"code",wrapper:function(e){var a=e.children;return c.a.createElement(c.a.Fragment,{},a)}},O=Object(r.forwardRef)((function(e,a){var t=e.components,r=e.mdxType,b=e.originalType,n=e.parentName,p=s(e,["components","mdxType","originalType","parentName"]),i=o(t),O=r,m=i["".concat(n,".").concat(O)]||i[O]||j[O]||b;return t?c.a.createElement(m,l({ref:a},p,{components:t})):c.a.createElement(m,l({ref:a},p))}));function m(e,a){var t=arguments,r=a&&a.mdxType;if("string"==typeof e||r){var b=t.length,n=new Array(b);n[0]=O;var l={};for(var s in a)hasOwnProperty.call(a,s)&&(l[s]=a[s]);l.originalType=e,l.mdxType="string"==typeof e?e:r,n[1]=l;for(var p=2;p=0||(c[t]=e[t]);return c}(e,a);if(Object.getOwnPropertySymbols){var b=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(c[t]=e[t])}return c}var p=c.a.createContext({}),o=function(e){var a=c.a.useContext(p),t=a;return e&&(t="function"==typeof e?e(a):l({},a,{},e)),t},i=function(e){var a=o(e.components);return c.a.createElement(p.Provider,{value:a},e.children)},j={inlineCode:"code",wrapper:function(e){var a=e.children;return c.a.createElement(c.a.Fragment,{},a)}},O=Object(r.forwardRef)((function(e,a){var t=e.components,r=e.mdxType,b=e.originalType,n=e.parentName,p=s(e,["components","mdxType","originalType","parentName"]),i=o(t),O=r,m=i["".concat(n,".").concat(O)]||i[O]||j[O]||b;return t?c.a.createElement(m,l({ref:a},p,{components:t})):c.a.createElement(m,l({ref:a},p))}));function m(e,a){var t=arguments,r=a&&a.mdxType;if("string"==typeof e||r){var b=t.length,n=new Array(b);n[0]=O;var l={};for(var s in a)hasOwnProperty.call(a,s)&&(l[s]=a[s]);l.originalType=e,l.mdxType="string"==typeof e?e:r,n[1]=l;for(var p=2;p\n io.swagger\n swagger-codegen\n\n")),Object(o.b)("p",null,"New:"),Object(o.b)("pre",null,Object(o.b)("code",Object(n.a)({parentName:"pre"},{className:"language-xml"}),"\n org.openapitools\n openapi-generator\n\n")),Object(o.b)("p",null,Object(o.b)("strong",{parentName:"p"},"Cli:")),Object(o.b)("pre",null,Object(o.b)("code",Object(n.a)({parentName:"pre"},{className:"language-xml"}),"\n io.swagger\n swagger-codegen-cli\n\n")),Object(o.b)("p",null,"New:"),Object(o.b)("pre",null,Object(o.b)("code",Object(n.a)({parentName:"pre"},{className:"language-xml"}),"\n org.openapitools\n openapi-generator-cli\n\n")),Object(o.b)("p",null,Object(o.b)("strong",{parentName:"p"},"Maven plugin:")),Object(o.b)("pre",null,Object(o.b)("code",Object(n.a)({parentName:"pre"},{className:"language-xml"}),"\n io.swagger\n swagger-codegen-maven-plugin\n\n")),Object(o.b)("p",null,"New:"),Object(o.b)("pre",null,Object(o.b)("code",Object(n.a)({parentName:"pre"},{className:"language-xml"}),"\n org.openapitools\n openapi-generator-maven-plugin\n\n")),Object(o.b)("h2",{id:"changes-in-maven-plugin"},"Changes in Maven Plugin"),Object(o.b)("p",null,"OpenAPI Generator 3.0.0 has introduced ",Object(o.b)("inlineCode",{parentName:"p"},"")," and deprecated ",Object(o.b)("inlineCode",{parentName:"p"},""),', because this refers to generator names which embed more than just "language".'),Object(o.b)("p",null,"If both options are present, you'll be presented with an error. If only ",Object(o.b)("inlineCode",{parentName:"p"},"")," is provided, you'll be presented instructions for updating to the new config."),Object(o.b)("h2",{id:"new-generators-names"},"New generators names"),Object(o.b)("p",null,"When you run OpenAPI Generator, you need to select a target generator (",Object(o.b)("inlineCode",{parentName:"p"},"-g")," option in the cli).\nAll languages of ",Object(o.b)("inlineCode",{parentName:"p"},"swagger-codegen")," have been migrated to ",Object(o.b)("inlineCode",{parentName:"p"},"openapi-generator"),", but some names were changed, in order to be more consistent."),Object(o.b)("table",null,Object(o.b)("thead",{parentName:"table"},Object(o.b)("tr",{parentName:"thead"},Object(o.b)("th",Object(n.a)({parentName:"tr"},{align:null}),"name in ",Object(o.b)("inlineCode",{parentName:"th"},"swagger-codegen")),Object(o.b)("th",Object(n.a)({parentName:"tr"},{align:null}),"name in ",Object(o.b)("inlineCode",{parentName:"th"},"openapi-generator")))),Object(o.b)("tbody",{parentName:"table"},Object(o.b)("tr",{parentName:"tbody"},Object(o.b)("td",Object(n.a)({parentName:"tr"},{align:null}),Object(o.b)("inlineCode",{parentName:"td"},"akka-scala")),Object(o.b)("td",Object(n.a)({parentName:"tr"},{align:null}),Object(o.b)("inlineCode",{parentName:"td"},"scala-akka"))),Object(o.b)("tr",{parentName:"tbody"},Object(o.b)("td",Object(n.a)({parentName:"tr"},{align:null}),Object(o.b)("inlineCode",{parentName:"td"},"scala")),Object(o.b)("td",Object(n.a)({parentName:"tr"},{align:null}),Object(o.b)("inlineCode",{parentName:"td"},"scala-httpclient"))),Object(o.b)("tr",{parentName:"tbody"},Object(o.b)("td",Object(n.a)({parentName:"tr"},{align:null}),Object(o.b)("inlineCode",{parentName:"td"},"jaxrs")),Object(o.b)("td",Object(n.a)({parentName:"tr"},{align:null}),Object(o.b)("inlineCode",{parentName:"td"},"jaxrs-jersey"))),Object(o.b)("tr",{parentName:"tbody"},Object(o.b)("td",Object(n.a)({parentName:"tr"},{align:null}),Object(o.b)("inlineCode",{parentName:"td"},"qt5cpp")),Object(o.b)("td",Object(n.a)({parentName:"tr"},{align:null}),Object(o.b)("inlineCode",{parentName:"td"},"cpp-qt5"))),Object(o.b)("tr",{parentName:"tbody"},Object(o.b)("td",Object(n.a)({parentName:"tr"},{align:null}),Object(o.b)("inlineCode",{parentName:"td"},"cpprest")),Object(o.b)("td",Object(n.a)({parentName:"tr"},{align:null}),Object(o.b)("inlineCode",{parentName:"td"},"cpp-restsdk"))),Object(o.b)("tr",{parentName:"tbody"},Object(o.b)("td",Object(n.a)({parentName:"tr"},{align:null}),Object(o.b)("inlineCode",{parentName:"td"},"tizen")),Object(o.b)("td",Object(n.a)({parentName:"tr"},{align:null}),Object(o.b)("inlineCode",{parentName:"td"},"cpp-tizen"))),Object(o.b)("tr",{parentName:"tbody"},Object(o.b)("td",Object(n.a)({parentName:"tr"},{align:null}),Object(o.b)("inlineCode",{parentName:"td"},"sinatra")),Object(o.b)("td",Object(n.a)({parentName:"tr"},{align:null}),Object(o.b)("inlineCode",{parentName:"td"},"ruby-sinatra"))),Object(o.b)("tr",{parentName:"tbody"},Object(o.b)("td",Object(n.a)({parentName:"tr"},{align:null}),Object(o.b)("inlineCode",{parentName:"td"},"swift")),Object(o.b)("td",Object(n.a)({parentName:"tr"},{align:null}),Object(o.b)("inlineCode",{parentName:"td"},"swift2-deprecated"))),Object(o.b)("tr",{parentName:"tbody"},Object(o.b)("td",Object(n.a)({parentName:"tr"},{align:null}),Object(o.b)("inlineCode",{parentName:"td"},"lumen")),Object(o.b)("td",Object(n.a)({parentName:"tr"},{align:null}),Object(o.b)("inlineCode",{parentName:"td"},"php-lumen"))),Object(o.b)("tr",{parentName:"tbody"},Object(o.b)("td",Object(n.a)({parentName:"tr"},{align:null}),Object(o.b)("inlineCode",{parentName:"td"},"slim")),Object(o.b)("td",Object(n.a)({parentName:"tr"},{align:null}),Object(o.b)("inlineCode",{parentName:"td"},"php-slim"))),Object(o.b)("tr",{parentName:"tbody"},Object(o.b)("td",Object(n.a)({parentName:"tr"},{align:null}),Object(o.b)("inlineCode",{parentName:"td"},"ze-ph")),Object(o.b)("td",Object(n.a)({parentName:"tr"},{align:null}),Object(o.b)("inlineCode",{parentName:"td"},"php-ze-ph"))),Object(o.b)("tr",{parentName:"tbody"},Object(o.b)("td",Object(n.a)({parentName:"tr"},{align:null}),Object(o.b)("inlineCode",{parentName:"td"},"nancyfx")),Object(o.b)("td",Object(n.a)({parentName:"tr"},{align:null}),Object(o.b)("inlineCode",{parentName:"td"},"csharp-nancyfx"))))),Object(o.b)("p",null,"We provide a temporary mapping in code for these old values. You'll receive a warning with instructions to migrate to the new names."),Object(o.b)("h2",{id:"new-parameters-name"},"New parameters name"),Object(o.b)("p",null,'Some parameters were renamed.\nOften you need to replace "Swagger", with "OpenAPI".\nSome examples:'),Object(o.b)("table",null,Object(o.b)("thead",{parentName:"table"},Object(o.b)("tr",{parentName:"thead"},Object(o.b)("th",Object(n.a)({parentName:"tr"},{align:null}),"name in ",Object(o.b)("inlineCode",{parentName:"th"},"swagger-codegen")),Object(o.b)("th",Object(n.a)({parentName:"tr"},{align:null}),"name in ",Object(o.b)("inlineCode",{parentName:"th"},"openapi-generator")))),Object(o.b)("tbody",{parentName:"table"},Object(o.b)("tr",{parentName:"tbody"},Object(o.b)("td",Object(n.a)({parentName:"tr"},{align:null}),Object(o.b)("inlineCode",{parentName:"td"},"debugSwagger")),Object(o.b)("td",Object(n.a)({parentName:"tr"},{align:null}),Object(o.b)("inlineCode",{parentName:"td"},"debugOpenAPI"))),Object(o.b)("tr",{parentName:"tbody"},Object(o.b)("td",Object(n.a)({parentName:"tr"},{align:null}),Object(o.b)("inlineCode",{parentName:"td"},"GenerateSwaggerMetadata")),Object(o.b)("td",Object(n.a)({parentName:"tr"},{align:null}),Object(o.b)("inlineCode",{parentName:"td"},"GenerateOpenAPIMetadata"))),Object(o.b)("tr",{parentName:"tbody"},Object(o.b)("td",Object(n.a)({parentName:"tr"},{align:null}),Object(o.b)("inlineCode",{parentName:"td"},"swagger.codegen.undertow.apipackage")),Object(o.b)("td",Object(n.a)({parentName:"tr"},{align:null}),Object(o.b)("inlineCode",{parentName:"td"},"openapi.codegen.undertow.apipackage"))),Object(o.b)("tr",{parentName:"tbody"},Object(o.b)("td",Object(n.a)({parentName:"tr"},{align:null}),Object(o.b)("inlineCode",{parentName:"td"},"swagger.codegen.undertow.modelpackage")),Object(o.b)("td",Object(n.a)({parentName:"tr"},{align:null}),Object(o.b)("inlineCode",{parentName:"td"},"openapi.codegen.undertow.modelpackage"))))),Object(o.b)("h2",{id:"renamed-mustache-template-variables"},"Renamed Mustache Template Variables"),Object(o.b)("p",null,"The template variable ",Object(o.b)("inlineCode",{parentName:"p"},"{{datatype}}")," was renamed to ",Object(o.b)("inlineCode",{parentName:"p"},"{{dataType}}")," for consistency reason.\nCorresponding java code: ",Object(o.b)("inlineCode",{parentName:"p"},"CodegenProperty.datatype")," is renamed to ",Object(o.b)("inlineCode",{parentName:"p"},"CodegenProperty.dataType"),"."),Object(o.b)("p",null,"(If you're ",Object(o.b)("strong",{parentName:"p"},"not")," using customized templates with the ",Object(o.b)("inlineCode",{parentName:"p"},"-t")," option, you can ignore the mustache variable renaming above.)"),Object(o.b)("h2",{id:"ignore-file"},"Ignore file"),Object(o.b)("p",null,Object(o.b)("inlineCode",{parentName:"p"},".swagger-codegen-ignore")," is replaced by ",Object(o.b)("inlineCode",{parentName:"p"},".openapi-generator-ignore"),".\nThe syntax inside the file stays the same."),Object(o.b)("p",null,"You don't need to rename the file manually, OpenAPI Generator will do it when your run it against an existing output directory.\n(When there is no ",Object(o.b)("inlineCode",{parentName:"p"},".openapi-generator-ignore")," in a folder, if a ",Object(o.b)("inlineCode",{parentName:"p"},".swagger-codegen-ignore")," file is present it will be considered and renamed to ",Object(o.b)("inlineCode",{parentName:"p"},".openapi-generator-ignore"),")."),Object(o.b)("h2",{id:"metadata-folder"},"Metadata folder"),Object(o.b)("p",null,"The metatata folder (to store the ",Object(o.b)("inlineCode",{parentName:"p"},"VERSION")," file for example) is now called ",Object(o.b)("inlineCode",{parentName:"p"},".openapi-generator/")," instead of ",Object(o.b)("inlineCode",{parentName:"p"},".swagger-codegen/"),"."),Object(o.b)("h2",{id:"new-default-values-for-the-generated-code"},"New default values for the generated code"),Object(o.b)("p",null,"If you use a generator without specifying each parameter, you might see some differences in the generated code.\nAs example the default package name used in the generated code has changed.\nYou need to have a look at the specific value, depending of your target language, but often ",Object(o.b)("inlineCode",{parentName:"p"},"Swagger")," \xees replaced by ",Object(o.b)("inlineCode",{parentName:"p"},"OpenAPITools")," and ",Object(o.b)("inlineCode",{parentName:"p"},"io.swagger")," is replaced by ",Object(o.b)("inlineCode",{parentName:"p"},"org.openapitools"),".\nConcretely if you did not specify anything when you are generating java code, a file ",Object(o.b)("inlineCode",{parentName:"p"},"org/openapitools/api/PetApi.java")," might be generated instead of ",Object(o.b)("inlineCode",{parentName:"p"},"io/swagger/api/PetApi.java"),"."),Object(o.b)("p",null,"If this is a problem for you, you need to explicitly set the the parameter value in order to match with the ",Object(o.b)("inlineCode",{parentName:"p"},"swagger-codgen")," default value (",Object(o.b)("inlineCode",{parentName:"p"},"apiPackage")," == ",Object(o.b)("inlineCode",{parentName:"p"},"io.swagger")," in the previous example with the java generator)."),Object(o.b)("h2",{id:"new-fully-qualified-name-for-the-classes"},"New fully qualified name for the classes"),Object(o.b)("p",null,"If you have extended some generators in your project, and you are looking for a specific class, replace the ",Object(o.b)("inlineCode",{parentName:"p"},"io.swagger.codegen")," package (old name) with ",Object(o.b)("inlineCode",{parentName:"p"},"org.openapitools.codegen")," package (new name)."),Object(o.b)("p",null,"Example: ",Object(o.b)("inlineCode",{parentName:"p"},"org.openapitools.codegen.DefaultGenerator")),Object(o.b)("h2",{id:"body-parameter-name"},"Body parameter name"),Object(o.b)("p",null,"\u203c\ufe0f Since 4.0.0-beta, the body parameter name in OAS v2 is automatically preserved in the vendor extension ",Object(o.b)("inlineCode",{parentName:"p"},"x-codegen-request-body-name")),Object(o.b)("p",null,"In OpenAPI spec v3, there's no body parameter, which is replaced by ",Object(o.b)("a",Object(n.a)({parentName:"p"},{href:"https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.1.md#request-body-object"}),"Request Body Object"),'. The parameter name for Request Body is named automatically based on the model name (e.g. User). To control how the "Request Body" parameter is named, please add the vendor extension ',Object(o.b)("inlineCode",{parentName:"p"},"x-codegen-request-body-name")," to the operation:"),Object(o.b)("p",null,"OpenAPI Spec v3:"),Object(o.b)("pre",null,Object(o.b)("code",Object(n.a)({parentName:"pre"},{className:"language-yaml"}),"paths:\n /pet:\n post:\n tags:\n - pet\n summary: Add a new pet to the store\n description: ''\n operationId: addPet\n x-codegen-request-body-name: new_body_name\n responses:\n '405':\n description: Invalid input\n security:\n - petstore_auth:\n - 'write:pets'\n - 'read:pets'\n requestBody:\n $ref: '#/components/requestBodies/Pet'\n")),Object(o.b)("p",null,"OpenAPI Spec v2:"),Object(o.b)("pre",null,Object(o.b)("code",Object(n.a)({parentName:"pre"},{className:"language-yaml"}),"paths:\n /pet:\n post:\n tags:\n - pet\n summary: Add a new pet to the store\n description: ''\n operationId: addPet\n x-codegen-request-body-name: new_body_name\n consumes:\n - application/json\n - application/xml\n produces:\n - application/xml\n - application/json\n parameters:\n - in: body\n name: body\n description: Pet object that needs to be added to the store\n required: true\n schema:\n $ref: '#/definitions/Pet'\n responses:\n '405':\n description: Invalid input\n security:\n - petstore_auth:\n - 'write:pets'\n - 'read:pets'\n")),Object(o.b)("p",null,"If your API client is using named parameters in the function call (e.g. Perl required & optional parameters, Ruby optional parameters), you will need to add ",Object(o.b)("inlineCode",{parentName:"p"},"x-codegen-request-body-name")," to the spec to restore the original body parameter name."),Object(o.b)("h2",{id:"default-basepath"},"Default basePath"),Object(o.b)("p",null,"The default ",Object(o.b)("inlineCode",{parentName:"p"},"basePath")," has been changed from ",Object(o.b)("inlineCode",{parentName:"p"},"https://localhost")," to ",Object(o.b)("inlineCode",{parentName:"p"},"http://localhost")," (http without s)"),Object(o.b)("h2",{id:"nullable"},"Nullable"),Object(o.b)("p",null,"OpenAPI spec v3 has better support for ",Object(o.b)("inlineCode",{parentName:"p"},"nullable"),". If you're still using OpenAPI/Swagger spec v2, please use ",Object(o.b)("inlineCode",{parentName:"p"},"x-nullable: true")," instead."))}c.isMDXComponent=!0},293:function(e,t,a){"use strict";a.d(t,"a",(function(){return d})),a.d(t,"b",(function(){return O}));var n=a(0),r=a.n(n);function o(e,t,a){return t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}function b(e,t){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),a.push.apply(a,n)}return a}function i(e){for(var t=1;t=0||(r[a]=e[a]);return r}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,a)&&(r[a]=e[a])}return r}var p=r.a.createContext({}),c=function(e){var t=r.a.useContext(p),a=t;return e&&(a="function"==typeof e?e(t):i({},t,{},e)),a},d=function(e){var t=c(e.components);return r.a.createElement(p.Provider,{value:t},e.children)},m={inlineCode:"code",wrapper:function(e){var t=e.children;return r.a.createElement(r.a.Fragment,{},t)}},s=Object(n.forwardRef)((function(e,t){var a=e.components,n=e.mdxType,o=e.originalType,b=e.parentName,p=l(e,["components","mdxType","originalType","parentName"]),d=c(a),s=n,O=d["".concat(b,".").concat(s)]||d[s]||m[s]||o;return a?r.a.createElement(O,i({ref:t},p,{components:a})):r.a.createElement(O,i({ref:t},p))}));function O(e,t){var a=arguments,n=t&&t.mdxType;if("string"==typeof e||n){var o=a.length,b=new Array(o);b[0]=s;var i={};for(var l in t)hasOwnProperty.call(t,l)&&(i[l]=t[l]);i.originalType=e,i.mdxType="string"==typeof e?e:n,b[1]=i;for(var p=2;p\n io.swagger\n swagger-codegen\n\n")),Object(o.b)("p",null,"New:"),Object(o.b)("pre",null,Object(o.b)("code",Object(n.a)({parentName:"pre"},{className:"language-xml"}),"\n org.openapitools\n openapi-generator\n\n")),Object(o.b)("p",null,Object(o.b)("strong",{parentName:"p"},"Cli:")),Object(o.b)("pre",null,Object(o.b)("code",Object(n.a)({parentName:"pre"},{className:"language-xml"}),"\n io.swagger\n swagger-codegen-cli\n\n")),Object(o.b)("p",null,"New:"),Object(o.b)("pre",null,Object(o.b)("code",Object(n.a)({parentName:"pre"},{className:"language-xml"}),"\n org.openapitools\n openapi-generator-cli\n\n")),Object(o.b)("p",null,Object(o.b)("strong",{parentName:"p"},"Maven plugin:")),Object(o.b)("pre",null,Object(o.b)("code",Object(n.a)({parentName:"pre"},{className:"language-xml"}),"\n io.swagger\n swagger-codegen-maven-plugin\n\n")),Object(o.b)("p",null,"New:"),Object(o.b)("pre",null,Object(o.b)("code",Object(n.a)({parentName:"pre"},{className:"language-xml"}),"\n org.openapitools\n openapi-generator-maven-plugin\n\n")),Object(o.b)("h2",{id:"changes-in-maven-plugin"},"Changes in Maven Plugin"),Object(o.b)("p",null,"OpenAPI Generator 3.0.0 has introduced ",Object(o.b)("inlineCode",{parentName:"p"},"")," and deprecated ",Object(o.b)("inlineCode",{parentName:"p"},""),', because this refers to generator names which embed more than just "language".'),Object(o.b)("p",null,"If both options are present, you'll be presented with an error. If only ",Object(o.b)("inlineCode",{parentName:"p"},"")," is provided, you'll be presented instructions for updating to the new config."),Object(o.b)("h2",{id:"new-generators-names"},"New generators names"),Object(o.b)("p",null,"When you run OpenAPI Generator, you need to select a target generator (",Object(o.b)("inlineCode",{parentName:"p"},"-g")," option in the cli).\nAll languages of ",Object(o.b)("inlineCode",{parentName:"p"},"swagger-codegen")," have been migrated to ",Object(o.b)("inlineCode",{parentName:"p"},"openapi-generator"),", but some names were changed, in order to be more consistent."),Object(o.b)("table",null,Object(o.b)("thead",{parentName:"table"},Object(o.b)("tr",{parentName:"thead"},Object(o.b)("th",Object(n.a)({parentName:"tr"},{align:null}),"name in ",Object(o.b)("inlineCode",{parentName:"th"},"swagger-codegen")),Object(o.b)("th",Object(n.a)({parentName:"tr"},{align:null}),"name in ",Object(o.b)("inlineCode",{parentName:"th"},"openapi-generator")))),Object(o.b)("tbody",{parentName:"table"},Object(o.b)("tr",{parentName:"tbody"},Object(o.b)("td",Object(n.a)({parentName:"tr"},{align:null}),Object(o.b)("inlineCode",{parentName:"td"},"akka-scala")),Object(o.b)("td",Object(n.a)({parentName:"tr"},{align:null}),Object(o.b)("inlineCode",{parentName:"td"},"scala-akka"))),Object(o.b)("tr",{parentName:"tbody"},Object(o.b)("td",Object(n.a)({parentName:"tr"},{align:null}),Object(o.b)("inlineCode",{parentName:"td"},"scala")),Object(o.b)("td",Object(n.a)({parentName:"tr"},{align:null}),Object(o.b)("inlineCode",{parentName:"td"},"scala-httpclient"))),Object(o.b)("tr",{parentName:"tbody"},Object(o.b)("td",Object(n.a)({parentName:"tr"},{align:null}),Object(o.b)("inlineCode",{parentName:"td"},"jaxrs")),Object(o.b)("td",Object(n.a)({parentName:"tr"},{align:null}),Object(o.b)("inlineCode",{parentName:"td"},"jaxrs-jersey"))),Object(o.b)("tr",{parentName:"tbody"},Object(o.b)("td",Object(n.a)({parentName:"tr"},{align:null}),Object(o.b)("inlineCode",{parentName:"td"},"qt5cpp")),Object(o.b)("td",Object(n.a)({parentName:"tr"},{align:null}),Object(o.b)("inlineCode",{parentName:"td"},"cpp-qt5"))),Object(o.b)("tr",{parentName:"tbody"},Object(o.b)("td",Object(n.a)({parentName:"tr"},{align:null}),Object(o.b)("inlineCode",{parentName:"td"},"cpprest")),Object(o.b)("td",Object(n.a)({parentName:"tr"},{align:null}),Object(o.b)("inlineCode",{parentName:"td"},"cpp-restsdk"))),Object(o.b)("tr",{parentName:"tbody"},Object(o.b)("td",Object(n.a)({parentName:"tr"},{align:null}),Object(o.b)("inlineCode",{parentName:"td"},"tizen")),Object(o.b)("td",Object(n.a)({parentName:"tr"},{align:null}),Object(o.b)("inlineCode",{parentName:"td"},"cpp-tizen"))),Object(o.b)("tr",{parentName:"tbody"},Object(o.b)("td",Object(n.a)({parentName:"tr"},{align:null}),Object(o.b)("inlineCode",{parentName:"td"},"sinatra")),Object(o.b)("td",Object(n.a)({parentName:"tr"},{align:null}),Object(o.b)("inlineCode",{parentName:"td"},"ruby-sinatra"))),Object(o.b)("tr",{parentName:"tbody"},Object(o.b)("td",Object(n.a)({parentName:"tr"},{align:null}),Object(o.b)("inlineCode",{parentName:"td"},"swift")),Object(o.b)("td",Object(n.a)({parentName:"tr"},{align:null}),Object(o.b)("inlineCode",{parentName:"td"},"swift2-deprecated"))),Object(o.b)("tr",{parentName:"tbody"},Object(o.b)("td",Object(n.a)({parentName:"tr"},{align:null}),Object(o.b)("inlineCode",{parentName:"td"},"lumen")),Object(o.b)("td",Object(n.a)({parentName:"tr"},{align:null}),Object(o.b)("inlineCode",{parentName:"td"},"php-lumen"))),Object(o.b)("tr",{parentName:"tbody"},Object(o.b)("td",Object(n.a)({parentName:"tr"},{align:null}),Object(o.b)("inlineCode",{parentName:"td"},"slim")),Object(o.b)("td",Object(n.a)({parentName:"tr"},{align:null}),Object(o.b)("inlineCode",{parentName:"td"},"php-slim"))),Object(o.b)("tr",{parentName:"tbody"},Object(o.b)("td",Object(n.a)({parentName:"tr"},{align:null}),Object(o.b)("inlineCode",{parentName:"td"},"ze-ph")),Object(o.b)("td",Object(n.a)({parentName:"tr"},{align:null}),Object(o.b)("inlineCode",{parentName:"td"},"php-ze-ph"))),Object(o.b)("tr",{parentName:"tbody"},Object(o.b)("td",Object(n.a)({parentName:"tr"},{align:null}),Object(o.b)("inlineCode",{parentName:"td"},"nancyfx")),Object(o.b)("td",Object(n.a)({parentName:"tr"},{align:null}),Object(o.b)("inlineCode",{parentName:"td"},"csharp-nancyfx"))))),Object(o.b)("p",null,"We provide a temporary mapping in code for these old values. You'll receive a warning with instructions to migrate to the new names."),Object(o.b)("h2",{id:"new-parameters-name"},"New parameters name"),Object(o.b)("p",null,'Some parameters were renamed.\nOften you need to replace "Swagger", with "OpenAPI".\nSome examples:'),Object(o.b)("table",null,Object(o.b)("thead",{parentName:"table"},Object(o.b)("tr",{parentName:"thead"},Object(o.b)("th",Object(n.a)({parentName:"tr"},{align:null}),"name in ",Object(o.b)("inlineCode",{parentName:"th"},"swagger-codegen")),Object(o.b)("th",Object(n.a)({parentName:"tr"},{align:null}),"name in ",Object(o.b)("inlineCode",{parentName:"th"},"openapi-generator")))),Object(o.b)("tbody",{parentName:"table"},Object(o.b)("tr",{parentName:"tbody"},Object(o.b)("td",Object(n.a)({parentName:"tr"},{align:null}),Object(o.b)("inlineCode",{parentName:"td"},"debugSwagger")),Object(o.b)("td",Object(n.a)({parentName:"tr"},{align:null}),Object(o.b)("inlineCode",{parentName:"td"},"debugOpenAPI"))),Object(o.b)("tr",{parentName:"tbody"},Object(o.b)("td",Object(n.a)({parentName:"tr"},{align:null}),Object(o.b)("inlineCode",{parentName:"td"},"GenerateSwaggerMetadata")),Object(o.b)("td",Object(n.a)({parentName:"tr"},{align:null}),Object(o.b)("inlineCode",{parentName:"td"},"GenerateOpenAPIMetadata"))),Object(o.b)("tr",{parentName:"tbody"},Object(o.b)("td",Object(n.a)({parentName:"tr"},{align:null}),Object(o.b)("inlineCode",{parentName:"td"},"swagger.codegen.undertow.apipackage")),Object(o.b)("td",Object(n.a)({parentName:"tr"},{align:null}),Object(o.b)("inlineCode",{parentName:"td"},"openapi.codegen.undertow.apipackage"))),Object(o.b)("tr",{parentName:"tbody"},Object(o.b)("td",Object(n.a)({parentName:"tr"},{align:null}),Object(o.b)("inlineCode",{parentName:"td"},"swagger.codegen.undertow.modelpackage")),Object(o.b)("td",Object(n.a)({parentName:"tr"},{align:null}),Object(o.b)("inlineCode",{parentName:"td"},"openapi.codegen.undertow.modelpackage"))))),Object(o.b)("h2",{id:"renamed-mustache-template-variables"},"Renamed Mustache Template Variables"),Object(o.b)("p",null,"The template variable ",Object(o.b)("inlineCode",{parentName:"p"},"{{datatype}}")," was renamed to ",Object(o.b)("inlineCode",{parentName:"p"},"{{dataType}}")," for consistency reason.\nCorresponding java code: ",Object(o.b)("inlineCode",{parentName:"p"},"CodegenProperty.datatype")," is renamed to ",Object(o.b)("inlineCode",{parentName:"p"},"CodegenProperty.dataType"),"."),Object(o.b)("p",null,"(If you're ",Object(o.b)("strong",{parentName:"p"},"not")," using customized templates with the ",Object(o.b)("inlineCode",{parentName:"p"},"-t")," option, you can ignore the mustache variable renaming above.)"),Object(o.b)("h2",{id:"ignore-file"},"Ignore file"),Object(o.b)("p",null,Object(o.b)("inlineCode",{parentName:"p"},".swagger-codegen-ignore")," is replaced by ",Object(o.b)("inlineCode",{parentName:"p"},".openapi-generator-ignore"),".\nThe syntax inside the file stays the same."),Object(o.b)("p",null,"You don't need to rename the file manually, OpenAPI Generator will do it when your run it against an existing output directory.\n(When there is no ",Object(o.b)("inlineCode",{parentName:"p"},".openapi-generator-ignore")," in a folder, if a ",Object(o.b)("inlineCode",{parentName:"p"},".swagger-codegen-ignore")," file is present it will be considered and renamed to ",Object(o.b)("inlineCode",{parentName:"p"},".openapi-generator-ignore"),")."),Object(o.b)("h2",{id:"metadata-folder"},"Metadata folder"),Object(o.b)("p",null,"The metatata folder (to store the ",Object(o.b)("inlineCode",{parentName:"p"},"VERSION")," file for example) is now called ",Object(o.b)("inlineCode",{parentName:"p"},".openapi-generator/")," instead of ",Object(o.b)("inlineCode",{parentName:"p"},".swagger-codegen/"),"."),Object(o.b)("h2",{id:"new-default-values-for-the-generated-code"},"New default values for the generated code"),Object(o.b)("p",null,"If you use a generator without specifying each parameter, you might see some differences in the generated code.\nAs example the default package name used in the generated code has changed.\nYou need to have a look at the specific value, depending of your target language, but often ",Object(o.b)("inlineCode",{parentName:"p"},"Swagger")," \xees replaced by ",Object(o.b)("inlineCode",{parentName:"p"},"OpenAPITools")," and ",Object(o.b)("inlineCode",{parentName:"p"},"io.swagger")," is replaced by ",Object(o.b)("inlineCode",{parentName:"p"},"org.openapitools"),".\nConcretely if you did not specify anything when you are generating java code, a file ",Object(o.b)("inlineCode",{parentName:"p"},"org/openapitools/api/PetApi.java")," might be generated instead of ",Object(o.b)("inlineCode",{parentName:"p"},"io/swagger/api/PetApi.java"),"."),Object(o.b)("p",null,"If this is a problem for you, you need to explicitly set the the parameter value in order to match with the ",Object(o.b)("inlineCode",{parentName:"p"},"swagger-codgen")," default value (",Object(o.b)("inlineCode",{parentName:"p"},"apiPackage")," == ",Object(o.b)("inlineCode",{parentName:"p"},"io.swagger")," in the previous example with the java generator)."),Object(o.b)("h2",{id:"new-fully-qualified-name-for-the-classes"},"New fully qualified name for the classes"),Object(o.b)("p",null,"If you have extended some generators in your project, and you are looking for a specific class, replace the ",Object(o.b)("inlineCode",{parentName:"p"},"io.swagger.codegen")," package (old name) with ",Object(o.b)("inlineCode",{parentName:"p"},"org.openapitools.codegen")," package (new name)."),Object(o.b)("p",null,"Example: ",Object(o.b)("inlineCode",{parentName:"p"},"org.openapitools.codegen.DefaultGenerator")),Object(o.b)("h2",{id:"body-parameter-name"},"Body parameter name"),Object(o.b)("p",null,"\u203c\ufe0f Since 4.0.0-beta, the body parameter name in OAS v2 is automatically preserved in the vendor extension ",Object(o.b)("inlineCode",{parentName:"p"},"x-codegen-request-body-name")),Object(o.b)("p",null,"In OpenAPI spec v3, there's no body parameter, which is replaced by ",Object(o.b)("a",Object(n.a)({parentName:"p"},{href:"https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.1.md#request-body-object"}),"Request Body Object"),'. The parameter name for Request Body is named automatically based on the model name (e.g. User). To control how the "Request Body" parameter is named, please add the vendor extension ',Object(o.b)("inlineCode",{parentName:"p"},"x-codegen-request-body-name")," to the operation:"),Object(o.b)("p",null,"OpenAPI Spec v3:"),Object(o.b)("pre",null,Object(o.b)("code",Object(n.a)({parentName:"pre"},{className:"language-yaml"}),"paths:\n /pet:\n post:\n tags:\n - pet\n summary: Add a new pet to the store\n description: ''\n operationId: addPet\n x-codegen-request-body-name: new_body_name\n responses:\n '405':\n description: Invalid input\n security:\n - petstore_auth:\n - 'write:pets'\n - 'read:pets'\n requestBody:\n $ref: '#/components/requestBodies/Pet'\n")),Object(o.b)("p",null,"OpenAPI Spec v2:"),Object(o.b)("pre",null,Object(o.b)("code",Object(n.a)({parentName:"pre"},{className:"language-yaml"}),"paths:\n /pet:\n post:\n tags:\n - pet\n summary: Add a new pet to the store\n description: ''\n operationId: addPet\n x-codegen-request-body-name: new_body_name\n consumes:\n - application/json\n - application/xml\n produces:\n - application/xml\n - application/json\n parameters:\n - in: body\n name: body\n description: Pet object that needs to be added to the store\n required: true\n schema:\n $ref: '#/definitions/Pet'\n responses:\n '405':\n description: Invalid input\n security:\n - petstore_auth:\n - 'write:pets'\n - 'read:pets'\n")),Object(o.b)("p",null,"If your API client is using named parameters in the function call (e.g. Perl required & optional parameters, Ruby optional parameters), you will need to add ",Object(o.b)("inlineCode",{parentName:"p"},"x-codegen-request-body-name")," to the spec to restore the original body parameter name."),Object(o.b)("h2",{id:"default-basepath"},"Default basePath"),Object(o.b)("p",null,"The default ",Object(o.b)("inlineCode",{parentName:"p"},"basePath")," has been changed from ",Object(o.b)("inlineCode",{parentName:"p"},"https://localhost")," to ",Object(o.b)("inlineCode",{parentName:"p"},"http://localhost")," (http without s)"),Object(o.b)("h2",{id:"nullable"},"Nullable"),Object(o.b)("p",null,"OpenAPI spec v3 has better support for ",Object(o.b)("inlineCode",{parentName:"p"},"nullable"),". If you're still using OpenAPI/Swagger spec v2, please use ",Object(o.b)("inlineCode",{parentName:"p"},"x-nullable: true")," instead."))}c.isMDXComponent=!0},293:function(e,t,a){"use strict";a.d(t,"a",(function(){return d})),a.d(t,"b",(function(){return O}));var n=a(0),r=a.n(n);function o(e,t,a){return t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}function b(e,t){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),a.push.apply(a,n)}return a}function i(e){for(var t=1;t=0||(r[a]=e[a]);return r}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,a)&&(r[a]=e[a])}return r}var p=r.a.createContext({}),c=function(e){var t=r.a.useContext(p),a=t;return e&&(a="function"==typeof e?e(t):i({},t,{},e)),a},d=function(e){var t=c(e.components);return r.a.createElement(p.Provider,{value:t},e.children)},m={inlineCode:"code",wrapper:function(e){var t=e.children;return r.a.createElement(r.a.Fragment,{},t)}},s=Object(n.forwardRef)((function(e,t){var a=e.components,n=e.mdxType,o=e.originalType,b=e.parentName,p=l(e,["components","mdxType","originalType","parentName"]),d=c(a),s=n,O=d["".concat(b,".").concat(s)]||d[s]||m[s]||o;return a?r.a.createElement(O,i({ref:t},p,{components:a})):r.a.createElement(O,i({ref:t},p))}));function O(e,t){var a=arguments,n=t&&t.mdxType;if("string"==typeof e||n){var o=a.length,b=new Array(o);b[0]=s;var i={};for(var l in t)hasOwnProperty.call(t,l)&&(i[l]=t[l]);i.originalType=e,i.mdxType="string"==typeof e?e:n,b[1]=i;for(var p=2;p=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}var b=a.a.createContext({}),p=function(e){var t=a.a.useContext(b),r=t;return e&&(r="function"==typeof e?e(t):l({},t,{},e)),r},s=function(e){var t=p(e.components);return a.a.createElement(b.Provider,{value:t},e.children)},u={inlineCode:"code",wrapper:function(e){var t=e.children;return a.a.createElement(a.a.Fragment,{},t)}},d=Object(n.forwardRef)((function(e,t){var r=e.components,n=e.mdxType,c=e.originalType,o=e.parentName,b=i(e,["components","mdxType","originalType","parentName"]),s=p(r),d=n,m=s["".concat(o,".").concat(d)]||s[d]||u[d]||c;return r?a.a.createElement(m,l({ref:t},b,{components:r})):a.a.createElement(m,l({ref:t},b))}));function m(e,t){var r=arguments,n=t&&t.mdxType;if("string"==typeof e||n){var c=r.length,o=new Array(c);o[0]=d;var l={};for(var i in t)hasOwnProperty.call(t,i)&&(l[i]=t[i]);l.originalType=e,l.mdxType="string"==typeof e?e:n,o[1]=l;for(var b=2;b=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}var b=a.a.createContext({}),p=function(e){var t=a.a.useContext(b),r=t;return e&&(r="function"==typeof e?e(t):l({},t,{},e)),r},s=function(e){var t=p(e.components);return a.a.createElement(b.Provider,{value:t},e.children)},u={inlineCode:"code",wrapper:function(e){var t=e.children;return a.a.createElement(a.a.Fragment,{},t)}},m=Object(n.forwardRef)((function(e,t){var r=e.components,n=e.mdxType,c=e.originalType,o=e.parentName,b=i(e,["components","mdxType","originalType","parentName"]),s=p(r),m=n,d=s["".concat(o,".").concat(m)]||s[m]||u[m]||c;return r?a.a.createElement(d,l({ref:t},b,{components:r})):a.a.createElement(d,l({ref:t},b))}));function d(e,t){var r=arguments,n=t&&t.mdxType;if("string"==typeof e||n){var c=r.length,o=new Array(c);o[0]=m;var l={};for(var i in t)hasOwnProperty.call(t,i)&&(l[i]=t[i]);l.originalType=e,l.mdxType="string"==typeof e?e:n,o[1]=l;for(var b=2;b=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}var b=a.a.createContext({}),u=function(e){var t=a.a.useContext(b),r=t;return e&&(r="function"==typeof e?e(t):i({},t,{},e)),r},l=function(e){var t=u(e.components);return a.a.createElement(b.Provider,{value:t},e.children)},m={inlineCode:"code",wrapper:function(e){var t=e.children;return a.a.createElement(a.a.Fragment,{},t)}},s=Object(n.forwardRef)((function(e,t){var r=e.components,n=e.mdxType,c=e.originalType,o=e.parentName,b=p(e,["components","mdxType","originalType","parentName"]),l=u(r),s=n,f=l["".concat(o,".").concat(s)]||l[s]||m[s]||c;return r?a.a.createElement(f,i({ref:t},b,{components:r})):a.a.createElement(f,i({ref:t},b))}));function f(e,t){var r=arguments,n=t&&t.mdxType;if("string"==typeof e||n){var c=r.length,o=new Array(c);o[0]=s;var i={};for(var p in t)hasOwnProperty.call(t,p)&&(i[p]=t[p]);i.originalType=e,i.mdxType="string"==typeof e?e:n,o[1]=i;for(var b=2;b=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}var b=a.a.createContext({}),u=function(e){var t=a.a.useContext(b),r=t;return e&&(r="function"==typeof e?e(t):i({},t,{},e)),r},l=function(e){var t=u(e.components);return a.a.createElement(b.Provider,{value:t},e.children)},m={inlineCode:"code",wrapper:function(e){var t=e.children;return a.a.createElement(a.a.Fragment,{},t)}},s=Object(n.forwardRef)((function(e,t){var r=e.components,n=e.mdxType,c=e.originalType,o=e.parentName,b=p(e,["components","mdxType","originalType","parentName"]),l=u(r),s=n,f=l["".concat(o,".").concat(s)]||l[s]||m[s]||c;return r?a.a.createElement(f,i({ref:t},b,{components:r})):a.a.createElement(f,i({ref:t},b))}));function f(e,t){var r=arguments,n=t&&t.mdxType;if("string"==typeof e||n){var c=r.length,o=new Array(c);o[0]=s;var i={};for(var p in t)hasOwnProperty.call(t,p)&&(i[p]=t[p]);i.originalType=e,i.mdxType="string"==typeof e?e:n,o[1]=i;for(var b=2;b - + diff --git a/blog/index.html b/blog/index.html index d36d75a90a6..0bf1c5f9958 100644 --- a/blog/index.html +++ b/blog/index.html @@ -32,7 +32,7 @@ - + diff --git a/d9b8b8b3.59a976fe.js b/d9b8b8b3.59a976fe.js deleted file mode 100644 index 265146b9ed5..00000000000 --- a/d9b8b8b3.59a976fe.js +++ /dev/null @@ -1 +0,0 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[135],{258:function(e,t,n){"use strict";n.r(t),n.d(t,"frontMatter",(function(){return i})),n.d(t,"metadata",(function(){return p})),n.d(t,"rightToc",(function(){return l})),n.d(t,"default",(function(){return b}));var r=n(1),a=n(9),o=(n(0),n(293)),i={id:"integrations",title:"Workflow Integrations"},p={id:"integrations",title:"Workflow Integrations",description:"## Workflow Integration (Maven, Github, CI/CD)",source:"@site/../docs/integration.md",permalink:"/docs/integrations",editUrl:"https://github.com/OpenAPITools/openapi-generator/edit/master/website/../docs/integration.md",lastUpdatedBy:"Tatsuro Shibamura",lastUpdatedAt:1580871108,sidebar:"docs",previous:{title:"Debugging",permalink:"/docs/debugging"},next:{title:"Guidelines For Contributing",permalink:"/docs/contributing"}},l=[{value:"Workflow Integration (Maven, Github, CI/CD)",id:"workflow-integration-maven-github-cicd",children:[{value:"Gradle Integration",id:"gradle-integration",children:[]},{value:"Maven Integration",id:"maven-integration",children:[]},{value:"sbt Integration",id:"sbt-integration",children:[]},{value:"Bazel Integration",id:"bazel-integration",children:[]},{value:"GitHub Integration",id:"github-integration",children:[]},{value:"CI/CD",id:"cicd",children:[]}]}],c={rightToc:l};function b(e){var t=e.components,n=Object(a.a)(e,["components"]);return Object(o.b)("wrapper",Object(r.a)({},c,n,{components:t,mdxType:"MDXLayout"}),Object(o.b)("h2",{id:"workflow-integration-maven-github-cicd"},"Workflow Integration (Maven, Github, CI/CD)"),Object(o.b)("h3",{id:"gradle-integration"},"Gradle Integration"),Object(o.b)("p",null,"See the ",Object(o.b)("a",Object(r.a)({parentName:"p"},{href:"https://github.com/OpenAPITools/openapi-generator/blob/master/modules/openapi-generator-gradle-plugin/README.adoc"}),"openapi-generator-gradle-plugin README")," for details related to configuring and using the Gradle Plugin."),Object(o.b)("p",null,"Supported tasks include:"),Object(o.b)("ul",null,Object(o.b)("li",{parentName:"ul"},"Listing generators"),Object(o.b)("li",{parentName:"ul"},"Validation of Open API 2.0 and 3.0 Specs"),Object(o.b)("li",{parentName:"ul"},'Generating "Meta" generators'),Object(o.b)("li",{parentName:"ul"},"Generating all generators supported by OpenAPI Generator")),Object(o.b)("h3",{id:"maven-integration"},"Maven Integration"),Object(o.b)("p",null,"See the ",Object(o.b)("a",Object(r.a)({parentName:"p"},{href:"https://github.com/OpenAPITools/openapi-generator/blob/master/modules/openapi-generator-maven-plugin/README.md"}),"openapi-generator-maven-plugin README")," for details related to configuring and using the Maven Plugin."),Object(o.b)("h3",{id:"sbt-integration"},"sbt Integration"),Object(o.b)("p",null,"Please refer to ",Object(o.b)("a",Object(r.a)({parentName:"p"},{href:"https://github.com/upstart-commerce/sbt-openapi-generator"}),"https://github.com/upstart-commerce/sbt-openapi-generator")),Object(o.b)("h3",{id:"bazel-integration"},"Bazel Integration"),Object(o.b)("p",null,"Please refer to ",Object(o.b)("a",Object(r.a)({parentName:"p"},{href:"https://github.com/OpenAPITools/openapi-generator-bazel"}),"https://github.com/OpenAPITools/openapi-generator-bazel")),Object(o.b)("h3",{id:"github-integration"},"GitHub Integration"),Object(o.b)("p",null,"To push the auto-generated SDK to GitHub, we provide ",Object(o.b)("inlineCode",{parentName:"p"},"git_push.sh")," to streamline the process. For example:"),Object(o.b)("p",null," 1) Create a new repository in GitHub (Ref: ",Object(o.b)("a",Object(r.a)({parentName:"p"},{href:"https://help.github.com/articles/creating-a-new-repository/"}),"https://help.github.com/articles/creating-a-new-repository/"),")"),Object(o.b)("p",null," 2) Generate the SDK"),Object(o.b)("pre",null,Object(o.b)("code",Object(r.a)({parentName:"pre"},{className:"language-sh"}),' java -jar openapi-generator-cli.jar generate \\\n -i modules/openapi-generator/src/test/resources/2_0/petstore.json -g perl \\\n --git-user-id "wing328" \\\n --git-repo-id "petstore-perl" \\\n --release-note "Github integration demo" \\\n -o /var/tmp/perl/petstore\n')),Object(o.b)("p",null," 3) Push the SDK to GitHub"),Object(o.b)("pre",null,Object(o.b)("code",Object(r.a)({parentName:"pre"},{className:"language-sh"}),"cd /var/tmp/perl/petstore\n/bin/sh ./git_push.sh\n")),Object(o.b)("h3",{id:"cicd"},"CI/CD"),Object(o.b)("p",null,"Some generators also generate CI/CD configuration files (.travis.yml) so that the output will be ready to be tested by the CI (e.g. Travis)"),Object(o.b)("p",null,"If you're looking for the configuration files of a particular CI that is not yet supported, please open an ",Object(o.b)("a",Object(r.a)({parentName:"p"},{href:"https://github.com/openapitools/openapi-generator/issues/new"}),"issue")," to let us know."))}b.isMDXComponent=!0},293:function(e,t,n){"use strict";n.d(t,"a",(function(){return u})),n.d(t,"b",(function(){return d}));var r=n(0),a=n.n(r);function o(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function i(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function p(e){for(var t=1;t=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var c=a.a.createContext({}),b=function(e){var t=a.a.useContext(c),n=t;return e&&(n="function"==typeof e?e(t):p({},t,{},e)),n},u=function(e){var t=b(e.components);return a.a.createElement(c.Provider,{value:t},e.children)},s={inlineCode:"code",wrapper:function(e){var t=e.children;return a.a.createElement(a.a.Fragment,{},t)}},g=Object(r.forwardRef)((function(e,t){var n=e.components,r=e.mdxType,o=e.originalType,i=e.parentName,c=l(e,["components","mdxType","originalType","parentName"]),u=b(n),g=r,d=u["".concat(i,".").concat(g)]||u[g]||s[g]||o;return n?a.a.createElement(d,p({ref:t},c,{components:n})):a.a.createElement(d,p({ref:t},c))}));function d(e,t){var n=arguments,r=t&&t.mdxType;if("string"==typeof e||r){var o=n.length,i=new Array(o);i[0]=g;var p={};for(var l in t)hasOwnProperty.call(t,l)&&(p[l]=t[l]);p.originalType=e,p.mdxType="string"==typeof e?e:r,i[1]=p;for(var c=2;c=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var c=a.a.createContext({}),b=function(e){var t=a.a.useContext(c),n=t;return e&&(n="function"==typeof e?e(t):p({},t,{},e)),n},u=function(e){var t=b(e.components);return a.a.createElement(c.Provider,{value:t},e.children)},s={inlineCode:"code",wrapper:function(e){var t=e.children;return a.a.createElement(a.a.Fragment,{},t)}},g=Object(r.forwardRef)((function(e,t){var n=e.components,r=e.mdxType,o=e.originalType,i=e.parentName,c=l(e,["components","mdxType","originalType","parentName"]),u=b(n),g=r,d=u["".concat(i,".").concat(g)]||u[g]||s[g]||o;return n?a.a.createElement(d,p({ref:t},c,{components:n})):a.a.createElement(d,p({ref:t},c))}));function d(e,t){var n=arguments,r=t&&t.mdxType;if("string"==typeof e||r){var o=n.length,i=new Array(o);i[0]=g;var p={};for(var l in t)hasOwnProperty.call(t,l)&&(p[l]=t[l]);p.originalType=e,p.mdxType="string"==typeof e?e:r,i[1]=p;for(var c=2;c
-

Code of Conduct

Our Pledge

In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation.

Our Standards

Examples of behavior that contributes to creating a positive environment include:

  • Using welcoming and inclusive language
  • Being respectful of differing viewpoints and experiences
  • Gracefully accepting constructive criticism
  • Focusing on what is best for the community
  • Showing empathy towards other community members

Examples of unacceptable behavior by participants include:

  • The use of sexualized language or imagery and unwelcome sexual attention or advances
  • Trolling, insulting/derogatory comments, and personal or political attacks
  • Public or private harassment
  • Publishing others' private information, such as a physical or electronic address, without explicit permission
  • Other conduct which could reasonably be considered inappropriate in a professional setting

Our Responsibilities

Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior.

Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful.

Scope

This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers.

Enforcement

Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at team@openapitools.org. The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately.

Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership.

Attribution

This Code of Conduct is adapted from the Contributor Covenant, version 1.4, available at http://contributor-covenant.org/version/1/4

Last updated on by Tatsuro Shibamura
+

Code of Conduct

Our Pledge

In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation.

Our Standards

Examples of behavior that contributes to creating a positive environment include:

  • Using welcoming and inclusive language
  • Being respectful of differing viewpoints and experiences
  • Gracefully accepting constructive criticism
  • Focusing on what is best for the community
  • Showing empathy towards other community members

Examples of unacceptable behavior by participants include:

  • The use of sexualized language or imagery and unwelcome sexual attention or advances
  • Trolling, insulting/derogatory comments, and personal or political attacks
  • Public or private harassment
  • Publishing others' private information, such as a physical or electronic address, without explicit permission
  • Other conduct which could reasonably be considered inappropriate in a professional setting

Our Responsibilities

Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior.

Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful.

Scope

This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers.

Enforcement

Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at team@openapitools.org. The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately.

Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership.

Attribution

This Code of Conduct is adapted from the Contributor Covenant, version 1.4, available at http://contributor-covenant.org/version/1/4

Last updated on by Akihito Nakano
- + @@ -46,7 +46,7 @@ - + diff --git a/docs/contribute-building/index.html b/docs/contribute-building/index.html index ced792f1ba8..f1d4e2b3527 100644 --- a/docs/contribute-building/index.html +++ b/docs/contribute-building/index.html @@ -28,12 +28,12 @@

Building the code

Using Maven

To build from source, you need the following installed and available in your $PATH:

After cloning the project, you can build it from source with this command:

mvn clean install

If you don't have maven installed, you may directly use the included maven wrapper, and build with the command:

./mvnw clean install

Using Docker

You can use run-in-docker.sh to do all development. This script maps your local repository to /gen -in the docker container. It also maps ~/.m2/repository to the appropriate container location.

To execute mvn package:

git clone https://github.com/openapitools/openapi-generator
cd openapi-generator
./run-in-docker.sh mvn package

Build artifacts are now accessible in your working directory.

Once built, run-in-docker.sh will act as an executable for openapi-generator-cli. To generate code, you'll need to output to a directory under /gen (e.g. /gen/out). For example:

./run-in-docker.sh help # Executes 'help' command for openapi-generator-cli
./run-in-docker.sh list # Executes 'list' command for openapi-generator-cli
./run-in-docker.sh /gen/bin/go-petstore.sh # Builds the Go client
./run-in-docker.sh generate -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml \
-g go -o /gen/out/go-petstore -DpackageName=petstore # generates go client, outputs locally to ./out/go-petstore

Docker in Vagrant

Prerequisite: install Vagrant and VirtualBox.

git clone https://github.com/openapitools/openapi-generator.git
cd openapi-generator
vagrant up
vagrant ssh
cd /vagrant
./run-in-docker.sh mvn package

Troubleshooting

If an error like this occurs, just execute the mvn clean install -U command:

org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.19.1:test (default-test) on project openapi-generator: A type incompatibility occurred while executing org.apache.maven.plugins:maven-surefire-plugin:2.19.1:test: java.lang.ExceptionInInitializerError cannot be cast to java.io.IOException

./run-in-docker.sh mvn clean install -U

Failed to execute goal org.fortasoft:gradle-maven-plugin:1.0.8:invoke (default) on project openapi-generator-gradle-plugin-mvn-wrapper: org.gradle.tooling.BuildException: Could not execute build using Gradle distribution 'https://services.gradle.org/distributions/gradle-4.7-bin.zip'

Right now: no solution for this one :|

Last updated on by Tatsuro Shibamura
+in the docker container. It also maps ~/.m2/repository to the appropriate container location.

To execute mvn package:

git clone https://github.com/openapitools/openapi-generator
cd openapi-generator
./run-in-docker.sh mvn package

Build artifacts are now accessible in your working directory.

Once built, run-in-docker.sh will act as an executable for openapi-generator-cli. To generate code, you'll need to output to a directory under /gen (e.g. /gen/out). For example:

./run-in-docker.sh help # Executes 'help' command for openapi-generator-cli
./run-in-docker.sh list # Executes 'list' command for openapi-generator-cli
./run-in-docker.sh /gen/bin/go-petstore.sh # Builds the Go client
./run-in-docker.sh generate -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml \
-g go -o /gen/out/go-petstore -DpackageName=petstore # generates go client, outputs locally to ./out/go-petstore

Docker in Vagrant

Prerequisite: install Vagrant and VirtualBox.

git clone https://github.com/openapitools/openapi-generator.git
cd openapi-generator
vagrant up
vagrant ssh
cd /vagrant
./run-in-docker.sh mvn package

Troubleshooting

If an error like this occurs, just execute the mvn clean install -U command:

org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.19.1:test (default-test) on project openapi-generator: A type incompatibility occurred while executing org.apache.maven.plugins:maven-surefire-plugin:2.19.1:test: java.lang.ExceptionInInitializerError cannot be cast to java.io.IOException

./run-in-docker.sh mvn clean install -U

Failed to execute goal org.fortasoft:gradle-maven-plugin:1.0.8:invoke (default) on project openapi-generator-gradle-plugin-mvn-wrapper: org.gradle.tooling.BuildException: Could not execute build using Gradle distribution 'https://services.gradle.org/distributions/gradle-4.7-bin.zip'

Right now: no solution for this one :|

Last updated on by Akihito Nakano
- + @@ -47,7 +47,7 @@ in the docker container. It also maps ~/.m2/repository to the appro - + diff --git a/docs/contributing/index.html b/docs/contributing/index.html index 3256ebc15c9..93b82ec0ad9 100644 --- a/docs/contributing/index.html +++ b/docs/contributing/index.html @@ -28,12 +28,12 @@

Guidelines For Contributing

Before submitting an issue

  • If you're not using the latest master to generate API clients or server stubs, please give it another try by pulling the latest master as the issue may have already been addressed. Ref: Getting Started
  • Search the open issue and closed issue to ensure no one else has reported something similar before.
  • File an issue ticket by providing all the required information.
  • Test with the latest master by building the JAR locally to see if the issue has already been addressed.
  • You can also make a suggestion or ask a question by opening an "issue".

Before submitting a PR

  • Search the open issue to ensure no one else has reported something similar and no one is actively working on similar proposed change.
  • If no one has suggested something similar, open an "issue" with your suggestion to gather feedback from the community.
  • If you're adding a new option to a generator, please consider using the -t option with customized templates instead or start a discussion first by opening an issue as we want to avoid adding too many options to the generator.
  • It's recommended to create a new git branch for the change so that the merge commit message looks nicer in the commit history.

How to contribute

git

If you're new to git, you may find the following FAQs useful:

https://github.com/openapitools/openapi-generator/wiki/FAQ#git

Branches

Please file the pull request against the correct branch, e.g. master for non-breaking changes. See the Git Branches page for more information.

Code generators

All the code generators can be found in modules/openapi-generator/src/main/java/org/openapitools/codegen/languages

If you want to add a new generator, follow the new-generator guide.

Templates

All the templates (mustache) can be found in modules/openapi-generator/src/main/resources.

For a list of variables available in the template, please refer to this page

Style guide

Code change should conform to the programming style guide of the respective languages:

For other languages, feel free to suggest.

You may find the current code base not 100% conform to the coding style and we welcome contributions to fix those.

For Vendor Extensions, please follow the naming convention below:

  • For general vendor extension, use lower case and hyphen. e.g. x-is-unique, x-content-type
  • For language-specified vendor extension, put it in the form of x-{lang}-{extension-name}. e.g. x-objc-operation-id, x-java-feign-retry-limit
  • For a list of existing vendor extensions in use, please refer to https://github.com/openapitools/openapi-generator/wiki/Vendor-Extensions. If you've added new vendor extensions as part of your PR, please update the wiki page.

Testing

To add test cases (optional) covering the change in the code generator, please refer to modules/openapi-generator/src/test/java/org/openapitools/codegen

To test the templates, please perform the following:

  • Update the Petstore sample by running the shell scripts under bin and bin/openapi3 folder. For example, run ./bin/python-petstore.sh and ./bin/openapi3/python-petstore.sh to update the Python PetStore API client under samples/client/petstore/python and samples/openapi3/client/petstore/python. For Windows, the batch files can be found under bin\windows folder. (If you find that there are new files generated or unexpected changes as a result of the update, that's not unusual as the test cases are added to the OpenAPI spec from time to time. If you've questions or concerns, please open a ticket to start a discussion)
  • Run the tests in the sample folder using maven mvn integration-test -rf :<artifactId>, e.g. open a shell in samples/client/petstore/python, run mvn integration-test -rf :PythonPetstoreClientTests. The artifactId of the project can be found in the pom.xml file. (some languages may not contain unit testing for Petstore and we're looking for contribution from the community to implement those tests)
  • Finally, git commit the updated samples files: git commit -a -(git add -A if added files with new test cases)
  • For new test cases, please add to the Fake Petstore spec

To start the CI tests, you can run mvn verify -Psamples (assuming you've all the required tools installed to run tests for different languages) or you can leverage http://travis-ci.org to run the CI tests by adding your own openapi-generator repository.

Tips

  • Smaller changes are easier to review
  • [Optional] For bug fixes, provide a OpenAPI Spec to repeat the issue so that the reviewer can use it to confirm the fix
  • Add test case(s) to cover the change
  • Document the fix in the code to make the code more readable
  • Make sure test cases passed after the change (one way is to leverage https://travis-ci.org/ to run the CI tests)
  • File a PR with meaningful title, description and commit messages.
  • Recommended git settings
    • git config core.autocrlf input to tell Git convert CRLF to LF on commit but not the other way around
  • To close an issue (e.g. issue 1542) automatically after a PR is merged, use keywords "fix", "close", "resolve" in the PR description, e.g. fix #1542. (Ref: closing issues using keywords)
Last updated on by Tatsuro Shibamura
+(git add -A if added files with new test cases)
  • For new test cases, please add to the Fake Petstore spec
  • To start the CI tests, you can run mvn verify -Psamples (assuming you've all the required tools installed to run tests for different languages) or you can leverage http://travis-ci.org to run the CI tests by adding your own openapi-generator repository.

    Tips

    • Smaller changes are easier to review
    • [Optional] For bug fixes, provide a OpenAPI Spec to repeat the issue so that the reviewer can use it to confirm the fix
    • Add test case(s) to cover the change
    • Document the fix in the code to make the code more readable
    • Make sure test cases passed after the change (one way is to leverage https://travis-ci.org/ to run the CI tests)
    • File a PR with meaningful title, description and commit messages.
    • Recommended git settings
      • git config core.autocrlf input to tell Git convert CRLF to LF on commit but not the other way around
    • To close an issue (e.g. issue 1542) automatically after a PR is merged, use keywords "fix", "close", "resolve" in the PR description, e.g. fix #1542. (Ref: closing issues using keywords)
    Last updated on by Akihito Nakano
    - + @@ -47,7 +47,7 @@ - + diff --git a/docs/core-team/index.html b/docs/core-team/index.html index 85e37af13e4..0953b960466 100644 --- a/docs/core-team/index.html +++ b/docs/core-team/index.html @@ -27,12 +27,12 @@
    -
    Last updated on by Tatsuro Shibamura
    +
    Last updated on by Akihito Nakano
    - + @@ -46,7 +46,7 @@ - + diff --git a/docs/customization/index.html b/docs/customization/index.html index 21ae8b93fe4..c39e5a14d00 100644 --- a/docs/customization/index.html +++ b/docs/customization/index.html @@ -37,7 +37,7 @@ refer back to your classes. Note, this may not apply to all languages...

    - + diff --git a/docs/debugging/index.html b/docs/debugging/index.html index e0040e3179d..9547ade5e1c 100644 --- a/docs/debugging/index.html +++ b/docs/debugging/index.html @@ -27,12 +27,12 @@

    -

    Debugging

    Templates

    Sometimes, you may have issues with variables in your templates. As discussed in the templating docs, we offer a variety of system properties for inspecting the models bound to templates.

    -DdebugOpenAPI
    Prints out the JSON model of the OpenAPI Document, as seen by OpenAPI Generator
    -DdebugModels
    Prints out the JSON model passed to model templates
    -DdebugOperations
    Prints out the JSON model passed to operation (api) templates
    -DdebugSupportingFiles
    Prints out the JSON model passed to supporting files

    One or more of these properties can be passed alongside other command line options:

    openapi-generator generate -g go \
    -o out \
    -i petstore-minimal.yaml \
    -DdebugModels \
    -DdebugOperations

    Or you can add these to your JAVA_OPTS environment variable (this applies to every invocation of the tool):

    export JAVA_OPTS="${JAVA_OPTS} -DdebugModels -DdebugOperations"

    NOTE: Globally available system options like these will apply to all invocations of the generator (CLI and plugins)

    Runtime

    When you're working with a custom generator, a new generator, or otherwise trying to understand the behavior of the toolset, you may need to attach a remote debugger in order to step through the code.

    The steps are shown here for a specific version of the generator, but apply the same if you're working off master or a feature branch.

    • Determine the version of openapi-generator you're using. For the CLI, this is:
      openapi-generator version
    • Navigate to the openapi-generator source directory (see building docs for obtaining source code and brief introduction).
    • Checkout the branch/tag for the target version. Branches are not prefixed, but tags are prefixed with a v. For instance if you're using version 3.3.0, you will execute:
      git checkout v3.3.0
    • Open the project in your IDE.
    • Setup your IDE for remote debugging. You'll want to define a port used for connecting the remote debugger. For this example, we'll use 5005. See external tutorials for IntelliJ and Eclipse
    • Export the debug configuration, specifying suspend=y so you have time to attach a remote debugger. These are passed as Java system properties, either on command line or as part of the JAVA_OPTS environment variable. This will look like:
      export JAVA_OPTS="${JAVA_OPTS} -agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=5005"
    • Execute the generator with your desired options. You should see the application output only
      Listening for transport dt_socket at address: 5005
    • Set breakpoints in code, and then attach your remote debugger from your IDE (see above). The generator will automatically unblock once the remote debugger is attached. You can now step through the code.

    Logs

    You can try to enable debugging log with -Dlog.level=debug option to the JAVA_OPTS environment variable to see more information:

    export JAVA_OPTS="${JAVA_OPTS} -Dlog.level=debug"

    Set the option then DEBUG logs are printed out:

    openapi-generator generate -g go ...
    ...
    ...
    [main] DEBUG o.o.codegen.DefaultCodegen - debugging fromProperty for files : class Schema {
    type: null
    format: null
    $ref: #/components/schemas/File
    ...
    ...
    Last updated on by Tatsuro Shibamura
    +

    Debugging

    Templates

    Sometimes, you may have issues with variables in your templates. As discussed in the templating docs, we offer a variety of system properties for inspecting the models bound to templates.

    -DdebugOpenAPI
    Prints out the JSON model of the OpenAPI Document, as seen by OpenAPI Generator
    -DdebugModels
    Prints out the JSON model passed to model templates
    -DdebugOperations
    Prints out the JSON model passed to operation (api) templates
    -DdebugSupportingFiles
    Prints out the JSON model passed to supporting files

    One or more of these properties can be passed alongside other command line options:

    openapi-generator generate -g go \
    -o out \
    -i petstore-minimal.yaml \
    -DdebugModels \
    -DdebugOperations

    Or you can add these to your JAVA_OPTS environment variable (this applies to every invocation of the tool):

    export JAVA_OPTS="${JAVA_OPTS} -DdebugModels -DdebugOperations"

    NOTE: Globally available system options like these will apply to all invocations of the generator (CLI and plugins)

    Runtime

    When you're working with a custom generator, a new generator, or otherwise trying to understand the behavior of the toolset, you may need to attach a remote debugger in order to step through the code.

    The steps are shown here for a specific version of the generator, but apply the same if you're working off master or a feature branch.

    • Determine the version of openapi-generator you're using. For the CLI, this is:
      openapi-generator version
    • Navigate to the openapi-generator source directory (see building docs for obtaining source code and brief introduction).
    • Checkout the branch/tag for the target version. Branches are not prefixed, but tags are prefixed with a v. For instance if you're using version 3.3.0, you will execute:
      git checkout v3.3.0
    • Open the project in your IDE.
    • Setup your IDE for remote debugging. You'll want to define a port used for connecting the remote debugger. For this example, we'll use 5005. See external tutorials for IntelliJ and Eclipse
    • Export the debug configuration, specifying suspend=y so you have time to attach a remote debugger. These are passed as Java system properties, either on command line or as part of the JAVA_OPTS environment variable. This will look like:
      export JAVA_OPTS="${JAVA_OPTS} -agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=5005"
    • Execute the generator with your desired options. You should see the application output only
      Listening for transport dt_socket at address: 5005
    • Set breakpoints in code, and then attach your remote debugger from your IDE (see above). The generator will automatically unblock once the remote debugger is attached. You can now step through the code.

    Logs

    You can try to enable debugging log with -Dlog.level=debug option to the JAVA_OPTS environment variable to see more information:

    export JAVA_OPTS="${JAVA_OPTS} -Dlog.level=debug"

    Set the option then DEBUG logs are printed out:

    openapi-generator generate -g go ...
    ...
    ...
    [main] DEBUG o.o.codegen.DefaultCodegen - debugging fromProperty for files : class Schema {
    type: null
    format: null
    $ref: #/components/schemas/File
    ...
    ...
    Last updated on by Akihito Nakano
    - + @@ -46,7 +46,7 @@ - + diff --git a/docs/faq-contributing/index.html b/docs/faq-contributing/index.html index a3dc30b3fbd..be383474581 100644 --- a/docs/faq-contributing/index.html +++ b/docs/faq-contributing/index.html @@ -38,7 +38,7 @@ - + diff --git a/docs/faq-extending/index.html b/docs/faq-extending/index.html index 53eb03d9afc..2eaa7973c8c 100644 --- a/docs/faq-extending/index.html +++ b/docs/faq-extending/index.html @@ -32,7 +32,7 @@ - + diff --git a/docs/faq-generators/index.html b/docs/faq-generators/index.html index ffe60654409..b5d7ee95f92 100644 --- a/docs/faq-generators/index.html +++ b/docs/faq-generators/index.html @@ -32,7 +32,7 @@ - + diff --git a/docs/faq/index.html b/docs/faq/index.html index e477bcc3ca7..340d9dc7f78 100644 --- a/docs/faq/index.html +++ b/docs/faq/index.html @@ -32,7 +32,7 @@ - + diff --git a/docs/fork-qna/index.html b/docs/fork-qna/index.html index d6126ec5e7e..7f9727ec36b 100644 --- a/docs/fork-qna/index.html +++ b/docs/fork-qna/index.html @@ -32,7 +32,7 @@ - + diff --git a/docs/generators/README/index.html b/docs/generators/README/index.html index 1327c6d9272..23b5c1f7efe 100644 --- a/docs/generators/README/index.html +++ b/docs/generators/README/index.html @@ -27,12 +27,12 @@
    -

    README

    The following generators are available:

    CLIENT generators

    SERVER generators

    DOCUMENTATION generators

    SCHEMA generators

    CONFIG generators

    Last updated on by Tatsuro Shibamura
    +

    README

    The following generators are available:

    CLIENT generators

    SERVER generators

    DOCUMENTATION generators

    SCHEMA generators

    CONFIG generators

    Last updated on by Akihito Nakano
    - + @@ -46,7 +46,7 @@ - + diff --git a/docs/generators/ada-server/index.html b/docs/generators/ada-server/index.html index fbbc693c5e0..deeec1a402d 100644 --- a/docs/generators/ada-server/index.html +++ b/docs/generators/ada-server/index.html @@ -32,7 +32,7 @@ - + diff --git a/docs/generators/ada/index.html b/docs/generators/ada/index.html index b31011f8ffe..0b357051c86 100644 --- a/docs/generators/ada/index.html +++ b/docs/generators/ada/index.html @@ -32,7 +32,7 @@ - + diff --git a/docs/generators/android/index.html b/docs/generators/android/index.html index ac64808afb0..052c9c1c6d9 100644 --- a/docs/generators/android/index.html +++ b/docs/generators/android/index.html @@ -32,7 +32,7 @@ - + diff --git a/docs/generators/apache2/index.html b/docs/generators/apache2/index.html index c6355d4402c..6cff7828175 100644 --- a/docs/generators/apache2/index.html +++ b/docs/generators/apache2/index.html @@ -32,7 +32,7 @@ - + diff --git a/docs/generators/apex/index.html b/docs/generators/apex/index.html index 0949819ef3a..445b66c0c09 100644 --- a/docs/generators/apex/index.html +++ b/docs/generators/apex/index.html @@ -32,7 +32,7 @@ - + diff --git a/docs/generators/asciidoc/index.html b/docs/generators/asciidoc/index.html index e9f2595a03f..ad8c7d0e81b 100644 --- a/docs/generators/asciidoc/index.html +++ b/docs/generators/asciidoc/index.html @@ -32,7 +32,7 @@ - + diff --git a/docs/generators/aspnetcore/index.html b/docs/generators/aspnetcore/index.html index b4678dfb506..60f141224f9 100644 --- a/docs/generators/aspnetcore/index.html +++ b/docs/generators/aspnetcore/index.html @@ -32,7 +32,7 @@ - + diff --git a/docs/generators/avro-schema/index.html b/docs/generators/avro-schema/index.html index 7dec6d3933d..4c0f0b074d2 100644 --- a/docs/generators/avro-schema/index.html +++ b/docs/generators/avro-schema/index.html @@ -32,7 +32,7 @@ - + diff --git a/docs/generators/bash/index.html b/docs/generators/bash/index.html index e1a0999e7b8..6ede3f83529 100644 --- a/docs/generators/bash/index.html +++ b/docs/generators/bash/index.html @@ -32,7 +32,7 @@ - + diff --git a/docs/generators/c/index.html b/docs/generators/c/index.html index 39fa37aaac0..c7e07dd231c 100644 --- a/docs/generators/c/index.html +++ b/docs/generators/c/index.html @@ -32,7 +32,7 @@ - + diff --git a/docs/generators/clojure/index.html b/docs/generators/clojure/index.html index 7fb590a7f7d..5bd9346a89f 100644 --- a/docs/generators/clojure/index.html +++ b/docs/generators/clojure/index.html @@ -32,7 +32,7 @@ - + diff --git a/docs/generators/cpp-pistache-server/index.html b/docs/generators/cpp-pistache-server/index.html index 3721c1cdbb6..742589f9325 100644 --- a/docs/generators/cpp-pistache-server/index.html +++ b/docs/generators/cpp-pistache-server/index.html @@ -32,7 +32,7 @@ - + diff --git a/docs/generators/cpp-qt5-client/index.html b/docs/generators/cpp-qt5-client/index.html index b913fe7730e..22f594c30ab 100644 --- a/docs/generators/cpp-qt5-client/index.html +++ b/docs/generators/cpp-qt5-client/index.html @@ -32,7 +32,7 @@ - + diff --git a/docs/generators/cpp-qt5-qhttpengine-server/index.html b/docs/generators/cpp-qt5-qhttpengine-server/index.html index 833a40283a6..19c750f72fd 100644 --- a/docs/generators/cpp-qt5-qhttpengine-server/index.html +++ b/docs/generators/cpp-qt5-qhttpengine-server/index.html @@ -32,7 +32,7 @@ - + diff --git a/docs/generators/cpp-restbed-server/index.html b/docs/generators/cpp-restbed-server/index.html index 2c779e50671..95835bfaca6 100644 --- a/docs/generators/cpp-restbed-server/index.html +++ b/docs/generators/cpp-restbed-server/index.html @@ -32,7 +32,7 @@ - + diff --git a/docs/generators/cpp-restsdk/index.html b/docs/generators/cpp-restsdk/index.html index 65582373d31..d80a9b108fe 100644 --- a/docs/generators/cpp-restsdk/index.html +++ b/docs/generators/cpp-restsdk/index.html @@ -32,7 +32,7 @@ - + diff --git a/docs/generators/cpp-tizen/index.html b/docs/generators/cpp-tizen/index.html index 457635f629a..fe5a721475b 100644 --- a/docs/generators/cpp-tizen/index.html +++ b/docs/generators/cpp-tizen/index.html @@ -32,7 +32,7 @@ - + diff --git a/docs/generators/csharp-dotnet2/index.html b/docs/generators/csharp-dotnet2/index.html index 06bf20b7438..0cce04dd4a4 100644 --- a/docs/generators/csharp-dotnet2/index.html +++ b/docs/generators/csharp-dotnet2/index.html @@ -32,7 +32,7 @@ - + diff --git a/docs/generators/csharp-nancyfx/index.html b/docs/generators/csharp-nancyfx/index.html index be03371309c..98e30e5ab29 100644 --- a/docs/generators/csharp-nancyfx/index.html +++ b/docs/generators/csharp-nancyfx/index.html @@ -32,7 +32,7 @@ - + diff --git a/docs/generators/csharp-netcore/index.html b/docs/generators/csharp-netcore/index.html index 556596e8582..fdf04e391a6 100644 --- a/docs/generators/csharp-netcore/index.html +++ b/docs/generators/csharp-netcore/index.html @@ -32,7 +32,7 @@ - + diff --git a/docs/generators/csharp/index.html b/docs/generators/csharp/index.html index 27f887d9a78..ae5f3f955dd 100644 --- a/docs/generators/csharp/index.html +++ b/docs/generators/csharp/index.html @@ -32,7 +32,7 @@ - + diff --git a/docs/generators/cwiki/index.html b/docs/generators/cwiki/index.html index 20167dcc7fb..11259533f3b 100644 --- a/docs/generators/cwiki/index.html +++ b/docs/generators/cwiki/index.html @@ -32,7 +32,7 @@ - + diff --git a/docs/generators/dart-dio/index.html b/docs/generators/dart-dio/index.html index a40bd7a09a8..8061957bf33 100644 --- a/docs/generators/dart-dio/index.html +++ b/docs/generators/dart-dio/index.html @@ -32,7 +32,7 @@ - + diff --git a/docs/generators/dart-jaguar/index.html b/docs/generators/dart-jaguar/index.html index c4d076f0cda..7307d12073b 100644 --- a/docs/generators/dart-jaguar/index.html +++ b/docs/generators/dart-jaguar/index.html @@ -32,7 +32,7 @@ - + diff --git a/docs/generators/dart/index.html b/docs/generators/dart/index.html index 4424cf95ece..256cc4fc75e 100644 --- a/docs/generators/dart/index.html +++ b/docs/generators/dart/index.html @@ -32,7 +32,7 @@ - + diff --git a/docs/generators/dynamic-html/index.html b/docs/generators/dynamic-html/index.html index 2c340b9898a..71f4298bf8c 100644 --- a/docs/generators/dynamic-html/index.html +++ b/docs/generators/dynamic-html/index.html @@ -32,7 +32,7 @@ - + diff --git a/docs/generators/eiffel/index.html b/docs/generators/eiffel/index.html index 42e2087bfb2..9569b59893e 100644 --- a/docs/generators/eiffel/index.html +++ b/docs/generators/eiffel/index.html @@ -32,7 +32,7 @@ - + diff --git a/docs/generators/elixir/index.html b/docs/generators/elixir/index.html index e94c4465e46..0de6193e848 100644 --- a/docs/generators/elixir/index.html +++ b/docs/generators/elixir/index.html @@ -32,7 +32,7 @@ - + diff --git a/docs/generators/elm/index.html b/docs/generators/elm/index.html index 7715b3fe829..be5ba73c920 100644 --- a/docs/generators/elm/index.html +++ b/docs/generators/elm/index.html @@ -32,7 +32,7 @@ - + diff --git a/docs/generators/erlang-client/index.html b/docs/generators/erlang-client/index.html index 89179d18728..66b4c212151 100644 --- a/docs/generators/erlang-client/index.html +++ b/docs/generators/erlang-client/index.html @@ -32,7 +32,7 @@ - + diff --git a/docs/generators/erlang-proper/index.html b/docs/generators/erlang-proper/index.html index 489a70c64e2..cd7f7d06453 100644 --- a/docs/generators/erlang-proper/index.html +++ b/docs/generators/erlang-proper/index.html @@ -32,7 +32,7 @@ - + diff --git a/docs/generators/erlang-server/index.html b/docs/generators/erlang-server/index.html index 634837297b3..43f8c31404f 100644 --- a/docs/generators/erlang-server/index.html +++ b/docs/generators/erlang-server/index.html @@ -32,7 +32,7 @@ - + diff --git a/docs/generators/flash/index.html b/docs/generators/flash/index.html index fee1016a5fb..a4424fcbb0f 100644 --- a/docs/generators/flash/index.html +++ b/docs/generators/flash/index.html @@ -32,7 +32,7 @@ - + diff --git a/docs/generators/fsharp-functions/index.html b/docs/generators/fsharp-functions/index.html index 148aa470f52..bd8899bd886 100644 --- a/docs/generators/fsharp-functions/index.html +++ b/docs/generators/fsharp-functions/index.html @@ -32,7 +32,7 @@ - + diff --git a/docs/generators/fsharp-giraffe-server/index.html b/docs/generators/fsharp-giraffe-server/index.html index a174b6fda92..8d36c465884 100644 --- a/docs/generators/fsharp-giraffe-server/index.html +++ b/docs/generators/fsharp-giraffe-server/index.html @@ -32,7 +32,7 @@ - + diff --git a/docs/generators/go-experimental/index.html b/docs/generators/go-experimental/index.html index f12003ff781..9e142ba2084 100644 --- a/docs/generators/go-experimental/index.html +++ b/docs/generators/go-experimental/index.html @@ -32,7 +32,7 @@ - + diff --git a/docs/generators/go-gin-server/index.html b/docs/generators/go-gin-server/index.html index 0696477016e..f3469507fac 100644 --- a/docs/generators/go-gin-server/index.html +++ b/docs/generators/go-gin-server/index.html @@ -32,7 +32,7 @@ - + diff --git a/docs/generators/go-server/index.html b/docs/generators/go-server/index.html index 05d12b4cf9c..2fcf473d1ff 100644 --- a/docs/generators/go-server/index.html +++ b/docs/generators/go-server/index.html @@ -32,7 +32,7 @@ - + diff --git a/docs/generators/go/index.html b/docs/generators/go/index.html index 86b58fec4f5..0487cd37d69 100644 --- a/docs/generators/go/index.html +++ b/docs/generators/go/index.html @@ -32,7 +32,7 @@ - + diff --git a/docs/generators/graphql-nodejs-express-server/index.html b/docs/generators/graphql-nodejs-express-server/index.html index 7f5b66e6dfc..6e620deb867 100644 --- a/docs/generators/graphql-nodejs-express-server/index.html +++ b/docs/generators/graphql-nodejs-express-server/index.html @@ -32,7 +32,7 @@ - + diff --git a/docs/generators/graphql-schema/index.html b/docs/generators/graphql-schema/index.html index ea25e984ad0..a41362669c6 100644 --- a/docs/generators/graphql-schema/index.html +++ b/docs/generators/graphql-schema/index.html @@ -32,7 +32,7 @@ - + diff --git a/docs/generators/groovy/index.html b/docs/generators/groovy/index.html index f44a91226a8..162e1ba3a24 100644 --- a/docs/generators/groovy/index.html +++ b/docs/generators/groovy/index.html @@ -32,7 +32,7 @@ - + diff --git a/docs/generators/haskell-http-client/index.html b/docs/generators/haskell-http-client/index.html index 92bba705ecf..45f96e9d210 100644 --- a/docs/generators/haskell-http-client/index.html +++ b/docs/generators/haskell-http-client/index.html @@ -32,7 +32,7 @@ - + diff --git a/docs/generators/haskell/index.html b/docs/generators/haskell/index.html index 32e81c3b4f8..8a4231cf797 100644 --- a/docs/generators/haskell/index.html +++ b/docs/generators/haskell/index.html @@ -32,7 +32,7 @@ - + diff --git a/docs/generators/html/index.html b/docs/generators/html/index.html index 4dbbb8f05e9..4758dd788a1 100644 --- a/docs/generators/html/index.html +++ b/docs/generators/html/index.html @@ -32,7 +32,7 @@ - + diff --git a/docs/generators/html2/index.html b/docs/generators/html2/index.html index 7bcc24ce706..dcb835a3c8b 100644 --- a/docs/generators/html2/index.html +++ b/docs/generators/html2/index.html @@ -32,7 +32,7 @@ - + diff --git a/docs/generators/index.html b/docs/generators/index.html index 95be8292340..6226acb9faa 100644 --- a/docs/generators/index.html +++ b/docs/generators/index.html @@ -27,12 +27,12 @@
    -

    Generators List

    The following generators are available:

    CLIENT generators

    SERVER generators

    DOCUMENTATION generators

    SCHEMA generators

    CONFIG generators

    Last updated on by Tatsuro Shibamura
    +

    Generators List

    The following generators are available:

    CLIENT generators

    SERVER generators

    DOCUMENTATION generators

    SCHEMA generators

    CONFIG generators

    Last updated on by Akihito Nakano
    - + @@ -46,7 +46,7 @@ - + diff --git a/docs/generators/java-inflector/index.html b/docs/generators/java-inflector/index.html index 35722719d36..dcf5e036577 100644 --- a/docs/generators/java-inflector/index.html +++ b/docs/generators/java-inflector/index.html @@ -32,7 +32,7 @@ - + diff --git a/docs/generators/java-msf4j/index.html b/docs/generators/java-msf4j/index.html index f4a78ab7396..7beecd0e3a5 100644 --- a/docs/generators/java-msf4j/index.html +++ b/docs/generators/java-msf4j/index.html @@ -32,7 +32,7 @@ - + diff --git a/docs/generators/java-pkmst/index.html b/docs/generators/java-pkmst/index.html index 1a96e18025d..7928e3316cc 100644 --- a/docs/generators/java-pkmst/index.html +++ b/docs/generators/java-pkmst/index.html @@ -32,7 +32,7 @@ - + diff --git a/docs/generators/java-play-framework/index.html b/docs/generators/java-play-framework/index.html index 4a7521bd4fc..3d6c797c484 100644 --- a/docs/generators/java-play-framework/index.html +++ b/docs/generators/java-play-framework/index.html @@ -32,7 +32,7 @@ - + diff --git a/docs/generators/java-undertow-server/index.html b/docs/generators/java-undertow-server/index.html index ca6a3e514c1..c2650bdff03 100644 --- a/docs/generators/java-undertow-server/index.html +++ b/docs/generators/java-undertow-server/index.html @@ -32,7 +32,7 @@ - + diff --git a/docs/generators/java-vertx-web/index.html b/docs/generators/java-vertx-web/index.html index b3fb2afca09..2b1617f42c3 100644 --- a/docs/generators/java-vertx-web/index.html +++ b/docs/generators/java-vertx-web/index.html @@ -32,7 +32,7 @@ - + diff --git a/docs/generators/java-vertx/index.html b/docs/generators/java-vertx/index.html index 2b8510415b7..4da8bd61baa 100644 --- a/docs/generators/java-vertx/index.html +++ b/docs/generators/java-vertx/index.html @@ -32,7 +32,7 @@ - + diff --git a/docs/generators/java/index.html b/docs/generators/java/index.html index 538b4c2e4ca..9cc3defece1 100644 --- a/docs/generators/java/index.html +++ b/docs/generators/java/index.html @@ -32,7 +32,7 @@ - + diff --git a/docs/generators/javascript-closure-angular/index.html b/docs/generators/javascript-closure-angular/index.html index a4a57f8044c..be1e9ba1e98 100644 --- a/docs/generators/javascript-closure-angular/index.html +++ b/docs/generators/javascript-closure-angular/index.html @@ -32,7 +32,7 @@ - + diff --git a/docs/generators/javascript-flowtyped/index.html b/docs/generators/javascript-flowtyped/index.html index 8f69807a852..42f49606795 100644 --- a/docs/generators/javascript-flowtyped/index.html +++ b/docs/generators/javascript-flowtyped/index.html @@ -32,7 +32,7 @@ - + diff --git a/docs/generators/javascript/index.html b/docs/generators/javascript/index.html index 39479c1974f..3bc560eeeee 100644 --- a/docs/generators/javascript/index.html +++ b/docs/generators/javascript/index.html @@ -32,7 +32,7 @@ - + diff --git a/docs/generators/jaxrs-cxf-cdi/index.html b/docs/generators/jaxrs-cxf-cdi/index.html index 0c8848367a7..9f151aecb83 100644 --- a/docs/generators/jaxrs-cxf-cdi/index.html +++ b/docs/generators/jaxrs-cxf-cdi/index.html @@ -32,7 +32,7 @@ - + diff --git a/docs/generators/jaxrs-cxf-client/index.html b/docs/generators/jaxrs-cxf-client/index.html index e0e33ecb2ff..d6884105eb1 100644 --- a/docs/generators/jaxrs-cxf-client/index.html +++ b/docs/generators/jaxrs-cxf-client/index.html @@ -32,7 +32,7 @@ - + diff --git a/docs/generators/jaxrs-cxf-extended/index.html b/docs/generators/jaxrs-cxf-extended/index.html index 7628082d5c3..048f8b21122 100644 --- a/docs/generators/jaxrs-cxf-extended/index.html +++ b/docs/generators/jaxrs-cxf-extended/index.html @@ -32,7 +32,7 @@ - + diff --git a/docs/generators/jaxrs-cxf/index.html b/docs/generators/jaxrs-cxf/index.html index 45bba4dca6e..2e3cbfec2c7 100644 --- a/docs/generators/jaxrs-cxf/index.html +++ b/docs/generators/jaxrs-cxf/index.html @@ -32,7 +32,7 @@ - + diff --git a/docs/generators/jaxrs-jersey/index.html b/docs/generators/jaxrs-jersey/index.html index 6614e46ea0c..0981f60fe38 100644 --- a/docs/generators/jaxrs-jersey/index.html +++ b/docs/generators/jaxrs-jersey/index.html @@ -32,7 +32,7 @@ - + diff --git a/docs/generators/jaxrs-resteasy-eap/index.html b/docs/generators/jaxrs-resteasy-eap/index.html index cc248039ecf..3884a2b6ab4 100644 --- a/docs/generators/jaxrs-resteasy-eap/index.html +++ b/docs/generators/jaxrs-resteasy-eap/index.html @@ -32,7 +32,7 @@ - + diff --git a/docs/generators/jaxrs-resteasy/index.html b/docs/generators/jaxrs-resteasy/index.html index 836cae0e5a8..1c42a314f02 100644 --- a/docs/generators/jaxrs-resteasy/index.html +++ b/docs/generators/jaxrs-resteasy/index.html @@ -32,7 +32,7 @@ - + diff --git a/docs/generators/jaxrs-spec/index.html b/docs/generators/jaxrs-spec/index.html index a7d845f681a..eeb08e5916a 100644 --- a/docs/generators/jaxrs-spec/index.html +++ b/docs/generators/jaxrs-spec/index.html @@ -32,7 +32,7 @@ - + diff --git a/docs/generators/jmeter/index.html b/docs/generators/jmeter/index.html index 20fffc2d6ee..1a114be9f9c 100644 --- a/docs/generators/jmeter/index.html +++ b/docs/generators/jmeter/index.html @@ -32,7 +32,7 @@ - + diff --git a/docs/generators/kotlin-server/index.html b/docs/generators/kotlin-server/index.html index 8085353fdda..83f9791a885 100644 --- a/docs/generators/kotlin-server/index.html +++ b/docs/generators/kotlin-server/index.html @@ -32,7 +32,7 @@ - + diff --git a/docs/generators/kotlin-spring/index.html b/docs/generators/kotlin-spring/index.html index f41c36abf39..0de5a33586e 100644 --- a/docs/generators/kotlin-spring/index.html +++ b/docs/generators/kotlin-spring/index.html @@ -32,7 +32,7 @@ - + diff --git a/docs/generators/kotlin-vertx/index.html b/docs/generators/kotlin-vertx/index.html index 6c898680aa4..e62a189dd35 100644 --- a/docs/generators/kotlin-vertx/index.html +++ b/docs/generators/kotlin-vertx/index.html @@ -32,7 +32,7 @@ - + diff --git a/docs/generators/kotlin/index.html b/docs/generators/kotlin/index.html index c27939606b5..17116e0ad80 100644 --- a/docs/generators/kotlin/index.html +++ b/docs/generators/kotlin/index.html @@ -32,7 +32,7 @@ - + diff --git a/docs/generators/lua/index.html b/docs/generators/lua/index.html index 48a8b60a2d8..28630504fa0 100644 --- a/docs/generators/lua/index.html +++ b/docs/generators/lua/index.html @@ -32,7 +32,7 @@ - + diff --git a/docs/generators/markdown/index.html b/docs/generators/markdown/index.html index 0ab77d3f5f8..6b85f8515e7 100644 --- a/docs/generators/markdown/index.html +++ b/docs/generators/markdown/index.html @@ -32,7 +32,7 @@ - + diff --git a/docs/generators/mysql-schema/index.html b/docs/generators/mysql-schema/index.html index d54c4aa8fd3..a20bd9d04a5 100644 --- a/docs/generators/mysql-schema/index.html +++ b/docs/generators/mysql-schema/index.html @@ -32,7 +32,7 @@ - + diff --git a/docs/generators/nim/index.html b/docs/generators/nim/index.html index 2b914e65aff..e5d306c5eef 100644 --- a/docs/generators/nim/index.html +++ b/docs/generators/nim/index.html @@ -32,7 +32,7 @@ - + diff --git a/docs/generators/nodejs-express-server/index.html b/docs/generators/nodejs-express-server/index.html index bd7c41450bb..f1e1ef47245 100644 --- a/docs/generators/nodejs-express-server/index.html +++ b/docs/generators/nodejs-express-server/index.html @@ -32,7 +32,7 @@ - + diff --git a/docs/generators/nodejs-server-deprecated/index.html b/docs/generators/nodejs-server-deprecated/index.html index 9ca23b03884..6bc028730f5 100644 --- a/docs/generators/nodejs-server-deprecated/index.html +++ b/docs/generators/nodejs-server-deprecated/index.html @@ -32,7 +32,7 @@ - + diff --git a/docs/generators/objc/index.html b/docs/generators/objc/index.html index 0f763cec240..01943d004c3 100644 --- a/docs/generators/objc/index.html +++ b/docs/generators/objc/index.html @@ -32,7 +32,7 @@ - + diff --git a/docs/generators/ocaml/index.html b/docs/generators/ocaml/index.html index f5f3e2058a1..d5589fb01dd 100644 --- a/docs/generators/ocaml/index.html +++ b/docs/generators/ocaml/index.html @@ -32,7 +32,7 @@ - + diff --git a/docs/generators/openapi-yaml/index.html b/docs/generators/openapi-yaml/index.html index 25198be466e..922ce77897b 100644 --- a/docs/generators/openapi-yaml/index.html +++ b/docs/generators/openapi-yaml/index.html @@ -32,7 +32,7 @@ - + diff --git a/docs/generators/openapi/index.html b/docs/generators/openapi/index.html index f417e5773fc..288caa69ac9 100644 --- a/docs/generators/openapi/index.html +++ b/docs/generators/openapi/index.html @@ -32,7 +32,7 @@ - + diff --git a/docs/generators/perl/index.html b/docs/generators/perl/index.html index 70cf8550934..0a1f3ac78f2 100644 --- a/docs/generators/perl/index.html +++ b/docs/generators/perl/index.html @@ -32,7 +32,7 @@ - + diff --git a/docs/generators/php-laravel/index.html b/docs/generators/php-laravel/index.html index a317ac17662..cdfd4bd79d0 100644 --- a/docs/generators/php-laravel/index.html +++ b/docs/generators/php-laravel/index.html @@ -32,7 +32,7 @@ - + diff --git a/docs/generators/php-lumen/index.html b/docs/generators/php-lumen/index.html index 805dd726d37..4d49216156f 100644 --- a/docs/generators/php-lumen/index.html +++ b/docs/generators/php-lumen/index.html @@ -32,7 +32,7 @@ - + diff --git a/docs/generators/php-silex/index.html b/docs/generators/php-silex/index.html index 9c70ce2118a..fa707b2c449 100644 --- a/docs/generators/php-silex/index.html +++ b/docs/generators/php-silex/index.html @@ -32,7 +32,7 @@ - + diff --git a/docs/generators/php-slim-deprecated/index.html b/docs/generators/php-slim-deprecated/index.html index 2683de80ab7..357b22150aa 100644 --- a/docs/generators/php-slim-deprecated/index.html +++ b/docs/generators/php-slim-deprecated/index.html @@ -32,7 +32,7 @@ - + diff --git a/docs/generators/php-slim4/index.html b/docs/generators/php-slim4/index.html index 9e4b1ebbdc2..212bfd4ecd9 100644 --- a/docs/generators/php-slim4/index.html +++ b/docs/generators/php-slim4/index.html @@ -32,7 +32,7 @@ - + diff --git a/docs/generators/php-symfony/index.html b/docs/generators/php-symfony/index.html index b9a585799d0..ba11d26fc0e 100644 --- a/docs/generators/php-symfony/index.html +++ b/docs/generators/php-symfony/index.html @@ -32,7 +32,7 @@ - + diff --git a/docs/generators/php-ze-ph/index.html b/docs/generators/php-ze-ph/index.html index 1ae7f598fa7..95e76718653 100644 --- a/docs/generators/php-ze-ph/index.html +++ b/docs/generators/php-ze-ph/index.html @@ -32,7 +32,7 @@ - + diff --git a/docs/generators/php/index.html b/docs/generators/php/index.html index 88d3b39ddbb..abfe99e9091 100644 --- a/docs/generators/php/index.html +++ b/docs/generators/php/index.html @@ -32,7 +32,7 @@ - + diff --git a/docs/generators/powershell/index.html b/docs/generators/powershell/index.html index 78ea604fa6f..3c69cef71ce 100644 --- a/docs/generators/powershell/index.html +++ b/docs/generators/powershell/index.html @@ -32,7 +32,7 @@ - + diff --git a/docs/generators/protobuf-schema/index.html b/docs/generators/protobuf-schema/index.html index 73cc24946e6..3e8cf2009d3 100644 --- a/docs/generators/protobuf-schema/index.html +++ b/docs/generators/protobuf-schema/index.html @@ -32,7 +32,7 @@ - + diff --git a/docs/generators/python-aiohttp/index.html b/docs/generators/python-aiohttp/index.html index 5f827aea431..d1c05764400 100644 --- a/docs/generators/python-aiohttp/index.html +++ b/docs/generators/python-aiohttp/index.html @@ -32,7 +32,7 @@ - + diff --git a/docs/generators/python-blueplanet/index.html b/docs/generators/python-blueplanet/index.html index 2a853946b66..14680a69f0e 100644 --- a/docs/generators/python-blueplanet/index.html +++ b/docs/generators/python-blueplanet/index.html @@ -32,7 +32,7 @@ - + diff --git a/docs/generators/python-experimental/index.html b/docs/generators/python-experimental/index.html index 61cf689456e..15a6e69c239 100644 --- a/docs/generators/python-experimental/index.html +++ b/docs/generators/python-experimental/index.html @@ -32,7 +32,7 @@ - + diff --git a/docs/generators/python-flask/index.html b/docs/generators/python-flask/index.html index f3eb539d34b..b4c81fc0b0f 100644 --- a/docs/generators/python-flask/index.html +++ b/docs/generators/python-flask/index.html @@ -32,7 +32,7 @@ - + diff --git a/docs/generators/python/index.html b/docs/generators/python/index.html index e19f717e8a9..056fa8dde24 100644 --- a/docs/generators/python/index.html +++ b/docs/generators/python/index.html @@ -32,7 +32,7 @@ - + diff --git a/docs/generators/r/index.html b/docs/generators/r/index.html index b9ee078d060..7f46e5b57da 100644 --- a/docs/generators/r/index.html +++ b/docs/generators/r/index.html @@ -32,7 +32,7 @@ - + diff --git a/docs/generators/ruby-on-rails/index.html b/docs/generators/ruby-on-rails/index.html index 86630fd48b9..8bb5237b44d 100644 --- a/docs/generators/ruby-on-rails/index.html +++ b/docs/generators/ruby-on-rails/index.html @@ -32,7 +32,7 @@ - + diff --git a/docs/generators/ruby-sinatra/index.html b/docs/generators/ruby-sinatra/index.html index a5af1a17dbc..9a5b0d161d5 100644 --- a/docs/generators/ruby-sinatra/index.html +++ b/docs/generators/ruby-sinatra/index.html @@ -32,7 +32,7 @@ - + diff --git a/docs/generators/ruby/index.html b/docs/generators/ruby/index.html index 2d677a57a68..601565b7e00 100644 --- a/docs/generators/ruby/index.html +++ b/docs/generators/ruby/index.html @@ -32,7 +32,7 @@ - + diff --git a/docs/generators/rust-server/index.html b/docs/generators/rust-server/index.html index f5876d54b14..b2dbf84197c 100644 --- a/docs/generators/rust-server/index.html +++ b/docs/generators/rust-server/index.html @@ -32,7 +32,7 @@ - + diff --git a/docs/generators/rust/index.html b/docs/generators/rust/index.html index faee7ced82c..98864d628f1 100644 --- a/docs/generators/rust/index.html +++ b/docs/generators/rust/index.html @@ -32,7 +32,7 @@ - + diff --git a/docs/generators/scala-akka/index.html b/docs/generators/scala-akka/index.html index cc48d0c6373..8fd5ac8073a 100644 --- a/docs/generators/scala-akka/index.html +++ b/docs/generators/scala-akka/index.html @@ -32,7 +32,7 @@ - + diff --git a/docs/generators/scala-finch/index.html b/docs/generators/scala-finch/index.html index 323fc4facaa..73979df00e9 100644 --- a/docs/generators/scala-finch/index.html +++ b/docs/generators/scala-finch/index.html @@ -32,7 +32,7 @@ - + diff --git a/docs/generators/scala-gatling/index.html b/docs/generators/scala-gatling/index.html index 45d2847f813..f6f88bc4bd9 100644 --- a/docs/generators/scala-gatling/index.html +++ b/docs/generators/scala-gatling/index.html @@ -32,7 +32,7 @@ - + diff --git a/docs/generators/scala-httpclient-deprecated/index.html b/docs/generators/scala-httpclient-deprecated/index.html index 5ce632d84dd..24312a10ca1 100644 --- a/docs/generators/scala-httpclient-deprecated/index.html +++ b/docs/generators/scala-httpclient-deprecated/index.html @@ -32,7 +32,7 @@ - + diff --git a/docs/generators/scala-lagom-server/index.html b/docs/generators/scala-lagom-server/index.html index 12d9e3d4515..ad19eb9d1bf 100644 --- a/docs/generators/scala-lagom-server/index.html +++ b/docs/generators/scala-lagom-server/index.html @@ -32,7 +32,7 @@ - + diff --git a/docs/generators/scala-play-server/index.html b/docs/generators/scala-play-server/index.html index 39abe722252..dd1bf04c6e0 100644 --- a/docs/generators/scala-play-server/index.html +++ b/docs/generators/scala-play-server/index.html @@ -32,7 +32,7 @@ - + diff --git a/docs/generators/scalatra/index.html b/docs/generators/scalatra/index.html index 15abdd1e404..cddffae677c 100644 --- a/docs/generators/scalatra/index.html +++ b/docs/generators/scalatra/index.html @@ -32,7 +32,7 @@ - + diff --git a/docs/generators/scalaz/index.html b/docs/generators/scalaz/index.html index e9567b5eb6b..2fa6617fa1d 100644 --- a/docs/generators/scalaz/index.html +++ b/docs/generators/scalaz/index.html @@ -32,7 +32,7 @@ - + diff --git a/docs/generators/spring/index.html b/docs/generators/spring/index.html index 8ebbd51d66e..6c0b75403b3 100644 --- a/docs/generators/spring/index.html +++ b/docs/generators/spring/index.html @@ -32,7 +32,7 @@ - + diff --git a/docs/generators/swift2-deprecated/index.html b/docs/generators/swift2-deprecated/index.html index 2167806729d..bd540ed7b97 100644 --- a/docs/generators/swift2-deprecated/index.html +++ b/docs/generators/swift2-deprecated/index.html @@ -32,7 +32,7 @@ - + diff --git a/docs/generators/swift3-deprecated/index.html b/docs/generators/swift3-deprecated/index.html index 620c7c3ca7d..34e7c975da9 100644 --- a/docs/generators/swift3-deprecated/index.html +++ b/docs/generators/swift3-deprecated/index.html @@ -32,7 +32,7 @@ - + diff --git a/docs/generators/swift4/index.html b/docs/generators/swift4/index.html index 526237766c2..39d13a79d76 100644 --- a/docs/generators/swift4/index.html +++ b/docs/generators/swift4/index.html @@ -32,7 +32,7 @@ - + diff --git a/docs/generators/swift5/index.html b/docs/generators/swift5/index.html index 8e8efd807c0..f06f58a34af 100644 --- a/docs/generators/swift5/index.html +++ b/docs/generators/swift5/index.html @@ -32,7 +32,7 @@ - + diff --git a/docs/generators/typescript-angular/index.html b/docs/generators/typescript-angular/index.html index e077f68cb73..b2882cc690e 100644 --- a/docs/generators/typescript-angular/index.html +++ b/docs/generators/typescript-angular/index.html @@ -32,7 +32,7 @@ - + diff --git a/docs/generators/typescript-angularjs/index.html b/docs/generators/typescript-angularjs/index.html index 1964f21b18f..2b2c845243f 100644 --- a/docs/generators/typescript-angularjs/index.html +++ b/docs/generators/typescript-angularjs/index.html @@ -32,7 +32,7 @@ - + diff --git a/docs/generators/typescript-aurelia/index.html b/docs/generators/typescript-aurelia/index.html index 9b895211408..1e30bd45851 100644 --- a/docs/generators/typescript-aurelia/index.html +++ b/docs/generators/typescript-aurelia/index.html @@ -32,7 +32,7 @@ - + diff --git a/docs/generators/typescript-axios/index.html b/docs/generators/typescript-axios/index.html index 304ec9f6432..2244604851b 100644 --- a/docs/generators/typescript-axios/index.html +++ b/docs/generators/typescript-axios/index.html @@ -32,7 +32,7 @@ - + diff --git a/docs/generators/typescript-fetch/index.html b/docs/generators/typescript-fetch/index.html index ae95f2388f8..a7134614ae3 100644 --- a/docs/generators/typescript-fetch/index.html +++ b/docs/generators/typescript-fetch/index.html @@ -32,7 +32,7 @@ - + diff --git a/docs/generators/typescript-inversify/index.html b/docs/generators/typescript-inversify/index.html index b219f92c227..89b7037429e 100644 --- a/docs/generators/typescript-inversify/index.html +++ b/docs/generators/typescript-inversify/index.html @@ -32,7 +32,7 @@ - + diff --git a/docs/generators/typescript-jquery/index.html b/docs/generators/typescript-jquery/index.html index 188b38fb16d..8f1eb3c04c2 100644 --- a/docs/generators/typescript-jquery/index.html +++ b/docs/generators/typescript-jquery/index.html @@ -32,7 +32,7 @@ - + diff --git a/docs/generators/typescript-node/index.html b/docs/generators/typescript-node/index.html index aa07a080eef..ecc81a79196 100644 --- a/docs/generators/typescript-node/index.html +++ b/docs/generators/typescript-node/index.html @@ -32,7 +32,7 @@ - + diff --git a/docs/generators/typescript-redux-query/index.html b/docs/generators/typescript-redux-query/index.html index 9462db78481..903876dca4d 100644 --- a/docs/generators/typescript-redux-query/index.html +++ b/docs/generators/typescript-redux-query/index.html @@ -32,7 +32,7 @@ - + diff --git a/docs/generators/typescript-rxjs/index.html b/docs/generators/typescript-rxjs/index.html index 89ef7a173b6..5611bc10370 100644 --- a/docs/generators/typescript-rxjs/index.html +++ b/docs/generators/typescript-rxjs/index.html @@ -32,7 +32,7 @@ - + diff --git a/docs/installation/index.html b/docs/installation/index.html index 0c3dff72c39..9454b158cb2 100644 --- a/docs/installation/index.html +++ b/docs/installation/index.html @@ -36,7 +36,7 @@ it will execute as normal. If a newer version is found, the script will download - + diff --git a/docs/integrations/index.html b/docs/integrations/index.html index 705bfc67911..cc312c279eb 100644 --- a/docs/integrations/index.html +++ b/docs/integrations/index.html @@ -27,12 +27,12 @@
    -

    Workflow Integrations

    Workflow Integration (Maven, Github, CI/CD)

    Gradle Integration

    See the openapi-generator-gradle-plugin README for details related to configuring and using the Gradle Plugin.

    Supported tasks include:

    • Listing generators
    • Validation of Open API 2.0 and 3.0 Specs
    • Generating "Meta" generators
    • Generating all generators supported by OpenAPI Generator

    Maven Integration

    See the openapi-generator-maven-plugin README for details related to configuring and using the Maven Plugin.

    sbt Integration

    Please refer to https://github.com/upstart-commerce/sbt-openapi-generator

    Bazel Integration

    Please refer to https://github.com/OpenAPITools/openapi-generator-bazel

    GitHub Integration

    To push the auto-generated SDK to GitHub, we provide git_push.sh to streamline the process. For example:

    1) Create a new repository in GitHub (Ref: https://help.github.com/articles/creating-a-new-repository/)

    2) Generate the SDK

    java -jar openapi-generator-cli.jar generate \
    -i modules/openapi-generator/src/test/resources/2_0/petstore.json -g perl \
    --git-user-id "wing328" \
    --git-repo-id "petstore-perl" \
    --release-note "Github integration demo" \
    -o /var/tmp/perl/petstore

    3) Push the SDK to GitHub

    cd /var/tmp/perl/petstore
    /bin/sh ./git_push.sh

    CI/CD

    Some generators also generate CI/CD configuration files (.travis.yml) so that the output will be ready to be tested by the CI (e.g. Travis)

    If you're looking for the configuration files of a particular CI that is not yet supported, please open an issue to let us know.

    Last updated on by Tatsuro Shibamura
    +

    Workflow Integrations

    Workflow Integration (Maven, Github, CI/CD)

    Gradle Integration

    See the openapi-generator-gradle-plugin README for details related to configuring and using the Gradle Plugin.

    Supported tasks include:

    • Listing generators
    • Validation of Open API 2.0 and 3.0 Specs
    • Generating "Meta" generators
    • Generating all generators supported by OpenAPI Generator

    Maven Integration

    See the openapi-generator-maven-plugin README for details related to configuring and using the Maven Plugin.

    sbt Integration

    Please refer to https://github.com/upstart-commerce/sbt-openapi-generator

    Bazel Integration

    Please refer to https://github.com/OpenAPITools/openapi-generator-bazel

    GitHub Integration

    To push the auto-generated SDK to GitHub, we provide git_push.sh to streamline the process. For example:

    1) Create a new repository in GitHub (Ref: https://help.github.com/articles/creating-a-new-repository/)

    2) Generate the SDK

    java -jar openapi-generator-cli.jar generate \
    -i modules/openapi-generator/src/test/resources/2_0/petstore.json -g perl \
    --git-user-id "wing328" \
    --git-repo-id "petstore-perl" \
    --release-note "Github integration demo" \
    -o /var/tmp/perl/petstore

    3) Push the SDK to GitHub

    cd /var/tmp/perl/petstore
    /bin/sh ./git_push.sh

    CI/CD

    Some generators also generate CI/CD configuration files (.travis.yml) so that the output will be ready to be tested by the CI (e.g. Travis)

    If you're looking for the configuration files of a particular CI that is not yet supported, please open an issue to let us know.

    Last updated on by Akihito Nakano
    - + @@ -46,7 +46,7 @@ - + diff --git a/docs/new-generator/index.html b/docs/new-generator/index.html index 647850daf65..c3139b133e8 100644 --- a/docs/new-generator/index.html +++ b/docs/new-generator/index.html @@ -27,12 +27,12 @@
    -

    Create a New Generator

    Creating a new generator which will become a part of the officially supported generators in OpenAPI Generator is pretty simple. We've created a helper script to bootstrap the operation. Let's look at the files necessary to create a new generator, then an example of bootstrapping a generator using the new.sh script in the root of the repository.

    Required Files

    The minimum set of files required to create a new generator are:

    • A "Codegen" file
      • exists under modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/
      • defines language options
      • defines framework options
      • determines OpenAPI feature set
      • extends the generation workflow
    • SPI registration
      • Above class must be referenced in modules/openapi-generator/src/main/resources/META-INF/services/org.openapitools.codegen.CodegenConfig
      • Tells the generator that this class exists
      • Allows for classpath extension (addition) of generators
    • A minimal template
      • Should include a README explaining usage
      • Must include an api.mustache
      • Exists under modules/openapi-generator/src/main/resources/ (plus embeddedTemplate dir value, see below)
    • Sample scripts under ./bin and ./bin/windows
      • Gives users a "real life" example of generated output
      • Samples are used by CI to verify generators and test for regressions in some cases

    Now, let's generate an example generator and then walk through the pieces. At the end, we'll touch on some known sticking points for new generator authors and provide some suggestions.

    new.sh

    The new.sh script in the root of the project is meant to simplify this process. Run ./new.sh --help.

    Stubs out files for new generators
    Usage:
    ./new.sh [options]
    Options:
    -n Required. Specify generator name, should be kebab-cased.
    -c Create a client generator
    -s Create a server generator
    -d Create a documentation generator
    -t When specified, creates test file(s) for the generator.
    -h Display help.
    Examples:
    Create a server generator for ktor:
    ./new.sh -n kotlin -s
    Creates:
    modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/KotlinServerCodegen.java
    modules/openapi-generator/src/main/resources/kotlin-server/README.mustache
    modules/openapi-generator/src/main/resources/kotlin-server/model.mustache
    modules/openapi-generator/src/main/resources/kotlin-server/api.mustache
    bin/windows/kotlin-server-petstore.bat
    bin/kotlin-server-petstore.sh
    Create a generic C# server generator:
    ./new.sh -n csharp -s -t
    Creates:
    modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CsharpServerCodegen.java
    modules/openapi-generator/src/main/resources/csharp-server/README.mustache
    modules/openapi-generator/src/main/resources/csharp-server/model.mustache
    modules/openapi-generator/src/main/resources/csharp-server/api.mustache
    bin/windows/csharp-server-petstore.bat
    bin/csharp-server-petstore.sh
    modules/openapi-generator/src/test/java/org/openapitools/codegen/csharp/CsharpServerCodegenTest.java
    modules/openapi-generator/src/test/java/org/openapitools/codegen/csharp/CsharpServerCodegenModelTest.java
    modules/openapi-generator/src/test/java/org/openapitools/codegen/csharp/CsharpServerCodegenOptionsTest.java
    modules/openapi-generator/src/test/java/org/openapitools/codegen/options/CsharpServerCodegenOptionsProvider.java

    This script allows us to define a client, server, schema, or documentation generator. We'll focus on the simplest generator (documentation). The other generator types may require heavy extension of the "Config" base class, and these docs could very quickly become outdated. When creating a new generator, please review existing generators as a guideline for implementation.

    Create a new Markdown generator, specifying CommonMark as the name to avoid conflicting with the built-in Markdown generator.

    ./new.sh -n common-mark -d

    You should see output similar to the following:

    Creating modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CommonMarkDocumentationCodegen.java
    Creating modules/openapi-generator/src/main/resources/common-mark-documentation/README.mustache
    Creating modules/openapi-generator/src/main/resources/common-mark-documentation/model.mustache
    Creating modules/openapi-generator/src/main/resources/common-mark-documentation/api.mustache
    Creating bin/windows/common-mark-documentation-petstore.bat
    Creating bin/common-mark-documentation-petstore.sh
    Finished.

    Review Generated Config

    Beginning with the "Codegen" file (CommonMarkDocumentationCodegen.java), the constructor was created:

    public CommonMarkDocumentationCodegen() {
    super();
    outputFolder = "generated-code" + File.separator + "common-mark";
    modelTemplateFiles.put("model.mustache", ".zz");
    apiTemplateFiles.put("api.mustache", ".zz");
    embeddedTemplateDir = templateDir = "common-mark-documentation";
    apiPackage = File.separator + "Apis";
    modelPackage = File.separator + "Models";
    supportingFiles.add(new SupportingFile("README.mustache", "", "README.md"));
    // TODO: Fill this out.
    }

    These options are some defaults which may require updating. Let's look line-by-line at the config.

    outputFolder = "generated-code" + File.separator + "common-mark";

    This is the default output location. This will be generated-code/common-mark on non-Windows machines and generated-code\common-mark on Windows. You may change this to any value you'd like, but a user will almost always provide an output directory.

    When joining paths, always use File.seperator

    modelTemplateFiles.put("model.mustache", ".zz");

    The model.mustache file is registered as the template for model generation. The new.sh script doesn't have a way to know your intended file extension, so we default to a .zz extension. This must be changed (unless your generator's target extension is .zz). For this example, you'd change .zz to .md or .markdown, depending on your preference.

    This model template registration will use model.mustache to generate a new file for every model defined in your API's specification document.

    The path is considered relative to embeddedTemplateDir, templateDir, or a library subdirectory (refer to the Java client generator implementation for a prime example).

    apiTemplateFiles.put("api.mustache", ".zz");

    This is the template used for generating API related files. Similar to the above model template, you'll want to change .zz to .md or .markdown.

    The path is considered relative to embeddedTemplateDir, templateDir, or a library subdirectory (refer to the Java client generator implementation for a prime example).

    embeddedTemplateDir = templateDir = "common-mark-documentation";

    This line sets the embedded and template directories to common-mark-documentation. The embeddedTemplateDir refers to the directory which will exist under modules/openapi-generator/src/main/resources and will be published with every release in which your new generator is present.

    The templateDir variable refers to the "current" template directory setting, as defined by the user. That is, the user may invoke with -t or --template-directory (or plugin option variants), and override this directory.

    Both of these variables exist because the generator will fallback to files under embeddedTemplateDir if they are not defined in the user's custom template directory.

    apiPackage = File.separator + "Apis";

    This sets the "package" location for anything considered an API document. You might want to change this setting if, for instance, your language doesn't support uppercase letters in the path. We don't need to worry about that here.

    Every templated output from api.mustache (registered via apiTemplateFiles above) will end up in the directory defined by apiPackage here.

    modelPackage = File.separator + "Models";

    Similarly, this sets the package for Models.

    Every templated output from model.mustache (registered via modelTemplateFiles above) will end up in the directory defined by modelPackage here.

    supportingFiles.add(new SupportingFile("README.mustache", "", "README.md"));

    A "supporting file" is an extra file which isn't created once for every operation or model defined in your specification document. It is a single file which may or may not be templated (determined by the extension of the filename).

    A supporting file only passes through the Mustache template processor if the filename ends in .mustache.

    The path is considered relative to embeddedTemplateDir, templateDir, or a library subdirectory (refer to the Java client generator implementation for a prime example).

    If you want your readme to be generic (not templated), just rename the file to README.md and change README.mustache to README.md above.

    Create templates

    The new.sh created our three required files. Let's start filling out each of these files.

    README.mustache

    # Documentation for {{appName}}
    {{#generateApiDocs}}
    <a name="documentation-for-api-endpoints"></a>
    ## Documentation for API Endpoints
    All URIs are relative to *{{{basePath}}}*
    Class | Method | HTTP request | Description
    ------------ | ------------- | ------------- | -------------
    {{#apiInfo}}{{#apis}}{{#operations}}{{#operation}}*{{classname}}* | [**{{operationId}}**](Apis/{{apiDocPath}}{{classname}}.md#{{operationIdLowerCase}}) | **{{httpMethod}}** {{path}} | {{#summary}}{{{summary}}}{{/summary}}
    {{/operation}}{{/operations}}{{/apis}}{{/apiInfo}}
    {{/generateApiDocs}}
    {{#generateModelDocs}}
    <a name="documentation-for-models"></a>
    ## Documentation for Models
    {{#modelPackage}}
    {{#models}}{{#model}} - [{{{modelPackage}}}.{{{classname}}}](Models/{{modelDocPath}}{{{classname}}}.md)
    {{/model}}{{/models}}
    {{/modelPackage}}
    {{^modelPackage}}
    No model defined in this package
    {{/modelPackage}}
    {{/generateModelDocs}}
    <a name="documentation-for-authorization"></a>{{! TODO: optional documentation for authorization? }}
    ## Documentation for Authorization
    {{^authMethods}}
    All endpoints do not require authorization.
    {{/authMethods}}
    {{#authMethods}}
    {{#last}}
    Authentication schemes defined for the API:
    {{/last}}
    {{/authMethods}}
    {{#authMethods}}
    <a name="{{name}}"></a>
    ### {{name}}
    {{#isApiKey}}- **Type**: API key
    - **API key parameter name**: {{keyParamName}}
    - **Location**: {{#isKeyInQuery}}URL query string{{/isKeyInQuery}}{{#isKeyInHeader}}HTTP header{{/isKeyInHeader}}
    {{/isApiKey}}
    {{#isBasic}}- **Type**: HTTP basic authentication
    {{/isBasic}}
    {{#isOAuth}}- **Type**: OAuth
    - **Flow**: {{flow}}
    - **Authorization URL**: {{authorizationUrl}}
    - **Scopes**: {{^scopes}}N/A{{/scopes}}
    {{#scopes}} - {{scope}}: {{description}}
    {{/scopes}}
    {{/isOAuth}}
    {{/authMethods}}

    Let's not focus too much on the contents of this file. You may refer to templating for more details on the variables bound to these files and to debugging how to debug the structures. Of note here is that we're generating structures in markdown as defined by the objects constructed by our new "Config" class.

    api.mustache

    The API documentation might look like this:

    # {{classname}}{{#description}}
    {{description}}{{/description}}
    All URIs are relative to *{{basePath}}*
    Method | HTTP request | Description
    ------------- | ------------- | -------------
    {{#operations}}{{#operation}}[**{{operationId}}**]({{classname}}.md#{{operationId}}) | **{{httpMethod}}** {{path}} | {{#summary}}{{summary}}{{/summary}}
    {{/operation}}{{/operations}}
    {{#operations}}
    {{#operation}}
    <a name="{{operationId}}"></a>
    # **{{operationId}}**
    > {{#returnType}}{{returnType}} {{/returnType}}{{operationId}}({{#allParams}}{{{paramName}}}{{#hasMore}}, {{/hasMore}}{{/allParams}})
    {{summary}}{{#notes}}
    {{notes}}{{/notes}}
    ### Parameters
    {{^allParams}}This endpoint does not need any parameter.{{/allParams}}{{#allParams}}{{#-last}}
    Name | Type | Description | Notes
    ------------- | ------------- | ------------- | -------------{{/-last}}{{/allParams}}
    {{#allParams}} **{{paramName}}** | {{#isPrimitiveType}}**{{dataType}}**{{/isPrimitiveType}}{{^isPrimitiveType}}{{#isFile}}**{{dataType}}**{{/isFile}}{{^isFile}}{{#generateModelDocs}}[**{{dataType}}**]({{baseType}}.md){{/generateModelDocs}}{{^generateModelDocs}}**{{dataType}}**{{/generateModelDocs}}{{/isFile}}{{/isPrimitiveType}}| {{description}} |{{^required}} [optional]{{/required}}{{#defaultValue}} [default to {{defaultValue}}]{{/defaultValue}}{{#allowableValues}} [enum: {{#values}}{{{.}}}{{^-last}}, {{/-last}}{{/values}}]{{/allowableValues}}
    {{/allParams}}
    ### Return type
    {{#returnType}}{{#returnTypeIsPrimitive}}**{{returnType}}**{{/returnTypeIsPrimitive}}{{^returnTypeIsPrimitive}}{{#generateModelDocs}}[**{{returnType}}**]({{returnBaseType}}.md){{/generateModelDocs}}{{^generateModelDocs}}**{{returnType}}**{{/generateModelDocs}}{{/returnTypeIsPrimitive}}{{/returnType}}{{^returnType}}null (empty response body){{/returnType}}
    ### Authorization
    {{^authMethods}}No authorization required{{/authMethods}}{{#authMethods}}[{{name}}](../README.md#{{name}}){{^-last}}, {{/-last}}{{/authMethods}}
    ### HTTP request headers
    - **Content-Type**: {{#consumes}}{{{mediaType}}}{{#hasMore}}, {{/hasMore}}{{/consumes}}{{^consumes}}Not defined{{/consumes}}
    - **Accept**: {{#produces}}{{{mediaType}}}{{#hasMore}}, {{/hasMore}}{{/produces}}{{^produces}}Not defined{{/produces}}
    {{/operation}}
    {{/operations}}

    model.mustache

    The models file could resemble the following.

    {{#models}}
    {{#model}}
    # {{{packageName}}}.{{modelPackage}}.{{{classname}}}
    ## Properties
    Name | Type | Description | Notes
    ------------ | ------------- | ------------- | -------------
    {{#parent}}
    {{#parentVars}}
    **{{name}}** | {{#isPrimitiveType}}**{{dataType}}**{{/isPrimitiveType}}{{^isPrimitiveType}}[**{{dataType}}**]({{complexType}}.md){{/isPrimitiveType}} | {{description}} | {{^required}}[optional] {{/required}}{{#readOnly}}[readonly] {{/readOnly}}{{#defaultValue}}[default to {{{.}}}]{{/defaultValue}}
    {{/parentVars}}
    {{/parent}}
    {{#vars}}**{{name}}** | {{#isPrimitiveType}}**{{dataType}}**{{/isPrimitiveType}}{{^isPrimitiveType}}[**{{dataType}}**]({{complexType}}.md){{/isPrimitiveType}} | {{description}} | {{^required}}[optional] {{/required}}{{#readOnly}}[readonly] {{/readOnly}}{{#defaultValue}}[default to {{{.}}}]{{/defaultValue}}
    {{/vars}}
    [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
    {{/model}}
    {{/models}}

    Build it

    To compile quickly to test this out, you can run mvn clean package -DskipTests.

    When implementing a more robust generator, you'll want to run all tests as well: mvn clean package

    Compile Sample

    The new.sh script created bin/common-mark-documentation-petstore.sh:

    #!/bin/sh
    SCRIPT="$0"
    while [ -h "$SCRIPT" ] ; do
    ls=$(ls -ld "$SCRIPT")
    link=$(expr "$ls" : '.*-> \(.*\)$')
    if expr "$link" : '/.*' > /dev/null; then
    SCRIPT="$link"
    else
    SCRIPT=$(dirname "$SCRIPT")/"$link"
    fi
    done
    if [ ! -d "${APP_DIR}" ]; then
    APP_DIR=$(dirname "$SCRIPT")/..
    APP_DIR=$(cd "${APP_DIR}"; pwd)
    fi
    executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar"
    if [ ! -f "$executable" ]
    then
    mvn clean package
    fi
    # if you've executed sbt assembly previously it will use that instead.
    export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties"
    ags="$@ generate -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g common-mark -o samples/documentation/petstore/common/mark"
    java ${JAVA_OPTS} -jar ${executable} ${ags}

    This script is often used to apply default options for generation. A common option in most of these script is to define the template directory as the generator's directory under resources. This allows template maintainers to modify and test out template changes which don't require recompilation of the entire project. You'd still need to recompile the project in full if you add or modify behaviors to the generator (such as adding a CliOption).

    Add -t modules/openapi-generator/src/main/resources/common-mark-documentation to ags line to simplify the evaluation of template-only modifications:

    diff --git a/bin/markdown-documentation-petstore.sh b/bin/markdown-documentation-petstore.sh
    index d816771478..94b4ce6d12 100644
    --- a/bin/markdown-documentation-petstore.sh
    +++ b/bin/markdown-documentation-petstore.sh
    @@ -26,6 +26,6 @@ fi
    # if you've executed sbt assembly previously it will use that instead.
    export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties"
    -ags="$@ generate -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g common-mark -o samples/documentation/petstore/common-mark"
    +ags="$@ generate -t modules/openapi-generator/src/main/resources/common-mark-documentation -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g common-mark -o samples/documentation/petstore/common/markdown"
    java ${JAVA_OPTS} -jar ${executable} ${ags}

    Verify output

    Creating a new generator will be an iterative task. Once you've generated the sample, you'll want to try it out. For compiled client/server outputs, this would mean running the code or creating a small sample project to consume your artifact just to make sure it works.

    For markdown, you can open in Visual Studio Code or any other editor with a markdown preview. Not all editors support relative links to other markdown documents. To test the output in this guide, install markserv:

    npm install --global markserv

    Now, you can serve the output directory directly and test your links:

    markserv samples/documentation/petstore/common/markdown

    That's it! You've created your first generator!

    Last updated on by Tatsuro Shibamura
    +

    Create a New Generator

    Creating a new generator which will become a part of the officially supported generators in OpenAPI Generator is pretty simple. We've created a helper script to bootstrap the operation. Let's look at the files necessary to create a new generator, then an example of bootstrapping a generator using the new.sh script in the root of the repository.

    Required Files

    The minimum set of files required to create a new generator are:

    • A "Codegen" file
      • exists under modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/
      • defines language options
      • defines framework options
      • determines OpenAPI feature set
      • extends the generation workflow
    • SPI registration
      • Above class must be referenced in modules/openapi-generator/src/main/resources/META-INF/services/org.openapitools.codegen.CodegenConfig
      • Tells the generator that this class exists
      • Allows for classpath extension (addition) of generators
    • A minimal template
      • Should include a README explaining usage
      • Must include an api.mustache
      • Exists under modules/openapi-generator/src/main/resources/ (plus embeddedTemplate dir value, see below)
    • Sample scripts under ./bin and ./bin/windows
      • Gives users a "real life" example of generated output
      • Samples are used by CI to verify generators and test for regressions in some cases

    Now, let's generate an example generator and then walk through the pieces. At the end, we'll touch on some known sticking points for new generator authors and provide some suggestions.

    new.sh

    The new.sh script in the root of the project is meant to simplify this process. Run ./new.sh --help.

    Stubs out files for new generators
    Usage:
    ./new.sh [options]
    Options:
    -n Required. Specify generator name, should be kebab-cased.
    -c Create a client generator
    -s Create a server generator
    -d Create a documentation generator
    -t When specified, creates test file(s) for the generator.
    -h Display help.
    Examples:
    Create a server generator for ktor:
    ./new.sh -n kotlin -s
    Creates:
    modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/KotlinServerCodegen.java
    modules/openapi-generator/src/main/resources/kotlin-server/README.mustache
    modules/openapi-generator/src/main/resources/kotlin-server/model.mustache
    modules/openapi-generator/src/main/resources/kotlin-server/api.mustache
    bin/windows/kotlin-server-petstore.bat
    bin/kotlin-server-petstore.sh
    Create a generic C# server generator:
    ./new.sh -n csharp -s -t
    Creates:
    modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CsharpServerCodegen.java
    modules/openapi-generator/src/main/resources/csharp-server/README.mustache
    modules/openapi-generator/src/main/resources/csharp-server/model.mustache
    modules/openapi-generator/src/main/resources/csharp-server/api.mustache
    bin/windows/csharp-server-petstore.bat
    bin/csharp-server-petstore.sh
    modules/openapi-generator/src/test/java/org/openapitools/codegen/csharp/CsharpServerCodegenTest.java
    modules/openapi-generator/src/test/java/org/openapitools/codegen/csharp/CsharpServerCodegenModelTest.java
    modules/openapi-generator/src/test/java/org/openapitools/codegen/csharp/CsharpServerCodegenOptionsTest.java
    modules/openapi-generator/src/test/java/org/openapitools/codegen/options/CsharpServerCodegenOptionsProvider.java

    This script allows us to define a client, server, schema, or documentation generator. We'll focus on the simplest generator (documentation). The other generator types may require heavy extension of the "Config" base class, and these docs could very quickly become outdated. When creating a new generator, please review existing generators as a guideline for implementation.

    Create a new Markdown generator, specifying CommonMark as the name to avoid conflicting with the built-in Markdown generator.

    ./new.sh -n common-mark -d

    You should see output similar to the following:

    Creating modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CommonMarkDocumentationCodegen.java
    Creating modules/openapi-generator/src/main/resources/common-mark-documentation/README.mustache
    Creating modules/openapi-generator/src/main/resources/common-mark-documentation/model.mustache
    Creating modules/openapi-generator/src/main/resources/common-mark-documentation/api.mustache
    Creating bin/windows/common-mark-documentation-petstore.bat
    Creating bin/common-mark-documentation-petstore.sh
    Finished.

    Review Generated Config

    Beginning with the "Codegen" file (CommonMarkDocumentationCodegen.java), the constructor was created:

    public CommonMarkDocumentationCodegen() {
    super();
    outputFolder = "generated-code" + File.separator + "common-mark";
    modelTemplateFiles.put("model.mustache", ".zz");
    apiTemplateFiles.put("api.mustache", ".zz");
    embeddedTemplateDir = templateDir = "common-mark-documentation";
    apiPackage = File.separator + "Apis";
    modelPackage = File.separator + "Models";
    supportingFiles.add(new SupportingFile("README.mustache", "", "README.md"));
    // TODO: Fill this out.
    }

    These options are some defaults which may require updating. Let's look line-by-line at the config.

    outputFolder = "generated-code" + File.separator + "common-mark";

    This is the default output location. This will be generated-code/common-mark on non-Windows machines and generated-code\common-mark on Windows. You may change this to any value you'd like, but a user will almost always provide an output directory.

    When joining paths, always use File.seperator

    modelTemplateFiles.put("model.mustache", ".zz");

    The model.mustache file is registered as the template for model generation. The new.sh script doesn't have a way to know your intended file extension, so we default to a .zz extension. This must be changed (unless your generator's target extension is .zz). For this example, you'd change .zz to .md or .markdown, depending on your preference.

    This model template registration will use model.mustache to generate a new file for every model defined in your API's specification document.

    The path is considered relative to embeddedTemplateDir, templateDir, or a library subdirectory (refer to the Java client generator implementation for a prime example).

    apiTemplateFiles.put("api.mustache", ".zz");

    This is the template used for generating API related files. Similar to the above model template, you'll want to change .zz to .md or .markdown.

    The path is considered relative to embeddedTemplateDir, templateDir, or a library subdirectory (refer to the Java client generator implementation for a prime example).

    embeddedTemplateDir = templateDir = "common-mark-documentation";

    This line sets the embedded and template directories to common-mark-documentation. The embeddedTemplateDir refers to the directory which will exist under modules/openapi-generator/src/main/resources and will be published with every release in which your new generator is present.

    The templateDir variable refers to the "current" template directory setting, as defined by the user. That is, the user may invoke with -t or --template-directory (or plugin option variants), and override this directory.

    Both of these variables exist because the generator will fallback to files under embeddedTemplateDir if they are not defined in the user's custom template directory.

    apiPackage = File.separator + "Apis";

    This sets the "package" location for anything considered an API document. You might want to change this setting if, for instance, your language doesn't support uppercase letters in the path. We don't need to worry about that here.

    Every templated output from api.mustache (registered via apiTemplateFiles above) will end up in the directory defined by apiPackage here.

    modelPackage = File.separator + "Models";

    Similarly, this sets the package for Models.

    Every templated output from model.mustache (registered via modelTemplateFiles above) will end up in the directory defined by modelPackage here.

    supportingFiles.add(new SupportingFile("README.mustache", "", "README.md"));

    A "supporting file" is an extra file which isn't created once for every operation or model defined in your specification document. It is a single file which may or may not be templated (determined by the extension of the filename).

    A supporting file only passes through the Mustache template processor if the filename ends in .mustache.

    The path is considered relative to embeddedTemplateDir, templateDir, or a library subdirectory (refer to the Java client generator implementation for a prime example).

    If you want your readme to be generic (not templated), just rename the file to README.md and change README.mustache to README.md above.

    Create templates

    The new.sh created our three required files. Let's start filling out each of these files.

    README.mustache

    # Documentation for {{appName}}
    {{#generateApiDocs}}
    <a name="documentation-for-api-endpoints"></a>
    ## Documentation for API Endpoints
    All URIs are relative to *{{{basePath}}}*
    Class | Method | HTTP request | Description
    ------------ | ------------- | ------------- | -------------
    {{#apiInfo}}{{#apis}}{{#operations}}{{#operation}}*{{classname}}* | [**{{operationId}}**](Apis/{{apiDocPath}}{{classname}}.md#{{operationIdLowerCase}}) | **{{httpMethod}}** {{path}} | {{#summary}}{{{summary}}}{{/summary}}
    {{/operation}}{{/operations}}{{/apis}}{{/apiInfo}}
    {{/generateApiDocs}}
    {{#generateModelDocs}}
    <a name="documentation-for-models"></a>
    ## Documentation for Models
    {{#modelPackage}}
    {{#models}}{{#model}} - [{{{modelPackage}}}.{{{classname}}}](Models/{{modelDocPath}}{{{classname}}}.md)
    {{/model}}{{/models}}
    {{/modelPackage}}
    {{^modelPackage}}
    No model defined in this package
    {{/modelPackage}}
    {{/generateModelDocs}}
    <a name="documentation-for-authorization"></a>{{! TODO: optional documentation for authorization? }}
    ## Documentation for Authorization
    {{^authMethods}}
    All endpoints do not require authorization.
    {{/authMethods}}
    {{#authMethods}}
    {{#last}}
    Authentication schemes defined for the API:
    {{/last}}
    {{/authMethods}}
    {{#authMethods}}
    <a name="{{name}}"></a>
    ### {{name}}
    {{#isApiKey}}- **Type**: API key
    - **API key parameter name**: {{keyParamName}}
    - **Location**: {{#isKeyInQuery}}URL query string{{/isKeyInQuery}}{{#isKeyInHeader}}HTTP header{{/isKeyInHeader}}
    {{/isApiKey}}
    {{#isBasic}}- **Type**: HTTP basic authentication
    {{/isBasic}}
    {{#isOAuth}}- **Type**: OAuth
    - **Flow**: {{flow}}
    - **Authorization URL**: {{authorizationUrl}}
    - **Scopes**: {{^scopes}}N/A{{/scopes}}
    {{#scopes}} - {{scope}}: {{description}}
    {{/scopes}}
    {{/isOAuth}}
    {{/authMethods}}

    Let's not focus too much on the contents of this file. You may refer to templating for more details on the variables bound to these files and to debugging how to debug the structures. Of note here is that we're generating structures in markdown as defined by the objects constructed by our new "Config" class.

    api.mustache

    The API documentation might look like this:

    # {{classname}}{{#description}}
    {{description}}{{/description}}
    All URIs are relative to *{{basePath}}*
    Method | HTTP request | Description
    ------------- | ------------- | -------------
    {{#operations}}{{#operation}}[**{{operationId}}**]({{classname}}.md#{{operationId}}) | **{{httpMethod}}** {{path}} | {{#summary}}{{summary}}{{/summary}}
    {{/operation}}{{/operations}}
    {{#operations}}
    {{#operation}}
    <a name="{{operationId}}"></a>
    # **{{operationId}}**
    > {{#returnType}}{{returnType}} {{/returnType}}{{operationId}}({{#allParams}}{{{paramName}}}{{#hasMore}}, {{/hasMore}}{{/allParams}})
    {{summary}}{{#notes}}
    {{notes}}{{/notes}}
    ### Parameters
    {{^allParams}}This endpoint does not need any parameter.{{/allParams}}{{#allParams}}{{#-last}}
    Name | Type | Description | Notes
    ------------- | ------------- | ------------- | -------------{{/-last}}{{/allParams}}
    {{#allParams}} **{{paramName}}** | {{#isPrimitiveType}}**{{dataType}}**{{/isPrimitiveType}}{{^isPrimitiveType}}{{#isFile}}**{{dataType}}**{{/isFile}}{{^isFile}}{{#generateModelDocs}}[**{{dataType}}**]({{baseType}}.md){{/generateModelDocs}}{{^generateModelDocs}}**{{dataType}}**{{/generateModelDocs}}{{/isFile}}{{/isPrimitiveType}}| {{description}} |{{^required}} [optional]{{/required}}{{#defaultValue}} [default to {{defaultValue}}]{{/defaultValue}}{{#allowableValues}} [enum: {{#values}}{{{.}}}{{^-last}}, {{/-last}}{{/values}}]{{/allowableValues}}
    {{/allParams}}
    ### Return type
    {{#returnType}}{{#returnTypeIsPrimitive}}**{{returnType}}**{{/returnTypeIsPrimitive}}{{^returnTypeIsPrimitive}}{{#generateModelDocs}}[**{{returnType}}**]({{returnBaseType}}.md){{/generateModelDocs}}{{^generateModelDocs}}**{{returnType}}**{{/generateModelDocs}}{{/returnTypeIsPrimitive}}{{/returnType}}{{^returnType}}null (empty response body){{/returnType}}
    ### Authorization
    {{^authMethods}}No authorization required{{/authMethods}}{{#authMethods}}[{{name}}](../README.md#{{name}}){{^-last}}, {{/-last}}{{/authMethods}}
    ### HTTP request headers
    - **Content-Type**: {{#consumes}}{{{mediaType}}}{{#hasMore}}, {{/hasMore}}{{/consumes}}{{^consumes}}Not defined{{/consumes}}
    - **Accept**: {{#produces}}{{{mediaType}}}{{#hasMore}}, {{/hasMore}}{{/produces}}{{^produces}}Not defined{{/produces}}
    {{/operation}}
    {{/operations}}

    model.mustache

    The models file could resemble the following.

    {{#models}}
    {{#model}}
    # {{{packageName}}}.{{modelPackage}}.{{{classname}}}
    ## Properties
    Name | Type | Description | Notes
    ------------ | ------------- | ------------- | -------------
    {{#parent}}
    {{#parentVars}}
    **{{name}}** | {{#isPrimitiveType}}**{{dataType}}**{{/isPrimitiveType}}{{^isPrimitiveType}}[**{{dataType}}**]({{complexType}}.md){{/isPrimitiveType}} | {{description}} | {{^required}}[optional] {{/required}}{{#readOnly}}[readonly] {{/readOnly}}{{#defaultValue}}[default to {{{.}}}]{{/defaultValue}}
    {{/parentVars}}
    {{/parent}}
    {{#vars}}**{{name}}** | {{#isPrimitiveType}}**{{dataType}}**{{/isPrimitiveType}}{{^isPrimitiveType}}[**{{dataType}}**]({{complexType}}.md){{/isPrimitiveType}} | {{description}} | {{^required}}[optional] {{/required}}{{#readOnly}}[readonly] {{/readOnly}}{{#defaultValue}}[default to {{{.}}}]{{/defaultValue}}
    {{/vars}}
    [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
    {{/model}}
    {{/models}}

    Build it

    To compile quickly to test this out, you can run mvn clean package -DskipTests.

    When implementing a more robust generator, you'll want to run all tests as well: mvn clean package

    Compile Sample

    The new.sh script created bin/common-mark-documentation-petstore.sh:

    #!/bin/sh
    SCRIPT="$0"
    while [ -h "$SCRIPT" ] ; do
    ls=$(ls -ld "$SCRIPT")
    link=$(expr "$ls" : '.*-> \(.*\)$')
    if expr "$link" : '/.*' > /dev/null; then
    SCRIPT="$link"
    else
    SCRIPT=$(dirname "$SCRIPT")/"$link"
    fi
    done
    if [ ! -d "${APP_DIR}" ]; then
    APP_DIR=$(dirname "$SCRIPT")/..
    APP_DIR=$(cd "${APP_DIR}"; pwd)
    fi
    executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar"
    if [ ! -f "$executable" ]
    then
    mvn clean package
    fi
    # if you've executed sbt assembly previously it will use that instead.
    export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties"
    ags="$@ generate -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g common-mark -o samples/documentation/petstore/common/mark"
    java ${JAVA_OPTS} -jar ${executable} ${ags}

    This script is often used to apply default options for generation. A common option in most of these script is to define the template directory as the generator's directory under resources. This allows template maintainers to modify and test out template changes which don't require recompilation of the entire project. You'd still need to recompile the project in full if you add or modify behaviors to the generator (such as adding a CliOption).

    Add -t modules/openapi-generator/src/main/resources/common-mark-documentation to ags line to simplify the evaluation of template-only modifications:

    diff --git a/bin/markdown-documentation-petstore.sh b/bin/markdown-documentation-petstore.sh
    index d816771478..94b4ce6d12 100644
    --- a/bin/markdown-documentation-petstore.sh
    +++ b/bin/markdown-documentation-petstore.sh
    @@ -26,6 +26,6 @@ fi
    # if you've executed sbt assembly previously it will use that instead.
    export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties"
    -ags="$@ generate -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g common-mark -o samples/documentation/petstore/common-mark"
    +ags="$@ generate -t modules/openapi-generator/src/main/resources/common-mark-documentation -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g common-mark -o samples/documentation/petstore/common/markdown"
    java ${JAVA_OPTS} -jar ${executable} ${ags}

    Verify output

    Creating a new generator will be an iterative task. Once you've generated the sample, you'll want to try it out. For compiled client/server outputs, this would mean running the code or creating a small sample project to consume your artifact just to make sure it works.

    For markdown, you can open in Visual Studio Code or any other editor with a markdown preview. Not all editors support relative links to other markdown documents. To test the output in this guide, install markserv:

    npm install --global markserv

    Now, you can serve the output directory directly and test your links:

    markserv samples/documentation/petstore/common/markdown

    That's it! You've created your first generator!

    Last updated on by Akihito Nakano
    - + @@ -46,7 +46,7 @@ - + diff --git a/docs/online/index.html b/docs/online/index.html index 746ccc470b6..83f480f2387 100644 --- a/docs/online/index.html +++ b/docs/online/index.html @@ -28,12 +28,12 @@

    Online

    Hosted

    We offer online services, publicly and free of charge:

    Hosting Sponsor
    -Linode Logo

    These services are beta and do not have any guarantee on service level

    Docker Image

    The openapi-generator-online Docker image can act as a self-hosted web application and API for generating code. This container can be incorporated into a CI pipeline, and requires at least two HTTP requests and some docker orchestration to access generated code.

    Example usage:

    # Start container at port 8888 and save the container id
    CID=$(docker run -d -p 8888:8080 openapitools/openapi-generator-online)
    # allow for startup
    sleep 10
    # Get the IP of the running container (optional)
    GEN_IP=$(docker inspect --format '{{.NetworkSettings.IPAddress}}' ${CID})
    # Execute an HTTP request to generate a Ruby client
    curl -X POST --header 'Content-Type: application/json' \
    --header 'Accept: application/json' \
    -d '{"openAPIUrl": "https://raw.githubusercontent.com/openapitools/openapi-generator/master/modules/openapi-generator/src/test/resources/2_0/petstore.yaml"}' \
    'http://localhost:8888/api/gen/clients/ruby'
    # Example output:
    # {"code":"c2d483.3.4672-40e9-91df-b9ffd18d22b8","link":"http://localhost:8888/api/gen/download/c2d483.3.4672-40e9-91df-b9ffd18d22b8"}
    # Download the generated zip file (using "code" provided from your output)
    wget http://localhost:8888/api/gen/download/c2d483.3.4672-40e9-91df-b9ffd18d22b8
    # Unzip the file
    unzip c2d483.3.4672-40e9-91df-b9ffd18d22b8
    # Shutdown the openapi generator image
    docker stop ${CID} && docker rm ${CID}

    Local/Self-hosting

    If you prefer to run the service locally, here are the steps:

    mvn clean install
    cd modules/openapi-generator-online
    mvn spring-boot:run

    The online openapi-generator can be run via Docker as well.

    For example, to generate Ruby API client, simply send the following HTTP request using curl:

    curl -X POST -H "content-type:application/json" -d '{"openAPIUrl":"https://raw.githubusercontent.com/openapitools/openapi-generator/master/modules/openapi-generator/src/test/resources/2_0/petstore.yaml"}' \
    http://localhost:8080/api/gen/clients/ruby

    Then you will receive a JSON response with the URL to download the zipped code.

    To customize the SDK, you can POST to http://localhost:8080/gen/clients/{generator} with the following HTTP body:

    {
    "options": {},
    "openAPIUrl": "https://raw.githubusercontent.com/openapitools/openapi-generator/master/modules/openapi-generator/src/test/resources/2_0/petstore.yaml"
    }

    Here, the options for a language can be obtained by submitting a GET request to http://locahost:8080/api/gen/clients/{generator}:

    For example, curl http://localhost:8080/api/gen/clients/python returns

    "packageName":{
    "opt":"packageName",
    "description":"python package name (convention: snake_case).",
    "type":"string",
    "default":"openapi_client"
    },
    "packageVersion":{
    "opt":"packageVersion",
    "description":"python package version.",
    "type":"string",
    "default":"1.0.0"
    },
    "sortParamsByRequiredFlag":{
    "opt":"sortParamsByRequiredFlag",
    "description":"Sort method arguments to place required parameters before optional parameters.",
    "type":"boolean",
    "default":"true"
    }
    {}

    To set package name to pet_store, the HTTP body of the request is as follows:

    {
    "options": {
    "packageName": "pet_store"
    },
    "openAPIUrl": "https://raw.githubusercontent.com/openapitools/openapi-generator/master/modules/openapi-generator/src/test/resources/2_0/petstore.yaml"
    }

    and here is the curl command:

    curl -H "Content-type: application/json" \
    -X POST \
    -d '{"options": {"packageName": "pet_store"},"openAPIUrl": "https://raw.githubusercontent.com/openapitools/openapi-generator/master/modules/openapi-generator/src/test/resources/2_0/petstore.yaml"}' \
    http://localhost:8080/api/gen/clients/python

    Instead of using openAPIUrl with an URL to the OpenAPI spec, one can include the spec in the JSON payload with spec:

    {
    "options": {},
    "spec": {
    "swagger": "2.0",
    "info": {
    "version": "1.0.0",
    "title": "Test API"
    },
    ...
    }
    }
    Last updated on by Tatsuro Shibamura
    +Linode Logo

    These services are beta and do not have any guarantee on service level

    Docker Image

    The openapi-generator-online Docker image can act as a self-hosted web application and API for generating code. This container can be incorporated into a CI pipeline, and requires at least two HTTP requests and some docker orchestration to access generated code.

    Example usage:

    # Start container at port 8888 and save the container id
    CID=$(docker run -d -p 8888:8080 openapitools/openapi-generator-online)
    # allow for startup
    sleep 10
    # Get the IP of the running container (optional)
    GEN_IP=$(docker inspect --format '{{.NetworkSettings.IPAddress}}' ${CID})
    # Execute an HTTP request to generate a Ruby client
    curl -X POST --header 'Content-Type: application/json' \
    --header 'Accept: application/json' \
    -d '{"openAPIUrl": "https://raw.githubusercontent.com/openapitools/openapi-generator/master/modules/openapi-generator/src/test/resources/2_0/petstore.yaml"}' \
    'http://localhost:8888/api/gen/clients/ruby'
    # Example output:
    # {"code":"c2d483.3.4672-40e9-91df-b9ffd18d22b8","link":"http://localhost:8888/api/gen/download/c2d483.3.4672-40e9-91df-b9ffd18d22b8"}
    # Download the generated zip file (using "code" provided from your output)
    wget http://localhost:8888/api/gen/download/c2d483.3.4672-40e9-91df-b9ffd18d22b8
    # Unzip the file
    unzip c2d483.3.4672-40e9-91df-b9ffd18d22b8
    # Shutdown the openapi generator image
    docker stop ${CID} && docker rm ${CID}

    Local/Self-hosting

    If you prefer to run the service locally, here are the steps:

    mvn clean install
    cd modules/openapi-generator-online
    mvn spring-boot:run

    The online openapi-generator can be run via Docker as well.

    For example, to generate Ruby API client, simply send the following HTTP request using curl:

    curl -X POST -H "content-type:application/json" -d '{"openAPIUrl":"https://raw.githubusercontent.com/openapitools/openapi-generator/master/modules/openapi-generator/src/test/resources/2_0/petstore.yaml"}' \
    http://localhost:8080/api/gen/clients/ruby

    Then you will receive a JSON response with the URL to download the zipped code.

    To customize the SDK, you can POST to http://localhost:8080/gen/clients/{generator} with the following HTTP body:

    {
    "options": {},
    "openAPIUrl": "https://raw.githubusercontent.com/openapitools/openapi-generator/master/modules/openapi-generator/src/test/resources/2_0/petstore.yaml"
    }

    Here, the options for a language can be obtained by submitting a GET request to http://locahost:8080/api/gen/clients/{generator}:

    For example, curl http://localhost:8080/api/gen/clients/python returns

    "packageName":{
    "opt":"packageName",
    "description":"python package name (convention: snake_case).",
    "type":"string",
    "default":"openapi_client"
    },
    "packageVersion":{
    "opt":"packageVersion",
    "description":"python package version.",
    "type":"string",
    "default":"1.0.0"
    },
    "sortParamsByRequiredFlag":{
    "opt":"sortParamsByRequiredFlag",
    "description":"Sort method arguments to place required parameters before optional parameters.",
    "type":"boolean",
    "default":"true"
    }
    {}

    To set package name to pet_store, the HTTP body of the request is as follows:

    {
    "options": {
    "packageName": "pet_store"
    },
    "openAPIUrl": "https://raw.githubusercontent.com/openapitools/openapi-generator/master/modules/openapi-generator/src/test/resources/2_0/petstore.yaml"
    }

    and here is the curl command:

    curl -H "Content-type: application/json" \
    -X POST \
    -d '{"options": {"packageName": "pet_store"},"openAPIUrl": "https://raw.githubusercontent.com/openapitools/openapi-generator/master/modules/openapi-generator/src/test/resources/2_0/petstore.yaml"}' \
    http://localhost:8080/api/gen/clients/python

    Instead of using openAPIUrl with an URL to the OpenAPI spec, one can include the spec in the JSON payload with spec:

    {
    "options": {},
    "spec": {
    "swagger": "2.0",
    "info": {
    "version": "1.0.0",
    "title": "Test API"
    },
    ...
    }
    }
    Last updated on by Akihito Nakano
    - + @@ -47,7 +47,7 @@ - + diff --git a/docs/plugins/index.html b/docs/plugins/index.html index d711166a876..1bb447b72d0 100644 --- a/docs/plugins/index.html +++ b/docs/plugins/index.html @@ -27,12 +27,12 @@
    -

    Plugins

    Maven

    A Maven plugin to support the OpenAPI generator project

    Example

    Add to your build->plugins section (default phase is generate-sources phase)

    <plugin>
    <groupId>org.openapitools</groupId>
    <artifactId>openapi-generator-maven-plugin</artifactId>
    <version>3.3.4</version>
    <executions>
    <execution>
    <goals>
    <goal>generate</goal>
    </goals>
    <configuration>
    <inputSpec>${project.basedir}/src/main/resources/api.yaml</inputSpec>
    <generatorName>java</generatorName>
    <configOptions>
    <sourceFolder>src/gen/java/main</sourceFolder>
    </configOptions>
    </configuration>
    </execution>
    </executions>
    </plugin>

    Followed by:

    mvn clean compile

    For full details of all options, see the plugin README.

    Gradle

    This gradle plugin offers a declarative DSL via extensions (these are Gradle project extensions). These map almost fully 1:1 with the options you’d pass to the CLI or Maven plugin. The plugin maps the extensions to a task of the same name to provide a clean API. If you’re interested in the extension/task mapping concept from a high-level, you can check out Gradle’s docs.

    To include in your project, add the following to build.gradle:

    buildscript {
    repositories {
    mavenLocal()
    maven { url "https://repo1.maven.org/maven2" }
    }
    dependencies {
    classpath "org.openapitools:openapi-generator-gradle-plugin:3.3.4"
    }
    }
    apply plugin: 'org.openapi.generator'

    This gives access to the following tasks:

    TaskDescription
    openApiGenerateGenerate code via Open API Tools Generator for Open API 2.0 or 3.x specification documents.
    openApiGeneratorsLists generators available via Open API Generators.
    openApiMetaGenerates a new generator to be consumed via Open API Generator.
    openApiValidateValidates an Open API 2.0 or 3.x specification document.

    The plugin implements the above tasks as project extensions of the same name. If you’d like to declare these tasks as dependencies to other tasks (using dependsOn), you’ll need a task reference. e.g.:

    compileJava.dependsOn tasks.openApiGenerate

    For full details of all options, see the plugin README.

    Example

    An example task for generating a kotlin client:

    openApiGenerate {
    generatorName = "kotlin"
    inputSpec = "$rootDir/specs/petstore-v3.0.yaml".toString()
    outputDir = "$buildDir/generated".toString()
    apiPackage = "org.openapi.example.api"
    invokerPackage = "org.openapi.example.invoker"
    modelPackage = "org.openapi.example.model"
    modelFilesConstrainedTo = [
    "Error"
    ]
    configOptions = [
    dateLibrary: "java8"
    ]
    }
    Last updated on by Tatsuro Shibamura
    +

    Plugins

    Maven

    A Maven plugin to support the OpenAPI generator project

    Example

    Add to your build->plugins section (default phase is generate-sources phase)

    <plugin>
    <groupId>org.openapitools</groupId>
    <artifactId>openapi-generator-maven-plugin</artifactId>
    <version>3.3.4</version>
    <executions>
    <execution>
    <goals>
    <goal>generate</goal>
    </goals>
    <configuration>
    <inputSpec>${project.basedir}/src/main/resources/api.yaml</inputSpec>
    <generatorName>java</generatorName>
    <configOptions>
    <sourceFolder>src/gen/java/main</sourceFolder>
    </configOptions>
    </configuration>
    </execution>
    </executions>
    </plugin>

    Followed by:

    mvn clean compile

    For full details of all options, see the plugin README.

    Gradle

    This gradle plugin offers a declarative DSL via extensions (these are Gradle project extensions). These map almost fully 1:1 with the options you’d pass to the CLI or Maven plugin. The plugin maps the extensions to a task of the same name to provide a clean API. If you’re interested in the extension/task mapping concept from a high-level, you can check out Gradle’s docs.

    To include in your project, add the following to build.gradle:

    buildscript {
    repositories {
    mavenLocal()
    maven { url "https://repo1.maven.org/maven2" }
    }
    dependencies {
    classpath "org.openapitools:openapi-generator-gradle-plugin:3.3.4"
    }
    }
    apply plugin: 'org.openapi.generator'

    This gives access to the following tasks:

    TaskDescription
    openApiGenerateGenerate code via Open API Tools Generator for Open API 2.0 or 3.x specification documents.
    openApiGeneratorsLists generators available via Open API Generators.
    openApiMetaGenerates a new generator to be consumed via Open API Generator.
    openApiValidateValidates an Open API 2.0 or 3.x specification document.

    The plugin implements the above tasks as project extensions of the same name. If you’d like to declare these tasks as dependencies to other tasks (using dependsOn), you’ll need a task reference. e.g.:

    compileJava.dependsOn tasks.openApiGenerate

    For full details of all options, see the plugin README.

    Example

    An example task for generating a kotlin client:

    openApiGenerate {
    generatorName = "kotlin"
    inputSpec = "$rootDir/specs/petstore-v3.0.yaml".toString()
    outputDir = "$buildDir/generated".toString()
    apiPackage = "org.openapi.example.api"
    invokerPackage = "org.openapi.example.invoker"
    modelPackage = "org.openapi.example.model"
    modelFilesConstrainedTo = [
    "Error"
    ]
    configOptions = [
    dateLibrary: "java8"
    ]
    }
    Last updated on by Akihito Nakano
    - + @@ -46,7 +46,7 @@ - + diff --git a/docs/release-3-0-0/index.html b/docs/release-3-0-0/index.html index 79489736ad3..472e8410be0 100644 --- a/docs/release-3-0-0/index.html +++ b/docs/release-3-0-0/index.html @@ -32,7 +32,7 @@ - + diff --git a/docs/release-summary/index.html b/docs/release-summary/index.html index 2e9b3d9b14b..abeb3660b06 100644 --- a/docs/release-summary/index.html +++ b/docs/release-summary/index.html @@ -27,12 +27,12 @@
    -

    Release Summary

    Versioning

    We version artifacts in the common major.minor.patch strategy.

    We decided versions should be incremented according to the following rules. The examples provided below are not exhaustive.

    PartBreaking Changes?RuleExamples
    majorYESbreaking changes without fallback
    • New Features
    • Large refactors
    • Removal of deprecated code
    • Changes to coding interfaces
    • Large changes to template bound variables
    minorALLOWEDbreaking changes with fallback
    • Adding new generator behavior which doesn't affect custom templates (or does, with config option for old behavior)
    • Changing generator templates in a way in which switching to custom templates results in old behavior
    • Introducing deprecated methods in generators or other shared code
    patchNOnew features without breaking changes
    • New generators
    • Bug fixes in template or generators

    Cadence

    For patch release (e.g. 3.0.5 to 3.0.6), we plan to do it on a weekly basis.

    For minor release (e.g. 3.1.6 to 3.2.0), we plan to do it on a monthly basis.

    For major releases (e.g. 3.3.6 to 4.0.0), we plan to do it on a quarterly basis.

    Last updated on by Tatsuro Shibamura
    +

    Release Summary

    Versioning

    We version artifacts in the common major.minor.patch strategy.

    We decided versions should be incremented according to the following rules. The examples provided below are not exhaustive.

    PartBreaking Changes?RuleExamples
    majorYESbreaking changes without fallback
    • New Features
    • Large refactors
    • Removal of deprecated code
    • Changes to coding interfaces
    • Large changes to template bound variables
    minorALLOWEDbreaking changes with fallback
    • Adding new generator behavior which doesn't affect custom templates (or does, with config option for old behavior)
    • Changing generator templates in a way in which switching to custom templates results in old behavior
    • Introducing deprecated methods in generators or other shared code
    patchNOnew features without breaking changes
    • New generators
    • Bug fixes in template or generators

    Cadence

    For patch release (e.g. 3.0.5 to 3.0.6), we plan to do it on a weekly basis.

    For minor release (e.g. 3.1.6 to 3.2.0), we plan to do it on a monthly basis.

    For major releases (e.g. 3.3.6 to 4.0.0), we plan to do it on a quarterly basis.

    Last updated on by Akihito Nakano
    - + @@ -46,7 +46,7 @@ - + diff --git a/docs/roadmap/index.html b/docs/roadmap/index.html index df3bfdf7113..9b18d6881d6 100644 --- a/docs/roadmap/index.html +++ b/docs/roadmap/index.html @@ -27,12 +27,12 @@
    -

    Roadmap

    This document lists short-term, medium-term, and long-term goals for the project.


    NOTE

    These are goals, not necessarily commitments. The sections are not intended to represent exclusive focus during these terms. For example, when you start at a college or university you may have a long-term goal to graduate and a short-term goal to find a job for supplemental income. We will similarly work toward many of our medium-term and long-term goals in the near future as we move toward meeting our short-term goals.


    Short-term

    Usability, stability, and marketing.

    Short term are focused on improving contributor and user productivity (part of this is getting the word out).

    • CLI improvements
      • Search functionality (e.g. what generators support retrofit, what generators are available for kotlin)
    • Build automation improvements
    • Discuss consolidating current third-party build systems
    • Investigate custom docker containerization for prepared build environments
    • Automated release stability
    • General
    • OAS3.0 features support: anyOf, oneOf, callbacks, etc
    • Consider opt-in telemetry about generators being used, limited to a counter of invocations by generator name). This would allow us to make prioritization decisions based on statistics.
    • Code clean up
    • Documentation
    • Static pages, preferably on gh-pages, devoted to each generator
    • Explain generator options
    • Centralized docs on generated code usage/examples/configuration

    Medium-term

    Feature set, well-defined API (code and templates), and extensibility improvements.

    API

    • Typed representation of the model bound to our templates. As it is, everything is treated an an Object, and this can lead to changes in the interface which might be unexpected from the template perspective.
    • Feature set (potential generators to add; not an exhaustive list)
      • Azure functions (node.js, server)
      • Finagle HTTP Client (Scala, client)
      • Finagle Http Server (Scala, server)
      • Finatra (Scala, server)
      • Kotlin Spring MVC/Springboot (server)
      • C++ Server, any framework (server)

    General

    • Migrate from Maven to Gradle
    • Java 9+ support
    • Feature set (other options to investigate)
    • SPI plugins
    • Customizable templating engines (handlebars support)
    • Unit-testing templates (to previously mentioned explicit type as an interface to the template)
    • Reduce coupling
    • Make types extending CodegenConfig become the generation entrypoint
    • Allow current CodegenConfig types to define templating engine
    • Allow current CodegenConfig types to modify workflow (currently encapsulated in DefaultGenerator and tightly coupled to the template engine
    • Clearer reuse of "language" features, outside of "generator" types. That is, rather than enforcing polymorphic sharing of "language" which currently allows the super type to redefine framework-specific mapping functionality, generators could compose one or more language support types.
    • Define template deprecation/removal process

    Long-term

    Expanding tooling offered, integrations, potentially SaaS offering to partially fund efforts.

    • Generator UI wrappers
      • Move jimschubert/intellij-swagger-codegen plugin under the org, and rename
      • Look into an Eclipse UI wrapper around the generator
      • Look at Visual Studio Code (and/or Atom, sublime text) integration
    • Provide a native GUI for viewing/editing specs. Most tools are currently geared toward developers, but often times it may be non-technical business users who are interested in an API.
    • A paid service (SaaS) for generation may be enticing for some users. Such a service would allow for statistics (mentioned earlier in telemetry)
    • Additional tools
    • node.js build system(s) integration (grunt/gulp/webpack/etc)
    • ruby gem
    • others (which may require previously mentioned SaaS API)
    Last updated on by Tatsuro Shibamura
    +

    Roadmap

    This document lists short-term, medium-term, and long-term goals for the project.


    NOTE

    These are goals, not necessarily commitments. The sections are not intended to represent exclusive focus during these terms. For example, when you start at a college or university you may have a long-term goal to graduate and a short-term goal to find a job for supplemental income. We will similarly work toward many of our medium-term and long-term goals in the near future as we move toward meeting our short-term goals.


    Short-term

    Usability, stability, and marketing.

    Short term are focused on improving contributor and user productivity (part of this is getting the word out).

    • CLI improvements
      • Search functionality (e.g. what generators support retrofit, what generators are available for kotlin)
    • Build automation improvements
    • Discuss consolidating current third-party build systems
    • Investigate custom docker containerization for prepared build environments
    • Automated release stability
    • General
    • OAS3.0 features support: anyOf, oneOf, callbacks, etc
    • Consider opt-in telemetry about generators being used, limited to a counter of invocations by generator name). This would allow us to make prioritization decisions based on statistics.
    • Code clean up
    • Documentation
    • Static pages, preferably on gh-pages, devoted to each generator
    • Explain generator options
    • Centralized docs on generated code usage/examples/configuration

    Medium-term

    Feature set, well-defined API (code and templates), and extensibility improvements.

    API

    • Typed representation of the model bound to our templates. As it is, everything is treated an an Object, and this can lead to changes in the interface which might be unexpected from the template perspective.
    • Feature set (potential generators to add; not an exhaustive list)
      • Azure functions (node.js, server)
      • Finagle HTTP Client (Scala, client)
      • Finagle Http Server (Scala, server)
      • Finatra (Scala, server)
      • Kotlin Spring MVC/Springboot (server)
      • C++ Server, any framework (server)

    General

    • Migrate from Maven to Gradle
    • Java 9+ support
    • Feature set (other options to investigate)
    • SPI plugins
    • Customizable templating engines (handlebars support)
    • Unit-testing templates (to previously mentioned explicit type as an interface to the template)
    • Reduce coupling
    • Make types extending CodegenConfig become the generation entrypoint
    • Allow current CodegenConfig types to define templating engine
    • Allow current CodegenConfig types to modify workflow (currently encapsulated in DefaultGenerator and tightly coupled to the template engine
    • Clearer reuse of "language" features, outside of "generator" types. That is, rather than enforcing polymorphic sharing of "language" which currently allows the super type to redefine framework-specific mapping functionality, generators could compose one or more language support types.
    • Define template deprecation/removal process

    Long-term

    Expanding tooling offered, integrations, potentially SaaS offering to partially fund efforts.

    • Generator UI wrappers
      • Move jimschubert/intellij-swagger-codegen plugin under the org, and rename
      • Look into an Eclipse UI wrapper around the generator
      • Look at Visual Studio Code (and/or Atom, sublime text) integration
    • Provide a native GUI for viewing/editing specs. Most tools are currently geared toward developers, but often times it may be non-technical business users who are interested in an API.
    • A paid service (SaaS) for generation may be enticing for some users. Such a service would allow for statistics (mentioned earlier in telemetry)
    • Additional tools
    • node.js build system(s) integration (grunt/gulp/webpack/etc)
    • ruby gem
    • others (which may require previously mentioned SaaS API)
    Last updated on by Akihito Nakano
    - + @@ -46,7 +46,7 @@ - + diff --git a/docs/spec-info/index.html b/docs/spec-info/index.html index b7c1bfc550d..2c617badfeb 100644 --- a/docs/spec-info/index.html +++ b/docs/spec-info/index.html @@ -27,12 +27,12 @@
    -
    Last updated on by Tatsuro Shibamura
    +
    Last updated on by Akihito Nakano
    - + @@ -46,7 +46,7 @@ - + diff --git a/docs/swagger-codegen-migration/index.html b/docs/swagger-codegen-migration/index.html index 73cca3f38e4..082eb04d8f0 100644 --- a/docs/swagger-codegen-migration/index.html +++ b/docs/swagger-codegen-migration/index.html @@ -38,12 +38,12 @@ The syntax inside the file stays the same.

    You don't need to rename t (When there is no .openapi-generator-ignore in a folder, if a .swagger-codegen-ignore file is present it will be considered and renamed to .openapi-generator-ignore).

    Metadata folder

    The metatata folder (to store the VERSION file for example) is now called .openapi-generator/ instead of .swagger-codegen/.

    New default values for the generated code

    If you use a generator without specifying each parameter, you might see some differences in the generated code. As example the default package name used in the generated code has changed. You need to have a look at the specific value, depending of your target language, but often Swagger îs replaced by OpenAPITools and io.swagger is replaced by org.openapitools. -Concretely if you did not specify anything when you are generating java code, a file org/openapitools/api/PetApi.java might be generated instead of io/swagger/api/PetApi.java.

    If this is a problem for you, you need to explicitly set the the parameter value in order to match with the swagger-codgen default value (apiPackage == io.swagger in the previous example with the java generator).

    New fully qualified name for the classes

    If you have extended some generators in your project, and you are looking for a specific class, replace the io.swagger.codegen package (old name) with org.openapitools.codegen package (new name).

    Example: org.openapitools.codegen.DefaultGenerator

    Body parameter name

    ‼️ Since 4.0.0-beta, the body parameter name in OAS v2 is automatically preserved in the vendor extension x-codegen-request-body-name

    In OpenAPI spec v3, there's no body parameter, which is replaced by Request Body Object. The parameter name for Request Body is named automatically based on the model name (e.g. User). To control how the "Request Body" parameter is named, please add the vendor extension x-codegen-request-body-name to the operation:

    OpenAPI Spec v3:

    paths:
    /pet:
    post:
    tags:
    - pet
    summary: Add a new pet to the store
    description: ''
    operationId: addPet
    x-codegen-request-body-name: new_body_name
    responses:
    '405':
    description: Invalid input
    security:
    - petstore_auth:
    - 'write:pets'
    - 'read:pets'
    requestBody:
    $ref: '#/components/requestBodies/Pet'

    OpenAPI Spec v2:

    paths:
    /pet:
    post:
    tags:
    - pet
    summary: Add a new pet to the store
    description: ''
    operationId: addPet
    x-codegen-request-body-name: new_body_name
    consumes:
    - application/json
    - application/xml
    produces:
    - application/xml
    - application/json
    parameters:
    - in: body
    name: body
    description: Pet object that needs to be added to the store
    required: true
    schema:
    $ref: '#/definitions/Pet'
    responses:
    '405':
    description: Invalid input
    security:
    - petstore_auth:
    - 'write:pets'
    - 'read:pets'

    If your API client is using named parameters in the function call (e.g. Perl required & optional parameters, Ruby optional parameters), you will need to add x-codegen-request-body-name to the spec to restore the original body parameter name.

    Default basePath

    The default basePath has been changed from https://localhost to http://localhost (http without s)

    Nullable

    OpenAPI spec v3 has better support for nullable. If you're still using OpenAPI/Swagger spec v2, please use x-nullable: true instead.

    Last updated on by Tatsuro Shibamura
    +Concretely if you did not specify anything when you are generating java code, a file org/openapitools/api/PetApi.java might be generated instead of io/swagger/api/PetApi.java.

    If this is a problem for you, you need to explicitly set the the parameter value in order to match with the swagger-codgen default value (apiPackage == io.swagger in the previous example with the java generator).

    New fully qualified name for the classes

    If you have extended some generators in your project, and you are looking for a specific class, replace the io.swagger.codegen package (old name) with org.openapitools.codegen package (new name).

    Example: org.openapitools.codegen.DefaultGenerator

    Body parameter name

    ‼️ Since 4.0.0-beta, the body parameter name in OAS v2 is automatically preserved in the vendor extension x-codegen-request-body-name

    In OpenAPI spec v3, there's no body parameter, which is replaced by Request Body Object. The parameter name for Request Body is named automatically based on the model name (e.g. User). To control how the "Request Body" parameter is named, please add the vendor extension x-codegen-request-body-name to the operation:

    OpenAPI Spec v3:

    paths:
    /pet:
    post:
    tags:
    - pet
    summary: Add a new pet to the store
    description: ''
    operationId: addPet
    x-codegen-request-body-name: new_body_name
    responses:
    '405':
    description: Invalid input
    security:
    - petstore_auth:
    - 'write:pets'
    - 'read:pets'
    requestBody:
    $ref: '#/components/requestBodies/Pet'

    OpenAPI Spec v2:

    paths:
    /pet:
    post:
    tags:
    - pet
    summary: Add a new pet to the store
    description: ''
    operationId: addPet
    x-codegen-request-body-name: new_body_name
    consumes:
    - application/json
    - application/xml
    produces:
    - application/xml
    - application/json
    parameters:
    - in: body
    name: body
    description: Pet object that needs to be added to the store
    required: true
    schema:
    $ref: '#/definitions/Pet'
    responses:
    '405':
    description: Invalid input
    security:
    - petstore_auth:
    - 'write:pets'
    - 'read:pets'

    If your API client is using named parameters in the function call (e.g. Perl required & optional parameters, Ruby optional parameters), you will need to add x-codegen-request-body-name to the spec to restore the original body parameter name.

    Default basePath

    The default basePath has been changed from https://localhost to http://localhost (http without s)

    Nullable

    OpenAPI spec v3 has better support for nullable. If you're still using OpenAPI/Swagger spec v2, please use x-nullable: true instead.

    Last updated on by Akihito Nakano
    - + @@ -57,7 +57,7 @@ Concretely if you did not specify anything when you are generating java code, a - + diff --git a/docs/templating/index.html b/docs/templating/index.html index ff0e5ae9a64..5050a28df4a 100644 --- a/docs/templating/index.html +++ b/docs/templating/index.html @@ -37,7 +37,7 @@ For more details on Mustache see - + diff --git a/docs/usage/index.html b/docs/usage/index.html index e35b9ca621b..a45f42090cd 100644 --- a/docs/usage/index.html +++ b/docs/usage/index.html @@ -35,7 +35,7 @@ modified by --includes-base-dir.

     
     
     
    -
    +
     
     
     
    diff --git a/e360e27f.90bd5915.js b/e360e27f.90bd5915.js
    deleted file mode 100644
    index f264ca1c977..00000000000
    --- a/e360e27f.90bd5915.js
    +++ /dev/null
    @@ -1 +0,0 @@
    -(window.webpackJsonp=window.webpackJsonp||[]).push([[146],{269:function(e,t,n){"use strict";n.r(t),n.d(t,"frontMatter",(function(){return l})),n.d(t,"metadata",(function(){return p})),n.d(t,"rightToc",(function(){return i})),n.d(t,"default",(function(){return s}));var a=n(1),r=n(9),o=(n(0),n(293)),l={id:"plugins",title:"Plugins"},p={id:"plugins",title:"Plugins",description:"## Maven",source:"@site/../docs/plugins.md",permalink:"/docs/plugins",editUrl:"https://github.com/OpenAPITools/openapi-generator/edit/master/website/../docs/plugins.md",lastUpdatedBy:"Tatsuro Shibamura",lastUpdatedAt:1580871108,sidebar:"docs",previous:{title:"CLI Installation",permalink:"/docs/installation"},next:{title:"Online",permalink:"/docs/online"}},i=[{value:"Maven",id:"maven",children:[{value:"Example",id:"example",children:[]}]},{value:"Gradle",id:"gradle",children:[{value:"Example",id:"example-1",children:[]}]}],c={rightToc:i};function s(e){var t=e.components,n=Object(r.a)(e,["components"]);return Object(o.b)("wrapper",Object(a.a)({},c,n,{components:t,mdxType:"MDXLayout"}),Object(o.b)("h2",{id:"maven"},"Maven"),Object(o.b)("p",null,"A Maven plugin to support the OpenAPI generator project"),Object(o.b)("h3",{id:"example"},"Example"),Object(o.b)("p",null,"Add to your ",Object(o.b)("inlineCode",{parentName:"p"},"build->plugins")," section (default phase is ",Object(o.b)("inlineCode",{parentName:"p"},"generate-sources")," phase)"),Object(o.b)("pre",null,Object(o.b)("code",Object(a.a)({parentName:"pre"},{className:"language-xml"}),"\n    org.openapitools\n    openapi-generator-maven-plugin\n    3.3.4\n    \n        \n            \n                generate\n            \n            \n                ${project.basedir}/src/main/resources/api.yaml\n                java\n                \n                   src/gen/java/main\n                \n            \n        \n    \n\n")),Object(o.b)("p",null,"Followed by:"),Object(o.b)("pre",null,Object(o.b)("code",Object(a.a)({parentName:"pre"},{className:"language-bash"}),"mvn clean compile\n")),Object(o.b)("p",null,"For full details of all options, see the ",Object(o.b)("a",Object(a.a)({parentName:"p"},{href:"https://github.com/OpenAPITools/openapi-generator/tree/master/modules/openapi-generator-maven-plugin"}),"plugin README"),"."),Object(o.b)("h2",{id:"gradle"},"Gradle"),Object(o.b)("p",null,"This gradle plugin offers a declarative DSL via extensions (these are Gradle project extensions). These map almost fully 1:1 with the options you\u2019d pass to the CLI or Maven plugin. The plugin maps the extensions to a task of the same name to provide a clean API. If you\u2019re interested in the extension/task mapping concept from a high-level, you can check out ",Object(o.b)("a",Object(a.a)({parentName:"p"},{href:"https://docs.gradle.org/current/userguide/custom_plugins.html#sec:mapping_extension_properties_to_task_properties"}),"Gradle\u2019s docs"),"."),Object(o.b)("p",null,"To include in your project, add the following to ",Object(o.b)("inlineCode",{parentName:"p"},"build.gradle"),":"),Object(o.b)("pre",null,Object(o.b)("code",Object(a.a)({parentName:"pre"},{className:"language-groovy"}),'buildscript {\n  repositories {\n    mavenLocal()\n    maven { url "https://repo1.maven.org/maven2" }\n  }\n  dependencies {\n    classpath "org.openapitools:openapi-generator-gradle-plugin:3.3.4"\n  }\n}\n\napply plugin: \'org.openapi.generator\'\n')),Object(o.b)("p",null,"This gives access to the following tasks:"),Object(o.b)("table",null,Object(o.b)("thead",{parentName:"table"},Object(o.b)("tr",{parentName:"thead"},Object(o.b)("th",Object(a.a)({parentName:"tr"},{align:null}),"Task"),Object(o.b)("th",Object(a.a)({parentName:"tr"},{align:null}),"Description"))),Object(o.b)("tbody",{parentName:"table"},Object(o.b)("tr",{parentName:"tbody"},Object(o.b)("td",Object(a.a)({parentName:"tr"},{align:null}),"openApiGenerate"),Object(o.b)("td",Object(a.a)({parentName:"tr"},{align:null}),"Generate code via Open API Tools Generator for Open API 2.0 or 3.x specification documents.")),Object(o.b)("tr",{parentName:"tbody"},Object(o.b)("td",Object(a.a)({parentName:"tr"},{align:null}),"openApiGenerators"),Object(o.b)("td",Object(a.a)({parentName:"tr"},{align:null}),"Lists generators available via Open API Generators.")),Object(o.b)("tr",{parentName:"tbody"},Object(o.b)("td",Object(a.a)({parentName:"tr"},{align:null}),"openApiMeta"),Object(o.b)("td",Object(a.a)({parentName:"tr"},{align:null}),"Generates a new generator to be consumed via Open API Generator.")),Object(o.b)("tr",{parentName:"tbody"},Object(o.b)("td",Object(a.a)({parentName:"tr"},{align:null}),"openApiValidate"),Object(o.b)("td",Object(a.a)({parentName:"tr"},{align:null}),"Validates an Open API 2.0 or 3.x specification document.")))),Object(o.b)("blockquote",null,Object(o.b)("p",{parentName:"blockquote"},"The plugin implements the above tasks as project extensions of the same name. If you\u2019d like to declare these tasks as dependencies to other tasks (using ",Object(o.b)("inlineCode",{parentName:"p"},"dependsOn"),"), you\u2019ll need a task reference. e.g.:"),Object(o.b)("pre",{parentName:"blockquote"},Object(o.b)("code",Object(a.a)({parentName:"pre"},{className:"language-groovy"}),"compileJava.dependsOn tasks.openApiGenerate\n"))),Object(o.b)("p",null,"For full details of all options, see the ",Object(o.b)("a",Object(a.a)({parentName:"p"},{href:"https://github.com/OpenAPITools/openapi-generator/tree/master/modules/openapi-generator-gradle-plugin"}),"plugin README"),"."),Object(o.b)("h3",{id:"example-1"},"Example"),Object(o.b)("p",null,"An example task for generating a kotlin client:"),Object(o.b)("pre",null,Object(o.b)("code",Object(a.a)({parentName:"pre"},{className:"language-groovy"}),'openApiGenerate {\n    generatorName = "kotlin"\n    inputSpec = "$rootDir/specs/petstore-v3.0.yaml".toString()\n    outputDir = "$buildDir/generated".toString()\n    apiPackage = "org.openapi.example.api"\n    invokerPackage = "org.openapi.example.invoker"\n    modelPackage = "org.openapi.example.model"\n    modelFilesConstrainedTo = [\n            "Error"\n    ]\n    configOptions = [\n        dateLibrary: "java8"\n    ]\n}\n')))}s.isMDXComponent=!0},293:function(e,t,n){"use strict";n.d(t,"a",(function(){return b})),n.d(t,"b",(function(){return m}));var a=n(0),r=n.n(a);function o(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function l(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}function p(e){for(var t=1;t=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(a=0;a=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var c=r.a.createContext({}),s=function(e){var t=r.a.useContext(c),n=t;return e&&(n="function"==typeof e?e(t):p({},t,{},e)),n},b=function(e){var t=s(e.components);return r.a.createElement(c.Provider,{value:t},e.children)},u={inlineCode:"code",wrapper:function(e){var t=e.children;return r.a.createElement(r.a.Fragment,{},t)}},d=Object(a.forwardRef)((function(e,t){var n=e.components,a=e.mdxType,o=e.originalType,l=e.parentName,c=i(e,["components","mdxType","originalType","parentName"]),b=s(n),d=a,m=b["".concat(l,".").concat(d)]||b[d]||u[d]||o;return n?r.a.createElement(m,p({ref:t},c,{components:n})):r.a.createElement(m,p({ref:t},c))}));function m(e,t){var n=arguments,a=t&&t.mdxType;if("string"==typeof e||a){var o=n.length,l=new Array(o);l[0]=d;var p={};for(var i in t)hasOwnProperty.call(t,i)&&(p[i]=t[i]);p.originalType=e,p.mdxType="string"==typeof e?e:a,l[1]=p;for(var c=2;cplugins")," section (default phase is ",Object(o.b)("inlineCode",{parentName:"p"},"generate-sources")," phase)"),Object(o.b)("pre",null,Object(o.b)("code",Object(a.a)({parentName:"pre"},{className:"language-xml"}),"\n    org.openapitools\n    openapi-generator-maven-plugin\n    3.3.4\n    \n        \n            \n                generate\n            \n            \n                ${project.basedir}/src/main/resources/api.yaml\n                java\n                \n                   src/gen/java/main\n                \n            \n        \n    \n\n")),Object(o.b)("p",null,"Followed by:"),Object(o.b)("pre",null,Object(o.b)("code",Object(a.a)({parentName:"pre"},{className:"language-bash"}),"mvn clean compile\n")),Object(o.b)("p",null,"For full details of all options, see the ",Object(o.b)("a",Object(a.a)({parentName:"p"},{href:"https://github.com/OpenAPITools/openapi-generator/tree/master/modules/openapi-generator-maven-plugin"}),"plugin README"),"."),Object(o.b)("h2",{id:"gradle"},"Gradle"),Object(o.b)("p",null,"This gradle plugin offers a declarative DSL via extensions (these are Gradle project extensions). These map almost fully 1:1 with the options you\u2019d pass to the CLI or Maven plugin. The plugin maps the extensions to a task of the same name to provide a clean API. If you\u2019re interested in the extension/task mapping concept from a high-level, you can check out ",Object(o.b)("a",Object(a.a)({parentName:"p"},{href:"https://docs.gradle.org/current/userguide/custom_plugins.html#sec:mapping_extension_properties_to_task_properties"}),"Gradle\u2019s docs"),"."),Object(o.b)("p",null,"To include in your project, add the following to ",Object(o.b)("inlineCode",{parentName:"p"},"build.gradle"),":"),Object(o.b)("pre",null,Object(o.b)("code",Object(a.a)({parentName:"pre"},{className:"language-groovy"}),'buildscript {\n  repositories {\n    mavenLocal()\n    maven { url "https://repo1.maven.org/maven2" }\n  }\n  dependencies {\n    classpath "org.openapitools:openapi-generator-gradle-plugin:3.3.4"\n  }\n}\n\napply plugin: \'org.openapi.generator\'\n')),Object(o.b)("p",null,"This gives access to the following tasks:"),Object(o.b)("table",null,Object(o.b)("thead",{parentName:"table"},Object(o.b)("tr",{parentName:"thead"},Object(o.b)("th",Object(a.a)({parentName:"tr"},{align:null}),"Task"),Object(o.b)("th",Object(a.a)({parentName:"tr"},{align:null}),"Description"))),Object(o.b)("tbody",{parentName:"table"},Object(o.b)("tr",{parentName:"tbody"},Object(o.b)("td",Object(a.a)({parentName:"tr"},{align:null}),"openApiGenerate"),Object(o.b)("td",Object(a.a)({parentName:"tr"},{align:null}),"Generate code via Open API Tools Generator for Open API 2.0 or 3.x specification documents.")),Object(o.b)("tr",{parentName:"tbody"},Object(o.b)("td",Object(a.a)({parentName:"tr"},{align:null}),"openApiGenerators"),Object(o.b)("td",Object(a.a)({parentName:"tr"},{align:null}),"Lists generators available via Open API Generators.")),Object(o.b)("tr",{parentName:"tbody"},Object(o.b)("td",Object(a.a)({parentName:"tr"},{align:null}),"openApiMeta"),Object(o.b)("td",Object(a.a)({parentName:"tr"},{align:null}),"Generates a new generator to be consumed via Open API Generator.")),Object(o.b)("tr",{parentName:"tbody"},Object(o.b)("td",Object(a.a)({parentName:"tr"},{align:null}),"openApiValidate"),Object(o.b)("td",Object(a.a)({parentName:"tr"},{align:null}),"Validates an Open API 2.0 or 3.x specification document.")))),Object(o.b)("blockquote",null,Object(o.b)("p",{parentName:"blockquote"},"The plugin implements the above tasks as project extensions of the same name. If you\u2019d like to declare these tasks as dependencies to other tasks (using ",Object(o.b)("inlineCode",{parentName:"p"},"dependsOn"),"), you\u2019ll need a task reference. e.g.:"),Object(o.b)("pre",{parentName:"blockquote"},Object(o.b)("code",Object(a.a)({parentName:"pre"},{className:"language-groovy"}),"compileJava.dependsOn tasks.openApiGenerate\n"))),Object(o.b)("p",null,"For full details of all options, see the ",Object(o.b)("a",Object(a.a)({parentName:"p"},{href:"https://github.com/OpenAPITools/openapi-generator/tree/master/modules/openapi-generator-gradle-plugin"}),"plugin README"),"."),Object(o.b)("h3",{id:"example-1"},"Example"),Object(o.b)("p",null,"An example task for generating a kotlin client:"),Object(o.b)("pre",null,Object(o.b)("code",Object(a.a)({parentName:"pre"},{className:"language-groovy"}),'openApiGenerate {\n    generatorName = "kotlin"\n    inputSpec = "$rootDir/specs/petstore-v3.0.yaml".toString()\n    outputDir = "$buildDir/generated".toString()\n    apiPackage = "org.openapi.example.api"\n    invokerPackage = "org.openapi.example.invoker"\n    modelPackage = "org.openapi.example.model"\n    modelFilesConstrainedTo = [\n            "Error"\n    ]\n    configOptions = [\n        dateLibrary: "java8"\n    ]\n}\n')))}s.isMDXComponent=!0},293:function(e,t,n){"use strict";n.d(t,"a",(function(){return b})),n.d(t,"b",(function(){return m}));var a=n(0),r=n.n(a);function o(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function l(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}function p(e){for(var t=1;t=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(a=0;a=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var c=r.a.createContext({}),s=function(e){var t=r.a.useContext(c),n=t;return e&&(n="function"==typeof e?e(t):p({},t,{},e)),n},b=function(e){var t=s(e.components);return r.a.createElement(c.Provider,{value:t},e.children)},u={inlineCode:"code",wrapper:function(e){var t=e.children;return r.a.createElement(r.a.Fragment,{},t)}},d=Object(a.forwardRef)((function(e,t){var n=e.components,a=e.mdxType,o=e.originalType,l=e.parentName,c=i(e,["components","mdxType","originalType","parentName"]),b=s(n),d=a,m=b["".concat(l,".").concat(d)]||b[d]||u[d]||o;return n?r.a.createElement(m,p({ref:t},c,{components:n})):r.a.createElement(m,p({ref:t},c))}));function m(e,t){var n=arguments,a=t&&t.mdxType;if("string"==typeof e||a){var o=n.length,l=new Array(o);l[0]=d;var p={};for(var i in t)hasOwnProperty.call(t,i)&&(p[i]=t[i]);p.originalType=e,p.mdxType="string"==typeof e?e:a,l[1]=p;for(var c=2;c"),", e.g. open a shell in ",Object(o.b)("inlineCode",{parentName:"li"},"samples/client/petstore/python"),", run ",Object(o.b)("inlineCode",{parentName:"li"},"mvn integration-test -rf :PythonPetstoreClientTests"),". The artifactId of the project can be found in the pom.xml file. (some languages may not contain unit testing for Petstore and we're looking for contribution from the community to implement those tests)"),Object(o.b)("li",{parentName:"ul"},"Finally, git commit the updated samples files: ",Object(o.b)("inlineCode",{parentName:"li"},"git commit -a"),"\n(",Object(o.b)("inlineCode",{parentName:"li"},"git add -A")," if added files with new test cases)"),Object(o.b)("li",{parentName:"ul"},"For new test cases, please add to the ",Object(o.b)("a",Object(n.a)({parentName:"li"},{href:"https://github.com/OpenAPITools/openapi-generator/blob/master/modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml"}),"Fake Petstore spec"))),Object(o.b)("p",null,"To start the CI tests, you can run ",Object(o.b)("inlineCode",{parentName:"p"},"mvn verify -Psamples")," (assuming you've all the required tools installed to run tests for different languages) or you can leverage ",Object(o.b)("a",Object(n.a)({parentName:"p"},{href:"http://travis-ci.org"}),"http://travis-ci.org")," to run the CI tests by adding your own openapi-generator repository."),Object(o.b)("h3",{id:"tips"},"Tips"),Object(o.b)("ul",null,Object(o.b)("li",{parentName:"ul"},"Smaller changes are easier to review"),Object(o.b)("li",{parentName:"ul"},"[Optional]"," For bug fixes, provide a OpenAPI Spec to repeat the issue so that the reviewer can use it to confirm the fix"),Object(o.b)("li",{parentName:"ul"},"Add test case(s) to cover the change"),Object(o.b)("li",{parentName:"ul"},"Document the fix in the code to make the code more readable"),Object(o.b)("li",{parentName:"ul"},"Make sure test cases passed after the change (one way is to leverage ",Object(o.b)("a",Object(n.a)({parentName:"li"},{href:"https://travis-ci.org/"}),"https://travis-ci.org/")," to run the CI tests)"),Object(o.b)("li",{parentName:"ul"},"File a PR with meaningful title, description and commit messages."),Object(o.b)("li",{parentName:"ul"},"Recommended git settings",Object(o.b)("ul",{parentName:"li"},Object(o.b)("li",{parentName:"ul"},Object(o.b)("inlineCode",{parentName:"li"},"git config core.autocrlf input")," to tell Git convert CRLF to LF on commit but not the other way around "))),Object(o.b)("li",{parentName:"ul"},'To close an issue (e.g. issue 1542) automatically after a PR is merged, use keywords "fix", "close", "resolve" in the PR description, e.g. ',Object(o.b)("inlineCode",{parentName:"li"},"fix #1542"),". (Ref: ",Object(o.b)("a",Object(n.a)({parentName:"li"},{href:"https://help.github.com/articles/closing-issues-using-keywords/"}),"closing issues using keywords"),")")))}c.isMDXComponent=!0},293:function(e,t,a){"use strict";a.d(t,"a",(function(){return p})),a.d(t,"b",(function(){return h}));var n=a(0),i=a.n(n);function o(e,t,a){return t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}function r(e,t){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),a.push.apply(a,n)}return a}function s(e){for(var t=1;t=0||(i[a]=e[a]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,a)&&(i[a]=e[a])}return i}var b=i.a.createContext({}),c=function(e){var t=i.a.useContext(b),a=t;return e&&(a="function"==typeof e?e(t):s({},t,{},e)),a},p=function(e){var t=c(e.components);return i.a.createElement(b.Provider,{value:t},e.children)},u={inlineCode:"code",wrapper:function(e){var t=e.children;return i.a.createElement(i.a.Fragment,{},t)}},m=Object(n.forwardRef)((function(e,t){var a=e.components,n=e.mdxType,o=e.originalType,r=e.parentName,b=l(e,["components","mdxType","originalType","parentName"]),p=c(a),m=n,h=p["".concat(r,".").concat(m)]||p[m]||u[m]||o;return a?i.a.createElement(h,s({ref:t},b,{components:a})):i.a.createElement(h,s({ref:t},b))}));function h(e,t){var a=arguments,n=t&&t.mdxType;if("string"==typeof e||n){var o=a.length,r=new Array(o);r[0]=m;var s={};for(var l in t)hasOwnProperty.call(t,l)&&(s[l]=t[l]);s.originalType=e,s.mdxType="string"==typeof e?e:n,r[1]=s;for(var b=2;b"),", e.g. open a shell in ",Object(o.b)("inlineCode",{parentName:"li"},"samples/client/petstore/python"),", run ",Object(o.b)("inlineCode",{parentName:"li"},"mvn integration-test -rf :PythonPetstoreClientTests"),". The artifactId of the project can be found in the pom.xml file. (some languages may not contain unit testing for Petstore and we're looking for contribution from the community to implement those tests)"),Object(o.b)("li",{parentName:"ul"},"Finally, git commit the updated samples files: ",Object(o.b)("inlineCode",{parentName:"li"},"git commit -a"),"\n(",Object(o.b)("inlineCode",{parentName:"li"},"git add -A")," if added files with new test cases)"),Object(o.b)("li",{parentName:"ul"},"For new test cases, please add to the ",Object(o.b)("a",Object(n.a)({parentName:"li"},{href:"https://github.com/OpenAPITools/openapi-generator/blob/master/modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml"}),"Fake Petstore spec"))),Object(o.b)("p",null,"To start the CI tests, you can run ",Object(o.b)("inlineCode",{parentName:"p"},"mvn verify -Psamples")," (assuming you've all the required tools installed to run tests for different languages) or you can leverage ",Object(o.b)("a",Object(n.a)({parentName:"p"},{href:"http://travis-ci.org"}),"http://travis-ci.org")," to run the CI tests by adding your own openapi-generator repository."),Object(o.b)("h3",{id:"tips"},"Tips"),Object(o.b)("ul",null,Object(o.b)("li",{parentName:"ul"},"Smaller changes are easier to review"),Object(o.b)("li",{parentName:"ul"},"[Optional]"," For bug fixes, provide a OpenAPI Spec to repeat the issue so that the reviewer can use it to confirm the fix"),Object(o.b)("li",{parentName:"ul"},"Add test case(s) to cover the change"),Object(o.b)("li",{parentName:"ul"},"Document the fix in the code to make the code more readable"),Object(o.b)("li",{parentName:"ul"},"Make sure test cases passed after the change (one way is to leverage ",Object(o.b)("a",Object(n.a)({parentName:"li"},{href:"https://travis-ci.org/"}),"https://travis-ci.org/")," to run the CI tests)"),Object(o.b)("li",{parentName:"ul"},"File a PR with meaningful title, description and commit messages."),Object(o.b)("li",{parentName:"ul"},"Recommended git settings",Object(o.b)("ul",{parentName:"li"},Object(o.b)("li",{parentName:"ul"},Object(o.b)("inlineCode",{parentName:"li"},"git config core.autocrlf input")," to tell Git convert CRLF to LF on commit but not the other way around "))),Object(o.b)("li",{parentName:"ul"},'To close an issue (e.g. issue 1542) automatically after a PR is merged, use keywords "fix", "close", "resolve" in the PR description, e.g. ',Object(o.b)("inlineCode",{parentName:"li"},"fix #1542"),". (Ref: ",Object(o.b)("a",Object(n.a)({parentName:"li"},{href:"https://help.github.com/articles/closing-issues-using-keywords/"}),"closing issues using keywords"),")")))}c.isMDXComponent=!0},293:function(e,t,a){"use strict";a.d(t,"a",(function(){return p})),a.d(t,"b",(function(){return h}));var n=a(0),i=a.n(n);function o(e,t,a){return t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}function r(e,t){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),a.push.apply(a,n)}return a}function s(e){for(var t=1;t=0||(i[a]=e[a]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,a)&&(i[a]=e[a])}return i}var b=i.a.createContext({}),c=function(e){var t=i.a.useContext(b),a=t;return e&&(a="function"==typeof e?e(t):s({},t,{},e)),a},p=function(e){var t=c(e.components);return i.a.createElement(b.Provider,{value:t},e.children)},u={inlineCode:"code",wrapper:function(e){var t=e.children;return i.a.createElement(i.a.Fragment,{},t)}},m=Object(n.forwardRef)((function(e,t){var a=e.components,n=e.mdxType,o=e.originalType,r=e.parentName,b=l(e,["components","mdxType","originalType","parentName"]),p=c(a),m=n,h=p["".concat(r,".").concat(m)]||p[m]||u[m]||o;return a?i.a.createElement(h,s({ref:t},b,{components:a})):i.a.createElement(h,s({ref:t},b))}));function h(e,t){var a=arguments,n=t&&t.mdxType;if("string"==typeof e||n){var o=a.length,r=new Array(o);r[0]=m;var s={};for(var l in t)hasOwnProperty.call(t,l)&&(s[l]=t[l]);s.originalType=e,s.mdxType="string"==typeof e?e:n,r[1]=s;for(var b=2;b=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}var s=i.a.createContext({}),p=function(e){var t=i.a.useContext(s),n=t;return e&&(n="function"==typeof e?e(t):c({},t,{},e)),n},u=function(e){var t=p(e.components);return i.a.createElement(s.Provider,{value:t},e.children)},d={inlineCode:"code",wrapper:function(e){var t=e.children;return i.a.createElement(i.a.Fragment,{},t)}},b=Object(r.forwardRef)((function(e,t){var n=e.components,r=e.mdxType,o=e.originalType,a=e.parentName,s=l(e,["components","mdxType","originalType","parentName"]),u=p(n),b=r,m=u["".concat(a,".").concat(b)]||u[b]||d[b]||o;return n?i.a.createElement(m,c({ref:t},s,{components:n})):i.a.createElement(m,c({ref:t},s))}));function m(e,t){var n=arguments,r=t&&t.mdxType;if("string"==typeof e||r){var o=n.length,a=new Array(o);a[0]=b;var c={};for(var l in t)hasOwnProperty.call(t,l)&&(c[l]=t[l]);c.originalType=e,c.mdxType="string"==typeof e?e:r,a[1]=c;for(var s=2;s=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}var s=i.a.createContext({}),p=function(e){var t=i.a.useContext(s),n=t;return e&&(n="function"==typeof e?e(t):c({},t,{},e)),n},u=function(e){var t=p(e.components);return i.a.createElement(s.Provider,{value:t},e.children)},d={inlineCode:"code",wrapper:function(e){var t=e.children;return i.a.createElement(i.a.Fragment,{},t)}},b=Object(r.forwardRef)((function(e,t){var n=e.components,r=e.mdxType,o=e.originalType,a=e.parentName,s=l(e,["components","mdxType","originalType","parentName"]),u=p(n),b=r,m=u["".concat(a,".").concat(b)]||u[b]||d[b]||o;return n?i.a.createElement(m,c({ref:t},s,{components:n})):i.a.createElement(m,c({ref:t},s))}));function m(e,t){var n=arguments,r=t&&t.mdxType;if("string"==typeof e||r){var o=n.length,a=new Array(o);a[0]=b;var c={};for(var l in t)hasOwnProperty.call(t,l)&&(c[l]=t[l]);c.originalType=e,c.mdxType="string"==typeof e?e:r,a[1]=c;for(var s=2;s
     
    -
    +
     
     
     
    diff --git a/runtime~main.7b72ee12.js b/runtime~main.5cdf8e0c.js
    similarity index 91%
    rename from runtime~main.7b72ee12.js
    rename to runtime~main.5cdf8e0c.js
    index 17be2d4008f..14436be30b0 100644
    --- a/runtime~main.7b72ee12.js
    +++ b/runtime~main.5cdf8e0c.js
    @@ -1 +1 @@
    -!function(e){function f(f){for(var c,r,t=f[0],n=f[1],o=f[2],u=0,l=[];u
     
    -
    +
     
     
     
    diff --git a/users.html b/users.html
    index 4c17543c110..3402bdb271d 100644
    --- a/users.html
    +++ b/users.html
    @@ -28,7 +28,7 @@
     
     
     
    -
    +
     
     
     
    diff --git a/users/index.html b/users/index.html
    index f8e9111bae6..260a5cf992a 100644
    --- a/users/index.html
    +++ b/users/index.html
    @@ -32,7 +32,7 @@
     
     
     
    -
    +