mirror of
https://github.com/ferdikoomen/openapi-typescript-codegen.git
synced 2025-12-08 20:16:21 +00:00
- Fixed #282
This commit is contained in:
parent
71cd01bb03
commit
d6f8cff6fb
@ -17,6 +17,7 @@
|
||||
"@typescript-eslint/no-explicit-any": 0,
|
||||
"@typescript-eslint/no-inferrable-types": 0,
|
||||
"@typescript-eslint/no-non-null-assertion": 0,
|
||||
"@typescript-eslint/no-var-requires": 0,
|
||||
"@typescript-eslint/ban-ts-ignore": 0,
|
||||
"@typescript-eslint/ban-ts-comment": 0,
|
||||
"@typescript-eslint/explicit-function-return-type": 0,
|
||||
|
||||
26
bin/index.js
26
bin/index.js
@ -8,15 +8,15 @@ const pkg = require('../package.json');
|
||||
|
||||
program
|
||||
.version(pkg.version)
|
||||
.option('--input [value]', 'Path to swagger specification', './spec.json')
|
||||
.option('--output [value]', 'Output directory', './generated')
|
||||
.option('--client [value]', 'HTTP client to generate [fetch, xhr]', 'fetch')
|
||||
.option('--useOptions', 'Use options vs arguments style functions', false)
|
||||
.option('--useUnionTypes', 'Use inclusive union types', false)
|
||||
.option('--exportCore', 'Generate core', true)
|
||||
.option('--exportServices', 'Generate services', true)
|
||||
.option('--exportModels', 'Generate models', true)
|
||||
.option('--exportSchemas', 'Generate schemas', false)
|
||||
.option('-i, --input <value>', 'Path to swagger specification', './spec.json')
|
||||
.option('-o, --output <value>', 'Output directory', './generated')
|
||||
.option('-c, --client <value>', 'HTTP client to generate [fetch, xhr]', 'fetch')
|
||||
.option('--useOptions', 'Use options vs arguments style functions')
|
||||
.option('--useUnionTypes', 'Use inclusive union types')
|
||||
.option('--exportCore <value>', 'Generate core', true)
|
||||
.option('--exportServices <value>', 'Generate services', true)
|
||||
.option('--exportModels <value>', 'Generate models', true)
|
||||
.option('--exportSchemas <value>', 'Generate schemas', false)
|
||||
.parse(process.argv);
|
||||
|
||||
const OpenAPI = require(path.resolve(__dirname, '../dist/index.js'));
|
||||
@ -28,10 +28,10 @@ if (OpenAPI) {
|
||||
httpClient: program.client,
|
||||
useOptions: program.useOptions,
|
||||
useUnionTypes: program.useUnionTypes,
|
||||
exportCore: program.exportCore,
|
||||
exportServices: program.exportServices,
|
||||
exportModels: program.exportModels,
|
||||
exportSchemas: program.exportSchemas,
|
||||
exportCore: JSON.parse(program.exportCore) === true,
|
||||
exportServices: JSON.parse(program.exportServices) === true,
|
||||
exportModels: JSON.parse(program.exportModels) === true,
|
||||
exportSchemas: JSON.parse(program.exportSchemas) === true,
|
||||
})
|
||||
.then(() => {
|
||||
process.exit(0);
|
||||
|
||||
@ -50,10 +50,10 @@
|
||||
"test:update": "jest --updateSnapshot",
|
||||
"test:watch": "jest --watch",
|
||||
"test:coverage": "jest --coverage",
|
||||
"eslint": "eslint \"./src/**/*.ts\"",
|
||||
"eslint:fix": "eslint \"./src/**/*.ts\" --fix",
|
||||
"prettier": "prettier \"./src/**/*.ts\" --check",
|
||||
"prettier:fix": "prettier \"./src/**/*.ts\" --write",
|
||||
"eslint": "eslint \"./src/**/*.ts\" \"./bin/index.js\"",
|
||||
"eslint:fix": "eslint \"./src/**/*.ts\" \"./bin/index.js\" --fix",
|
||||
"prettier": "prettier \"./src/**/*.ts\" \"./bin/index.js\" --check",
|
||||
"prettier:fix": "prettier \"./src/**/*.ts\" \"./bin/index.js\" --write",
|
||||
"codecov": "codecov --token=66c30c23-8954-4892-bef9-fbaed0a2e42b"
|
||||
},
|
||||
"dependencies": {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user