1.0.3 • Published 8 months ago
woog v1.0.3
woog
- 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
Install
npm i -g @openapitools/openapi-generator-cli woog
Usage
woog <generatorDirName> [inputFileName=openapi] [outputDirName=out]
example:
woog openapi
woog html2 openapi.json out.html2
Config
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
, 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
Note
- use
openapi-generator-cli version-manager
to switch openapi-generator-cli version - use
openapi-generator-cli list
to get available generator names - use
openapi-generator-cli config-help -g <generatorName>
to get generator config schema
License
MIT © rainmanhhh