"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[3491],{3905:function(e,t,n){n.d(t,{Zo:function(){return u},kt:function(){return g}});var a=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 a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}function r(e){for(var t=1;t=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}var l=a.createContext({}),s=function(e){var t=a.useContext(l),n=t;return e&&(n="function"==typeof e?e(t):r(r({},t),e)),n},u=function(e){var t=s(e.components);return a.createElement(l.Provider,{value:t},e.children)},c="mdxType",d={inlineCode:"code",wrapper:function(e){var t=e.children;return a.createElement(a.Fragment,{},t)}},m=a.forwardRef((function(e,t){var n=e.components,o=e.mdxType,i=e.originalType,l=e.parentName,u=p(e,["components","mdxType","originalType","parentName"]),c=s(n),m=o,g=c["".concat(l,".").concat(m)]||c[m]||d[m]||i;return n?a.createElement(g,r(r({ref:t},u),{},{components:n})):a.createElement(g,r({ref:t},u))}));function g(e,t){var n=arguments,o=t&&t.mdxType;if("string"==typeof e||o){var i=n.length,r=new Array(i);r[0]=m;var p={};for(var l in t)hasOwnProperty.call(t,l)&&(p[l]=t[l]);p.originalType=e,p[c]="string"==typeof e?e:o,r[1]=p;for(var s=2;s")," and ",(0,i.kt)("inlineCode",{parentName:"p"},"")," are treated the same as if the ",(0,i.kt)("inlineCode",{parentName:"p"},"apis"),' node was undefined; there\'s no way to provide an empty string as a default. Instead, we have to extract the global property into its own properties which maintain the two states supported elsewhere (i.e. "all apis" or "select apis"). We have ',(0,i.kt)("inlineCode",{parentName:"p"},"generateApis")," which accepts a boolean and ",(0,i.kt)("inlineCode",{parentName:"p"},"apisToGenerate")," which accepts a comma-separated selection list."),(0,i.kt)("h2",{id:"discovering-options"},"Discovering Options"),(0,i.kt)("p",null,"Refer to ",(0,i.kt)("a",{parentName:"p",href:"/docs/globals"},"global properties")," for a list of available global properties and their usage."),(0,i.kt)("p",null,"Top-level tooling options are defined in ",(0,i.kt)("a",{parentName:"p",href:"https://openapi-generator.tech/docs/usage/#generate"},"CLI usage"),". Many of these options directly map to camel case options in other tools, but do refer to ",(0,i.kt)("a",{parentName:"p",href:"https://openapi-generator.tech/docs/plugins"},"plugin documentation")," for full details or plugin-specific differences."),(0,i.kt)("p",null,"Config options for generators are available in ",(0,i.kt)("a",{parentName:"p",href:"https://openapi-generator.tech/docs/generators"},"documentation online"),". You may also use the CLI to query config options for a target generator using ",(0,i.kt)("inlineCode",{parentName:"p"},"openapi-generator config-help -g "),". For example:"),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre"},"$ openapi-generator config-help -g mysql-schema\n\nCONFIG OPTIONS\n\n defaultDatabaseName\n Default database name for all MySQL queries (Default: )\n\n identifierNamingConvention\n Naming convention of MySQL identifiers(table names and column names). This is not related to database name which is defined by defaultDatabaseName option (Default: original)\n original - Do not transform original names\n snake_case - Use snake_case names\n\n jsonDataTypeEnabled\n Use special JSON MySQL data type for complex model properties. Requires MySQL version 5.7.8. Generates TEXT data type when disabled (Default: true)\n\n namedParametersEnabled\n Generates model prepared SQLs with named parameters, eg. :petName. Question mark placeholder used when option disabled. (Default: false)\n")),(0,i.kt)("p",null,"This output provides the name of the configuration option. A set of acceptable values for any constrained values will print as an indented list (e.g. ",(0,i.kt)("inlineCode",{parentName:"p"},"identifierNamingConvention")," above)."),(0,i.kt)("p",null,"Suppose you want to apply snake case naming to mysql schema outputs. Your configuration might resemble the following examples."),(0,i.kt)("p",null,(0,i.kt)("strong",{parentName:"p"},"CLI")),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre"},"openapi-generator -g mysql-schema -o out -i spec.yaml --additional-properties=identifierNamingConvention=snake_case,useSingleRequestParameter=true,withInterfaces=true\n")),(0,i.kt)("p",null,"It may seem like a typo but there are two ",(0,i.kt)("inlineCode",{parentName:"p"},"=")," signs in the above example."),(0,i.kt)("p",null,(0,i.kt)("strong",{parentName:"p"},"Maven Plugin")),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre"},"\n mysql-schema\n generate-sources\n \n generate\n \n \n spec.yaml\n mysql-schema\n \n snake_case\n \n ${project.build.directory}/generated-sources/mysql\n \n\n")),(0,i.kt)("p",null,(0,i.kt)("strong",{parentName:"p"},"Gradle Plugin")),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre"},'openApiGenerate {\n generatorName.set("mysql-schema")\n inputSpec.set("$rootDir/spec.yaml")\n outputDir.set("$buildDir/mysql")\n configOptions.set([\n identifierNamingConvention: "snake_case"\n ])\n}\n')))}m.isMDXComponent=!0}}]);