- simple wrapper of @openapitools/openapi-generator-cli, with some default configurations.
- woog means Wrapper Of Openapi Generator
- if use generator
openapi
oropenapi-yaml
, paths and schemas in input file will be sorted
npm i -g @openapitools/openapi-generator-cli woog
woog <generatorDirName> [inputFileName=openapi] [outputDirName=out]
example:
woog openapi
woog html2 openapi.json out.html2
if config file exists(<generatorDir>/config.yaml
or <generatorDir>/config.yml
or <generatorDir>/config.json
)
generator will use it
you can put optional extra parameters in the config file:
-
x-generator
if the
generatorDir
is not the same as generator name, you can set generator name with this parameter. eg: thegeneratorDir
isjava-spring-code
and the generator name isspring
-
x-template
if you want to use custom templates, set your template root dir to env
OPENAPI_TEMPLATE_ROOT
(eg.D:\workspace\github\openapi-generator\modules\openapi-generator\src\main\resources
), and add parameterx-template
to config file.true
means useOPENAPI_TEMPLATE_ROOT
/generatorName
as template dir- string value means use
OPENAPI_TEMPLATE_ROOT
/<x-template value>
as template dir - some generators have special template dir name(different from generator name).
these generators' template dir will be auto mapped if
x-template
have been set totrue
. for example:html2
->htmlDocs2
spring
->JavaSpring
jaxrs-cxf
->JavaJaxRS
jaxrs-cxf-cdi
->JavaJaxRS
- use
openapi-generator-cli version-manager list
to switch openapi-generator-cli version(if download too slow, you can manually copy org.openapitools:openapi-generator-cli:.jar to<npm prefix dir>/node_modules/@openapitools/openapi-generator-cli/versions/
, remember to rename it as format<version>.jar
, like6.0.0.jar
) - use
openapi-generator-cli list
to get available generator names - use
openapi-generator-cli config-help -g <generatorName>
to get generator config schema
MIT © rainmanhhh