openapi-generator-original/assets/js/df7ab5c6.b5f09130.js

1 line
6.1 KiB
JavaScript

"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[1576],{3905:function(e,t,n){n.d(t,{Zo:function(){return u},kt:function(){return m}});var r=n(7294);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 a(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?i(Object(n),!0).forEach((function(t){o(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):i(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,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}var d=r.createContext({}),c=function(e){var t=r.useContext(d),n=t;return e&&(n="function"==typeof e?e(t):a(a({},t),e)),n},u=function(e){var t=c(e.components);return r.createElement(d.Provider,{value:t},e.children)},s="mdxType",p={inlineCode:"code",wrapper:function(e){var t=e.children;return r.createElement(r.Fragment,{},t)}},f=r.forwardRef((function(e,t){var n=e.components,o=e.mdxType,i=e.originalType,d=e.parentName,u=l(e,["components","mdxType","originalType","parentName"]),s=c(n),f=o,m=s["".concat(d,".").concat(f)]||s[f]||p[f]||i;return n?r.createElement(m,a(a({ref:t},u),{},{components:n})):r.createElement(m,a({ref:t},u))}));function m(e,t){var n=arguments,o=t&&t.mdxType;if("string"==typeof e||o){var i=n.length,a=new Array(i);a[0]=f;var l={};for(var d in t)hasOwnProperty.call(t,d)&&(l[d]=t[d]);l.originalType=e,l[s]="string"==typeof e?e:o,a[1]=l;for(var c=2;c<i;c++)a[c]=n[c];return r.createElement.apply(null,a)}return r.createElement.apply(null,n)}f.displayName="MDXCreateElement"},3619:function(e,t,n){n.r(t),n.d(t,{assets:function(){return u},contentTitle:function(){return d},default:function(){return f},frontMatter:function(){return l},metadata:function(){return c},toc:function(){return s}});var r=n(7462),o=n(3366),i=(n(7294),n(3905)),a=["components"],l={id:"faq-extending",title:"FAQ: Extending"},d=void 0,c={unversionedId:"faq-extending",id:"faq-extending",title:"FAQ: Extending",description:"How do I use my own Java models?",source:"@site/../docs/faq-extending.md",sourceDirName:".",slug:"/faq-extending",permalink:"/docs/faq-extending",draft:!1,editUrl:"https://github.com/OpenAPITools/openapi-generator/edit/master/website/../docs/faq-extending.md",tags:[],version:"current",lastUpdatedBy:"Jim Schubert",lastUpdatedAt:1581427378,formattedLastUpdatedAt:"Feb 11, 2020",frontMatter:{id:"faq-extending",title:"FAQ: Extending"},sidebar:"faq-sidebar",previous:{title:"FAQ: General",permalink:"/docs/faq"},next:{title:"FAQ: Contributing",permalink:"/docs/faq-contributing"}},u={},s=[{value:"How do I use my own Java models?",id:"how-do-i-use-my-own-java-models",level:2},{value:"How do I disable certificate verification?",id:"how-do-i-disable-certificate-verification",level:2},{value:"How do I skip files during code generation?",id:"how-do-i-skip-files-during-code-generation",level:2},{value:"How can I customize the auto-generated code?",id:"how-can-i-customize-the-auto-generated-code",level:2}],p={toc:s};function f(e){var t=e.components,n=(0,o.Z)(e,a);return(0,i.kt)("wrapper",(0,r.Z)({},p,n,{components:t,mdxType:"MDXLayout"}),(0,i.kt)("h2",{id:"how-do-i-use-my-own-java-models"},"How do I use my own Java models?"),(0,i.kt)("p",null,"See ",(0,i.kt)("a",{parentName:"p",href:"/docs/customization#bringing-your-own-models"},"Bringing your own Models"),"."),(0,i.kt)("h2",{id:"how-do-i-disable-certificate-verification"},"How do I disable certificate verification?"),(0,i.kt)("p",null,"Please add ",(0,i.kt)("inlineCode",{parentName:"p"},"-Dio.swagger.v3.parser.util.RemoteUrl.trustAll=true")," when generating the code."),(0,i.kt)("h2",{id:"how-do-i-skip-files-during-code-generation"},"How do I skip files during code generation?"),(0,i.kt)("p",null,"OpenAPI Generator has a built-in ignore file processor."),(0,i.kt)("p",null,"For example, to skip ",(0,i.kt)("inlineCode",{parentName:"p"},"git_push.sh"),", one can create a file named ",(0,i.kt)("inlineCode",{parentName:"p"},".openapi-generator-ignore")," in the root of the output directory with the contents:"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre"},"# Prevent generator from creating these files:\ngit_push.sh\n")),(0,i.kt)("p",null,"The ignore file works just like .gitignore, and it is auto-generated by default."),(0,i.kt)("p",null,"If you need this functionality on initial generation, you can provide the option ",(0,i.kt)("inlineCode",{parentName:"p"},"--ignore-file-override")," (CLI) or ",(0,i.kt)("inlineCode",{parentName:"p"},"ignoreFileOverride")," (Maven and Gradle plugins) with a value targeting any existing file. The contents of that file will be evaluated relative to the output directory."),(0,i.kt)("h2",{id:"how-can-i-customize-the-auto-generated-code"},"How can I customize the auto-generated code?"),(0,i.kt)("p",null,"Variants:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},'"How can I add a header/footer to generated code?"'),(0,i.kt)("li",{parentName:"ul"},'"How can I add my own logging to generated code?"'),(0,i.kt)("li",{parentName:"ul"},'"How can I add my license to the top of files?"')),(0,i.kt)("p",null,"OpenAPI Generator supports user-defined templates without need to recompile the artifact. We also support custom generators (templates and logic) if those generators are accessible on the classpath."),(0,i.kt)("p",null,"See ",(0,i.kt)("a",{parentName:"p",href:"/docs/templating#modifying-templates"},"templating: Modifying Templates")," and ",(0,i.kt)("a",{parentName:"p",href:"/docs/customization"},"customization")," docs for more details."))}f.isMDXComponent=!0}}]);