mirror of
https://github.com/OpenAPITools/openapi-generator.git
synced 2025-07-03 14:10:56 +00:00
1 line
7.5 KiB
JavaScript
1 line
7.5 KiB
JavaScript
"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[3601],{3905:function(e,t,n){n.d(t,{Zo:function(){return u},kt:function(){return f}});var r=n(7294);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 o(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 i(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?o(Object(n),!0).forEach((function(t){a(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):o(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function l(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var p=r.createContext({}),s=function(e){var t=r.useContext(p),n=t;return e&&(n="function"==typeof e?e(t):i(i({},t),e)),n},u=function(e){var t=s(e.components);return r.createElement(p.Provider,{value:t},e.children)},g="mdxType",c={inlineCode:"code",wrapper:function(e){var t=e.children;return r.createElement(r.Fragment,{},t)}},d=r.forwardRef((function(e,t){var n=e.components,a=e.mdxType,o=e.originalType,p=e.parentName,u=l(e,["components","mdxType","originalType","parentName"]),g=s(n),d=a,f=g["".concat(p,".").concat(d)]||g[d]||c[d]||o;return n?r.createElement(f,i(i({ref:t},u),{},{components:n})):r.createElement(f,i({ref:t},u))}));function f(e,t){var n=arguments,a=t&&t.mdxType;if("string"==typeof e||a){var o=n.length,i=new Array(o);i[0]=d;var l={};for(var p in t)hasOwnProperty.call(t,p)&&(l[p]=t[p]);l.originalType=e,l[g]="string"==typeof e?e:a,i[1]=l;for(var s=2;s<o;s++)i[s]=n[s];return r.createElement.apply(null,i)}return r.createElement.apply(null,n)}d.displayName="MDXCreateElement"},2399:function(e,t,n){n.r(t),n.d(t,{assets:function(){return u},contentTitle:function(){return p},default:function(){return d},frontMatter:function(){return l},metadata:function(){return s},toc:function(){return g}});var r=n(7462),a=n(3366),o=(n(7294),n(3905)),i=["components"],l={id:"integrations",title:"Workflow Integrations"},p=void 0,s={unversionedId:"integrations",id:"integrations",title:"Workflow Integrations",description:"Workflow Integration (Gradle, Maven, GitHub, CI/CD)",source:"@site/../docs/integration.md",sourceDirName:".",slug:"/integrations",permalink:"/docs/integrations",draft:!1,editUrl:"https://github.com/OpenAPITools/openapi-generator/edit/master/website/../docs/integration.md",tags:[],version:"current",lastUpdatedBy:"William Cheng",lastUpdatedAt:1711006612,formattedLastUpdatedAt:"Mar 21, 2024",frontMatter:{id:"integrations",title:"Workflow Integrations"},sidebar:"docs",previous:{title:"Debugging",permalink:"/docs/debugging"},next:{title:"Guidelines",permalink:"/docs/contributing"}},u={},g=[{value:"Workflow Integration (Gradle, Maven, GitHub, CI/CD)",id:"workflow-integration-gradle-maven-github-cicd",level:2},{value:"Gradle Integration",id:"gradle-integration",level:3},{value:"Maven Integration",id:"maven-integration",level:3},{value:"sbt Integration",id:"sbt-integration",level:3},{value:"Bazel Integration",id:"bazel-integration",level:3},{value:"Cake Addin",id:"cake-addin",level:3},{value:"GitHub Integration",id:"github-integration",level:3},{value:"CI/CD",id:"cicd",level:3}],c={toc:g};function d(e){var t=e.components,n=(0,a.Z)(e,i);return(0,o.kt)("wrapper",(0,r.Z)({},c,n,{components:t,mdxType:"MDXLayout"}),(0,o.kt)("h2",{id:"workflow-integration-gradle-maven-github-cicd"},"Workflow Integration (Gradle, Maven, GitHub, CI/CD)"),(0,o.kt)("h3",{id:"gradle-integration"},"Gradle Integration"),(0,o.kt)("p",null,"See the ",(0,o.kt)("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."),(0,o.kt)("p",null,"Supported tasks include:"),(0,o.kt)("ul",null,(0,o.kt)("li",{parentName:"ul"},"Listing generators"),(0,o.kt)("li",{parentName:"ul"},"Validation of Open API 2.0 and 3.0 Specs"),(0,o.kt)("li",{parentName:"ul"},'Generating "Meta" generators'),(0,o.kt)("li",{parentName:"ul"},"Generating all generators supported by OpenAPI Generator")),(0,o.kt)("h3",{id:"maven-integration"},"Maven Integration"),(0,o.kt)("p",null,"See the ",(0,o.kt)("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."),(0,o.kt)("h3",{id:"sbt-integration"},"sbt Integration"),(0,o.kt)("p",null,"Please refer to ",(0,o.kt)("a",{parentName:"p",href:"https://github.com/OpenAPITools/sbt-openapi-generator"},"https://github.com/OpenAPITools/sbt-openapi-generator")),(0,o.kt)("h3",{id:"bazel-integration"},"Bazel Integration"),(0,o.kt)("p",null,"Please refer to ",(0,o.kt)("a",{parentName:"p",href:"https://github.com/OpenAPITools/openapi-generator-bazel"},"https://github.com/OpenAPITools/openapi-generator-bazel")),(0,o.kt)("h3",{id:"cake-addin"},"Cake Addin"),(0,o.kt)("p",null,"3rd-party Cake Addin provided by ",(0,o.kt)("a",{parentName:"p",href:"https://github.com/lukoerfer"},"Lukas K\xf6rfer"),": ",(0,o.kt)("a",{parentName:"p",href:"https://github.com/lukoerfer/cake-openapi-generator"},"https://github.com/lukoerfer/cake-openapi-generator")),(0,o.kt)("h3",{id:"github-integration"},"GitHub Integration"),(0,o.kt)("p",null,"To push the auto-generated SDK to GitHub, we provide ",(0,o.kt)("inlineCode",{parentName:"p"},"git_push.sh")," to streamline the process. For example:"),(0,o.kt)("p",null," 1) Create a new repository in GitHub (Ref: ",(0,o.kt)("a",{parentName:"p",href:"https://help.github.com/articles/creating-a-new-repository/"},"https://help.github.com/articles/creating-a-new-repository/"),")"),(0,o.kt)("p",null," 2) Generate the SDK"),(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-sh"},' java -jar openapi-generator-cli.jar generate \\\n -i modules/openapi-generator/src/test/resources/3_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')),(0,o.kt)("p",null," 3) Push the SDK to GitHub"),(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-sh"},"cd /var/tmp/perl/petstore\n/bin/sh ./git_push.sh\n")),(0,o.kt)("p",null,"To use openapi-generator as part of Github workflows, the blog post ",(0,o.kt)("a",{parentName:"p",href:"https://www.propelauth.com/post/autogenerating-clients-with-fastapi-and-github-actions"},'"Autogenerating Clients with FastAPI and Github Actions"')," by Andrew Israel is a good starting point."),(0,o.kt)("h3",{id:"cicd"},"CI/CD"),(0,o.kt)("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)"),(0,o.kt)("p",null,"If you're looking for the configuration files of a particular CI that is not yet supported, please open an ",(0,o.kt)("a",{parentName:"p",href:"https://github.com/openapitools/openapi-generator/issues/new"},"issue")," to let us know."))}d.isMDXComponent=!0}}]); |