@openapitools/openapi-generator-cli 2.4.25 → 2.5.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -4,7 +4,6 @@
4
4
 
5
5
  ![Build](https://github.com/OpenAPITools/openapi-generator-cli/workflows/Build/badge.svg)
6
6
  [![Renovate enabled](https://img.shields.io/badge/renovate-enabled-brightgreen.svg)](https://renovateapp.com/)
7
- [![HitCount](http://hits.dwyl.io/openapitools/openapi-generator-cli.svg)](http://hits.dwyl.com/openapitools/openapi-generator-cli)
8
7
  [![semantic-release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg)](https://github.com/semantic-release/semantic-release)
9
8
 
10
9
  OpenAPI Generator allows generation of API client libraries (SDK generation), server stubs, documentation and
@@ -173,6 +172,26 @@ is automatically used to generate your code. 🎉
173
172
  | relPath | file name and extension of file relative to the glob provided | docs/auth.yaml |
174
173
  | ext | just file extension | yaml |
175
174
 
175
+ ### Using custom / private maven registry
176
+
177
+ If you're using a private maven registry you can configure the `downloadUrl` and `queryUrl` like this:
178
+
179
+ ```json
180
+ {
181
+ "$schema": "node_modules/@openapitools/openapi-generator-cli/config.schema.json",
182
+ "spaces": 2,
183
+ "generator-cli": {
184
+ "version": "5.3.0",
185
+ "repository": {
186
+ "queryUrl": "https://private.maven.intern/solrsearch/select?q=g:${group.id}+AND+a:${artifact.id}&core=gav&start=0&rows=200",
187
+ "downloadUrl": "https://private.maven.intern/maven2/${groupId}/${artifactId}/${versionName}/${artifactId}-${versionName}.jar"
188
+ }
189
+ }
190
+ }
191
+ ```
192
+
193
+ If the `version` property param is set it is not necessary to configure the `queryUrl`.
194
+
176
195
  ## Run specific generators
177
196
 
178
197
  | cmd | v3.0 runs | v2.0 runs |
@@ -181,6 +200,18 @@ is automatically used to generate your code. 🎉
181
200
  | openapi-generator-cli generate --generator-key v3.0 v2.0 | yes | yes |
182
201
  | openapi-generator-cli generate --generator-key foo | no | no |
183
202
 
203
+ ## Use Docker instead of running java locally
204
+
205
+ ```json
206
+ {
207
+ "$schema": "node_modules/@openapitools/openapi-generator-cli/config.schema.json",
208
+ "spaces": 2,
209
+ "generator-cli": {
210
+ "useDocker": true
211
+ }
212
+ }
213
+ ```
214
+
184
215
  ## Custom Generators
185
216
 
186
217
  Custom generators can be used by passing the `--custom-generator=/my/custom-generator.jar` argument.
@@ -3,9 +3,7 @@
3
3
  "$schema": "http://json-schema.org/draft-07/schema#",
4
4
  "title": "OpenAPI Generator CLI - Config",
5
5
  "type": "object",
6
- "required": [
7
- "generator-cli"
8
- ],
6
+ "required": ["generator-cli"],
9
7
  "additionalProperties": false,
10
8
  "properties": {
11
9
  "$schema": {
@@ -17,9 +15,7 @@
17
15
  },
18
16
  "generator-cli": {
19
17
  "type": "object",
20
- "required": [
21
- "version"
22
- ],
18
+ "required": ["version"],
23
19
  "properties": {
24
20
  "version": {
25
21
  "type": "string"
@@ -37,6 +33,14 @@
37
33
  "default": "https://repo1.maven.org/maven2/${groupId}/${artifactId}/${versionName}/${artifactId}-${versionName}.jar"
38
34
  }
39
35
  },
36
+ "useDocker": {
37
+ "type": "boolean",
38
+ "default": false
39
+ },
40
+ "dockerImageName": {
41
+ "type": "string",
42
+ "default": "openapitools/openapi-generator-cli"
43
+ },
40
44
  "generators": {
41
45
  "type": "object",
42
46
  "additionalProperties": {
@@ -60,13 +64,17 @@
60
64
  },
61
65
  "generator": {
62
66
  "type": "object",
63
- "required": [
64
- "glob",
65
- "output",
66
- "generatorName"
67
+ "anyOf": [
68
+ {
69
+ "required": ["inputSpec", "output", "generatorName"]
70
+ },
71
+ {
72
+ "required": ["glob", "output", "generatorName"]
73
+ }
67
74
  ],
68
75
  "properties": {
69
76
  "glob": {
77
+ "description": "matches local specification files using a glob pattern",
70
78
  "type": "string",
71
79
  "minLength": 1
72
80
  },
package/main.js CHANGED
@@ -336,13 +336,19 @@ let ConfigService = class ConfigService {
336
336
  this.cwd = process.env.PWD || process.env.INIT_CWD || process.cwd();
337
337
  this.configFile = path__WEBPACK_IMPORTED_MODULE_2__["resolve"](this.cwd, 'openapitools.json');
338
338
  this.defaultConfig = {
339
- $schema: 'node_modules/@openapitools/openapi-generator-cli/config.schema.json',
339
+ $schema: './node_modules/@openapitools/openapi-generator-cli/config.schema.json',
340
340
  spaces: 2,
341
341
  'generator-cli': {
342
342
  version: undefined,
343
343
  },
344
344
  };
345
345
  }
346
+ get useDocker() {
347
+ return this.get('generator-cli.useDocker', false);
348
+ }
349
+ get dockerImageName() {
350
+ return this.get('generator-cli.dockerImageName', 'openapitools/openapi-generator-cli');
351
+ }
346
352
  get(path, defaultValue) {
347
353
  return Object(lodash__WEBPACK_IMPORTED_MODULE_4__["get"])(this.read(), path, defaultValue);
348
354
  }
@@ -391,13 +397,15 @@ __webpack_require__.r(__webpack_exports__);
391
397
  /* harmony import */ var concurrently__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(concurrently__WEBPACK_IMPORTED_MODULE_3__);
392
398
  /* harmony import */ var path__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! path */ "path");
393
399
  /* harmony import */ var path__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(path__WEBPACK_IMPORTED_MODULE_4__);
394
- /* harmony import */ var glob__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! glob */ "glob");
395
- /* harmony import */ var glob__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(glob__WEBPACK_IMPORTED_MODULE_5__);
396
- /* harmony import */ var chalk__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! chalk */ "chalk");
397
- /* harmony import */ var chalk__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(chalk__WEBPACK_IMPORTED_MODULE_6__);
398
- /* harmony import */ var _version_manager_service__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./version-manager.service */ "./apps/generator-cli/src/app/services/version-manager.service.ts");
399
- /* harmony import */ var _config_service__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./config.service */ "./apps/generator-cli/src/app/services/config.service.ts");
400
- /* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../constants */ "./apps/generator-cli/src/app/constants/index.ts");
400
+ /* harmony import */ var fs_extra__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! fs-extra */ "fs-extra");
401
+ /* harmony import */ var fs_extra__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(fs_extra__WEBPACK_IMPORTED_MODULE_5__);
402
+ /* harmony import */ var glob__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! glob */ "glob");
403
+ /* harmony import */ var glob__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(glob__WEBPACK_IMPORTED_MODULE_6__);
404
+ /* harmony import */ var chalk__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! chalk */ "chalk");
405
+ /* harmony import */ var chalk__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(chalk__WEBPACK_IMPORTED_MODULE_7__);
406
+ /* harmony import */ var _version_manager_service__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./version-manager.service */ "./apps/generator-cli/src/app/services/version-manager.service.ts");
407
+ /* harmony import */ var _config_service__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./config.service */ "./apps/generator-cli/src/app/services/config.service.ts");
408
+ /* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../constants */ "./apps/generator-cli/src/app/constants/index.ts");
401
409
  var _a, _b, _c;
402
410
 
403
411
 
@@ -409,6 +417,7 @@ var _a, _b, _c;
409
417
 
410
418
 
411
419
 
420
+
412
421
  let GeneratorService = class GeneratorService {
413
422
  constructor(logger, configService, versionManager) {
414
423
  this.logger = logger;
@@ -416,15 +425,32 @@ let GeneratorService = class GeneratorService {
416
425
  this.versionManager = versionManager;
417
426
  this.configPath = 'generator-cli.generators';
418
427
  this.enabled = this.configService.has(this.configPath);
419
- this.cmd = (appendix) => [
420
- 'java',
421
- process.env['JAVA_OPTS'],
422
- `-jar "${this.versionManager.filePath()}"`,
423
- 'generate',
424
- appendix,
425
- ].filter(lodash__WEBPACK_IMPORTED_MODULE_2__["isString"]).join(' ');
428
+ this.cmd = (customGenerator, appendix, dockerVolumes = {}) => {
429
+ if (this.configService.useDocker) {
430
+ const volumes = Object.entries(dockerVolumes).map(([k, v]) => `-v "${v}:${k}"`).join(' ');
431
+ return [
432
+ `docker run --rm`,
433
+ volumes,
434
+ this.versionManager.getDockerImageName(),
435
+ 'generate',
436
+ appendix
437
+ ].join(' ');
438
+ }
439
+ const cliPath = this.versionManager.filePath();
440
+ const subCmd = customGenerator
441
+ ? `-cp "${[cliPath, customGenerator].join(this.isWin() ? ';' : ':')}" org.openapitools.codegen.OpenAPIGenerator`
442
+ : `-jar "${cliPath}"`;
443
+ return [
444
+ 'java',
445
+ process.env['JAVA_OPTS'],
446
+ subCmd,
447
+ 'generate',
448
+ appendix,
449
+ ].filter(lodash__WEBPACK_IMPORTED_MODULE_2__["isString"]).join(' ');
450
+ };
451
+ this.isWin = () => process.platform === "win32";
426
452
  }
427
- generate(...keys) {
453
+ generate(customGenerator, ...keys) {
428
454
  return Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__awaiter"])(this, void 0, void 0, function* () {
429
455
  const cwd = this.configService.cwd;
430
456
  const generators = Object.entries(this.configService.get(this.configPath, {}));
@@ -432,13 +458,13 @@ let GeneratorService = class GeneratorService {
432
458
  .filter(([key, { disabled }]) => {
433
459
  if (!disabled)
434
460
  return true;
435
- this.logger.log(chalk__WEBPACK_IMPORTED_MODULE_6__["grey"](`[info] Skip ${chalk__WEBPACK_IMPORTED_MODULE_6__["yellow"](key)}, because this generator is disabled`));
461
+ this.logger.log(chalk__WEBPACK_IMPORTED_MODULE_7__["grey"](`[info] Skip ${chalk__WEBPACK_IMPORTED_MODULE_7__["yellow"](key)}, because this generator is disabled`));
436
462
  return false;
437
463
  })
438
464
  .filter(([key]) => {
439
465
  if (!keys.length || keys.includes(key))
440
466
  return true;
441
- this.logger.log(chalk__WEBPACK_IMPORTED_MODULE_6__["grey"](`[info] Skip ${chalk__WEBPACK_IMPORTED_MODULE_6__["yellow"](key)}, because only ${keys.map((k) => chalk__WEBPACK_IMPORTED_MODULE_6__["yellow"](k)).join(', ')} shall run`));
467
+ this.logger.log(chalk__WEBPACK_IMPORTED_MODULE_7__["grey"](`[info] Skip ${chalk__WEBPACK_IMPORTED_MODULE_7__["yellow"](key)}, because only ${keys.map((k) => chalk__WEBPACK_IMPORTED_MODULE_7__["yellow"](k)).join(', ')} shall run`));
442
468
  return false;
443
469
  });
444
470
  const globsWithNoMatches = [];
@@ -448,16 +474,16 @@ let GeneratorService = class GeneratorService {
448
474
  if (!globPattern) {
449
475
  return [{
450
476
  name: `[${name}] ${params.inputSpec}`,
451
- command: this.buildCommand(cwd, params)
477
+ command: this.buildCommand(cwd, params, customGenerator)
452
478
  }];
453
479
  }
454
- const specFiles = glob__WEBPACK_IMPORTED_MODULE_5__["sync"](globPattern, { cwd });
480
+ const specFiles = glob__WEBPACK_IMPORTED_MODULE_6__["sync"](globPattern, { cwd });
455
481
  if (specFiles.length < 1) {
456
482
  globsWithNoMatches.push(globPattern);
457
483
  }
458
- return glob__WEBPACK_IMPORTED_MODULE_5__["sync"](globPattern, { cwd }).map(spec => ({
484
+ return glob__WEBPACK_IMPORTED_MODULE_6__["sync"](globPattern, { cwd }).map(spec => ({
459
485
  name: `[${name}] ${spec}`,
460
- command: this.buildCommand(cwd, params, spec)
486
+ command: this.buildCommand(cwd, params, customGenerator, spec)
461
487
  }));
462
488
  }));
463
489
  const generated = commands.length > 0 && (yield (() => Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__awaiter"])(this, void 0, void 0, function* () {
@@ -470,7 +496,7 @@ let GeneratorService = class GeneratorService {
470
496
  return false;
471
497
  }
472
498
  }))());
473
- globsWithNoMatches.map(g => this.logger.log(chalk__WEBPACK_IMPORTED_MODULE_6__["yellow"](`[warn] Did not found any file matching glob "${g}"`)));
499
+ globsWithNoMatches.map(g => this.logger.log(chalk__WEBPACK_IMPORTED_MODULE_7__["yellow"](`[warn] Did not found any file matching glob "${g}"`)));
474
500
  return generated;
475
501
  });
476
502
  }
@@ -478,13 +504,27 @@ let GeneratorService = class GeneratorService {
478
504
  this.logger.log(Object(lodash__WEBPACK_IMPORTED_MODULE_2__["sortBy"])(res, 'command.name').map(({ exitCode, command }) => {
479
505
  const failed = exitCode > 0;
480
506
  return [
481
- chalk__WEBPACK_IMPORTED_MODULE_6__[failed ? 'red' : 'green'](command.name),
482
- ...(failed ? [chalk__WEBPACK_IMPORTED_MODULE_6__["yellow"](` ${command.command}\n`)] : []),
507
+ chalk__WEBPACK_IMPORTED_MODULE_7__[failed ? 'red' : 'green'](command.name),
508
+ ...(failed ? [chalk__WEBPACK_IMPORTED_MODULE_7__["yellow"](` ${command.command}\n`)] : []),
483
509
  ].join('\n');
484
510
  }).join('\n'));
485
511
  }
486
- buildCommand(cwd, params, specFile) {
512
+ buildCommand(cwd, params, customGenerator, specFile) {
513
+ const dockerVolumes = {};
487
514
  const absoluteSpecPath = specFile ? path__WEBPACK_IMPORTED_MODULE_4__["resolve"](cwd, specFile) : String(params.inputSpec);
515
+ const ext = path__WEBPACK_IMPORTED_MODULE_4__["extname"](absoluteSpecPath);
516
+ const name = path__WEBPACK_IMPORTED_MODULE_4__["basename"](absoluteSpecPath, ext);
517
+ const placeholders = {
518
+ name,
519
+ Name: Object(lodash__WEBPACK_IMPORTED_MODULE_2__["upperFirst"])(name),
520
+ cwd,
521
+ base: path__WEBPACK_IMPORTED_MODULE_4__["basename"](absoluteSpecPath),
522
+ dir: specFile && path__WEBPACK_IMPORTED_MODULE_4__["dirname"](absoluteSpecPath),
523
+ path: absoluteSpecPath,
524
+ relDir: specFile && path__WEBPACK_IMPORTED_MODULE_4__["dirname"](specFile),
525
+ relPath: specFile,
526
+ ext: ext.split('.').slice(-1).pop()
527
+ };
488
528
  const command = Object.entries(Object.assign({ inputSpec: absoluteSpecPath }, params)).map(([k, v]) => {
489
529
  const key = Object(lodash__WEBPACK_IMPORTED_MODULE_2__["kebabCase"])(k);
490
530
  const value = (() => {
@@ -497,35 +537,35 @@ let GeneratorService = class GeneratorService {
497
537
  case 'boolean':
498
538
  return undefined;
499
539
  default:
540
+ if (this.configService.useDocker) {
541
+ v = this.replacePlaceholders(placeholders, v);
542
+ if (key === 'output') {
543
+ fs_extra__WEBPACK_IMPORTED_MODULE_5__["ensureDirSync"](v);
544
+ }
545
+ if (fs_extra__WEBPACK_IMPORTED_MODULE_5__["existsSync"](v)) {
546
+ dockerVolumes[`/local/${key}`] = path__WEBPACK_IMPORTED_MODULE_4__["resolve"](cwd, v);
547
+ return `"/local/${key}"`;
548
+ }
549
+ }
500
550
  return `"${v}"`;
501
551
  }
502
552
  })();
503
553
  return value === undefined ? `--${key}` : `--${key}=${value}`;
504
554
  }).join(' ');
505
- const ext = path__WEBPACK_IMPORTED_MODULE_4__["extname"](absoluteSpecPath);
506
- const name = path__WEBPACK_IMPORTED_MODULE_4__["basename"](absoluteSpecPath, ext);
507
- const placeholders = {
508
- name,
509
- Name: Object(lodash__WEBPACK_IMPORTED_MODULE_2__["upperFirst"])(name),
510
- cwd,
511
- base: path__WEBPACK_IMPORTED_MODULE_4__["basename"](absoluteSpecPath),
512
- dir: specFile && path__WEBPACK_IMPORTED_MODULE_4__["dirname"](absoluteSpecPath),
513
- path: absoluteSpecPath,
514
- relDir: specFile && path__WEBPACK_IMPORTED_MODULE_4__["dirname"](specFile),
515
- relPath: specFile,
516
- ext: ext.split('.').slice(-1).pop()
517
- };
518
- return this.cmd(Object.entries(placeholders)
555
+ return this.cmd(customGenerator, this.replacePlaceholders(placeholders, command), dockerVolumes);
556
+ }
557
+ replacePlaceholders(placeholders, input) {
558
+ return Object.entries(placeholders)
519
559
  .filter(([, replacement]) => !!replacement)
520
- .reduce((cmd, [search, replacement]) => {
521
- return cmd.split(`#{${search}}`).join(replacement);
522
- }, command));
560
+ .reduce((acc, [search, replacement]) => {
561
+ return acc.split(`#{${search}}`).join(replacement);
562
+ }, input);
523
563
  }
524
564
  };
525
565
  GeneratorService = Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([
526
566
  Object(_nestjs_common__WEBPACK_IMPORTED_MODULE_1__["Injectable"])(),
527
- Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__param"])(0, Object(_nestjs_common__WEBPACK_IMPORTED_MODULE_1__["Inject"])(_constants__WEBPACK_IMPORTED_MODULE_9__["LOGGER"])),
528
- Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__metadata"])("design:paramtypes", [typeof (_a = typeof _constants__WEBPACK_IMPORTED_MODULE_9__["LOGGER"] !== "undefined" && _constants__WEBPACK_IMPORTED_MODULE_9__["LOGGER"]) === "function" ? _a : Object, typeof (_b = typeof _config_service__WEBPACK_IMPORTED_MODULE_8__["ConfigService"] !== "undefined" && _config_service__WEBPACK_IMPORTED_MODULE_8__["ConfigService"]) === "function" ? _b : Object, typeof (_c = typeof _version_manager_service__WEBPACK_IMPORTED_MODULE_7__["VersionManagerService"] !== "undefined" && _version_manager_service__WEBPACK_IMPORTED_MODULE_7__["VersionManagerService"]) === "function" ? _c : Object])
567
+ Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__param"])(0, Object(_nestjs_common__WEBPACK_IMPORTED_MODULE_1__["Inject"])(_constants__WEBPACK_IMPORTED_MODULE_10__["LOGGER"])),
568
+ Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__metadata"])("design:paramtypes", [typeof (_a = typeof _constants__WEBPACK_IMPORTED_MODULE_10__["LOGGER"] !== "undefined" && _constants__WEBPACK_IMPORTED_MODULE_10__["LOGGER"]) === "function" ? _a : Object, typeof (_b = typeof _config_service__WEBPACK_IMPORTED_MODULE_9__["ConfigService"] !== "undefined" && _config_service__WEBPACK_IMPORTED_MODULE_9__["ConfigService"]) === "function" ? _b : Object, typeof (_c = typeof _version_manager_service__WEBPACK_IMPORTED_MODULE_8__["VersionManagerService"] !== "undefined" && _version_manager_service__WEBPACK_IMPORTED_MODULE_8__["VersionManagerService"]) === "function" ? _c : Object])
529
569
  ], GeneratorService);
530
570
 
531
571
 
@@ -590,7 +630,9 @@ __webpack_require__.r(__webpack_exports__);
590
630
  /* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../constants */ "./apps/generator-cli/src/app/constants/index.ts");
591
631
  /* harmony import */ var _generator_service__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./generator.service */ "./apps/generator-cli/src/app/services/generator.service.ts");
592
632
  /* harmony import */ var _version_manager_service__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./version-manager.service */ "./apps/generator-cli/src/app/services/version-manager.service.ts");
593
- var _a, _b, _c, _d;
633
+ /* harmony import */ var _config_service__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./config.service */ "./apps/generator-cli/src/app/services/config.service.ts");
634
+ var _a, _b, _c, _d, _e;
635
+
594
636
 
595
637
 
596
638
 
@@ -601,10 +643,11 @@ var _a, _b, _c, _d;
601
643
 
602
644
 
603
645
  let PassThroughService = class PassThroughService {
604
- constructor(logger, program, versionManager, generatorService) {
646
+ constructor(logger, program, versionManager, configService, generatorService) {
605
647
  this.logger = logger;
606
648
  this.program = program;
607
649
  this.versionManager = versionManager;
650
+ this.configService = configService;
608
651
  this.generatorService = generatorService;
609
652
  this.passThrough = (cmd) => {
610
653
  const args = [cmd.name(), ...cmd.args];
@@ -670,11 +713,13 @@ let PassThroughService = class PassThroughService {
670
713
  commands.get('generate')
671
714
  .option("--generator-key <generator...>", "Run generator by key. Separate by comma to run many generators")
672
715
  .action((_, cmd) => Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__awaiter"])(this, void 0, void 0, function* () {
716
+ var _a;
673
717
  if (cmd.args.length === 0 || cmd.opts().generatorKey) {
718
+ const customGenerator = (_a = this.program.opts()) === null || _a === void 0 ? void 0 : _a.customGenerator;
674
719
  const generatorKeys = cmd.opts().generatorKey || [];
675
720
  if (this.generatorService.enabled) {
676
721
  // @todo cover by unit test
677
- if (!(yield this.generatorService.generate(...generatorKeys))) {
722
+ if (!(yield this.generatorService.generate(customGenerator, ...generatorKeys))) {
678
723
  this.logger.log(chalk__WEBPACK_IMPORTED_MODULE_2__["red"]('Code generation failed'));
679
724
  process.exit(1);
680
725
  }
@@ -687,6 +732,12 @@ let PassThroughService = class PassThroughService {
687
732
  }
688
733
  cmd() {
689
734
  var _a;
735
+ if (this.configService.useDocker) {
736
+ return [
737
+ `docker run --rm -v "${this.configService.cwd}:/local"`,
738
+ this.versionManager.getDockerImageName(),
739
+ ].join(' ');
740
+ }
690
741
  const customGenerator = (_a = this.program.opts()) === null || _a === void 0 ? void 0 : _a.customGenerator;
691
742
  const cliPath = this.versionManager.filePath();
692
743
  const subCmd = customGenerator
@@ -702,7 +753,7 @@ PassThroughService = Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([
702
753
  Object(_nestjs_common__WEBPACK_IMPORTED_MODULE_1__["Injectable"])(),
703
754
  Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__param"])(0, Object(_nestjs_common__WEBPACK_IMPORTED_MODULE_1__["Inject"])(_constants__WEBPACK_IMPORTED_MODULE_6__["LOGGER"])),
704
755
  Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__param"])(1, Object(_nestjs_common__WEBPACK_IMPORTED_MODULE_1__["Inject"])(_constants__WEBPACK_IMPORTED_MODULE_6__["COMMANDER_PROGRAM"])),
705
- Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__metadata"])("design:paramtypes", [typeof (_a = typeof _constants__WEBPACK_IMPORTED_MODULE_6__["LOGGER"] !== "undefined" && _constants__WEBPACK_IMPORTED_MODULE_6__["LOGGER"]) === "function" ? _a : Object, typeof (_b = typeof commander__WEBPACK_IMPORTED_MODULE_4__["Command"] !== "undefined" && commander__WEBPACK_IMPORTED_MODULE_4__["Command"]) === "function" ? _b : Object, typeof (_c = typeof _version_manager_service__WEBPACK_IMPORTED_MODULE_8__["VersionManagerService"] !== "undefined" && _version_manager_service__WEBPACK_IMPORTED_MODULE_8__["VersionManagerService"]) === "function" ? _c : Object, typeof (_d = typeof _generator_service__WEBPACK_IMPORTED_MODULE_7__["GeneratorService"] !== "undefined" && _generator_service__WEBPACK_IMPORTED_MODULE_7__["GeneratorService"]) === "function" ? _d : Object])
756
+ Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__metadata"])("design:paramtypes", [typeof (_a = typeof _constants__WEBPACK_IMPORTED_MODULE_6__["LOGGER"] !== "undefined" && _constants__WEBPACK_IMPORTED_MODULE_6__["LOGGER"]) === "function" ? _a : Object, typeof (_b = typeof commander__WEBPACK_IMPORTED_MODULE_4__["Command"] !== "undefined" && commander__WEBPACK_IMPORTED_MODULE_4__["Command"]) === "function" ? _b : Object, typeof (_c = typeof _version_manager_service__WEBPACK_IMPORTED_MODULE_8__["VersionManagerService"] !== "undefined" && _version_manager_service__WEBPACK_IMPORTED_MODULE_8__["VersionManagerService"]) === "function" ? _c : Object, typeof (_d = typeof _config_service__WEBPACK_IMPORTED_MODULE_9__["ConfigService"] !== "undefined" && _config_service__WEBPACK_IMPORTED_MODULE_9__["ConfigService"]) === "function" ? _d : Object, typeof (_e = typeof _generator_service__WEBPACK_IMPORTED_MODULE_7__["GeneratorService"] !== "undefined" && _generator_service__WEBPACK_IMPORTED_MODULE_7__["GeneratorService"]) === "function" ? _e : Object])
706
757
  ], PassThroughService);
707
758
 
708
759
 
@@ -813,6 +864,8 @@ __webpack_require__.r(__webpack_exports__);
813
864
  /* harmony import */ var _config_service__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./config.service */ "./apps/generator-cli/src/app/services/config.service.ts");
814
865
  /* harmony import */ var _config_schema_json__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../../config.schema.json */ "./apps/generator-cli/src/config.schema.json");
815
866
  var _config_schema_json__WEBPACK_IMPORTED_MODULE_11___namespace = /*#__PURE__*/__webpack_require__.t(/*! ../../config.schema.json */ "./apps/generator-cli/src/config.schema.json", 1);
867
+ /* harmony import */ var child_process__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! child_process */ "child_process");
868
+ /* harmony import */ var child_process__WEBPACK_IMPORTED_MODULE_12___default = /*#__PURE__*/__webpack_require__.n(child_process__WEBPACK_IMPORTED_MODULE_12__);
816
869
  var _a, _b, _c;
817
870
 
818
871
 
@@ -826,6 +879,7 @@ var _a, _b, _c;
826
879
 
827
880
 
828
881
 
882
+
829
883
  const mvn = {
830
884
  repo: 'https://search.maven.org',
831
885
  groupId: 'org.openapitools',
@@ -874,6 +928,9 @@ let VersionManagerService = class VersionManagerService {
874
928
  getSelectedVersion() {
875
929
  return this.configService.get('generator-cli.version');
876
930
  }
931
+ getDockerImageName(versionName) {
932
+ return `${this.configService.dockerImageName}:v${versionName || this.getSelectedVersion()}`;
933
+ }
877
934
  setSelectedVersion(versionName) {
878
935
  return Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__awaiter"])(this, void 0, void 0, function* () {
879
936
  const downloaded = yield this.downloadIfNeeded(versionName);
@@ -885,13 +942,33 @@ let VersionManagerService = class VersionManagerService {
885
942
  }
886
943
  remove(versionName) {
887
944
  return Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__awaiter"])(this, void 0, void 0, function* () {
888
- fs_extra__WEBPACK_IMPORTED_MODULE_4__["removeSync"](this.filePath(versionName));
945
+ if (this.configService.useDocker) {
946
+ yield new Promise(resolve => {
947
+ Object(child_process__WEBPACK_IMPORTED_MODULE_12__["spawn"])('docker', ['rmi', this.getDockerImageName(versionName)], {
948
+ stdio: 'inherit',
949
+ shell: true
950
+ }).on('exit', () => resolve());
951
+ });
952
+ }
953
+ else {
954
+ fs_extra__WEBPACK_IMPORTED_MODULE_4__["removeSync"](this.filePath(versionName));
955
+ }
889
956
  this.logger.log(chalk__WEBPACK_IMPORTED_MODULE_7__["green"](`Removed ${versionName}`));
890
957
  });
891
958
  }
892
959
  download(versionName) {
893
960
  return Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__awaiter"])(this, void 0, void 0, function* () {
894
961
  this.logger.log(chalk__WEBPACK_IMPORTED_MODULE_7__["yellow"](`Download ${versionName} ...`));
962
+ if (this.configService.useDocker) {
963
+ yield new Promise(resolve => {
964
+ Object(child_process__WEBPACK_IMPORTED_MODULE_12__["spawn"])('docker', ['pull', this.getDockerImageName(versionName)], {
965
+ stdio: 'inherit',
966
+ shell: true
967
+ }).on('exit', () => resolve());
968
+ });
969
+ this.logger.log(chalk__WEBPACK_IMPORTED_MODULE_7__["green"](`Downloaded ${versionName}`));
970
+ return;
971
+ }
895
972
  const downloadLink = this.createDownloadLink(versionName);
896
973
  const filePath = this.filePath(versionName);
897
974
  try {
@@ -929,6 +1006,10 @@ let VersionManagerService = class VersionManagerService {
929
1006
  });
930
1007
  }
931
1008
  isDownloaded(versionName) {
1009
+ if (this.configService.useDocker) {
1010
+ const { status } = Object(child_process__WEBPACK_IMPORTED_MODULE_12__["spawnSync"])('docker', ['image', 'inspect', this.getDockerImageName(versionName)]);
1011
+ return status === 0;
1012
+ }
932
1013
  return fs_extra__WEBPACK_IMPORTED_MODULE_4__["existsSync"](path__WEBPACK_IMPORTED_MODULE_5__["resolve"](this.storage, `${versionName}.jar`));
933
1014
  }
934
1015
  filterVersionsByTags(versions, tags) {
@@ -979,7 +1060,7 @@ VersionManagerService = Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])
979
1060
  /*! exports provided: $id, $schema, title, type, required, additionalProperties, properties, definitions, default */
980
1061
  /***/ (function(module) {
981
1062
 
982
- module.exports = JSON.parse("{\"$id\":\"https://openapitools.org/openapi-generator-cli/config.schema.json\",\"$schema\":\"http://json-schema.org/draft-07/schema#\",\"title\":\"OpenAPI Generator CLI - Config\",\"type\":\"object\",\"required\":[\"generator-cli\"],\"additionalProperties\":false,\"properties\":{\"$schema\":{\"type\":\"string\"},\"spaces\":{\"type\":\"number\",\"default\":2},\"generator-cli\":{\"type\":\"object\",\"required\":[\"version\"],\"properties\":{\"version\":{\"type\":\"string\"},\"storageDir\":{\"type\":\"string\"},\"repository\":{\"queryUrl\":{\"type\":\"string\",\"default\":\"https://search.maven.org/solrsearch/select?q=g:${group.id}+AND+a:${artifact.id}&core=gav&start=0&rows=200\"},\"downloadUrl\":{\"type\":\"string\",\"default\":\"https://repo1.maven.org/maven2/${groupId}/${artifactId}/${versionName}/${artifactId}-${versionName}.jar\"}},\"generators\":{\"type\":\"object\",\"additionalProperties\":{\"$ref\":\"#/definitions/generator\"}}}}},\"definitions\":{\"strOrAnyObject\":{\"anyOf\":[{\"type\":\"string\"},{\"type\":\"object\",\"additionalProperties\":true}]},\"generator\":{\"type\":\"object\",\"required\":[\"glob\",\"output\",\"generatorName\"],\"properties\":{\"glob\":{\"type\":\"string\",\"minLength\":1},\"output\":{\"type\":\"string\",\"minLength\":1},\"disabled\":{\"type\":\"boolean\",\"default\":false},\"generatorName\":{\"description\":\"generator to use (see list command for list)\",\"anyOf\":[{\"type\":\"string\"},{\"type\":\"string\",\"enum\":[\"ada\",\"ada-server\",\"android\",\"apache2\",\"apex\",\"asciidoc\",\"aspnetcore\",\"avro-schema\",\"bash\",\"c\",\"clojure\",\"cpp-pistache-server\",\"cpp-qt5-client\",\"cpp-qt5-qhttpengine-server\",\"cpp-restbed-server\",\"cpp-restsdk\",\"cpp-tizen\",\"csharp\",\"csharp-nancyfx\",\"csharp-netcore\",\"cwiki\",\"dart\",\"dart-dio\",\"dart-jaguar\",\"dynamic-html\",\"eiffel\",\"elixir\",\"elm\",\"erlang-client\",\"erlang-proper\",\"erlang-server\",\"flash\",\"fsharp-functions\",\"fsharp-giraffe-server\",\"go\",\"go-experimental\",\"go-gin-server\",\"go-server\",\"graphql-nodejs-express-server\",\"graphql-schema\",\"groovy\",\"haskell\",\"haskell-http-client\",\"html\",\"html2\",\"java\",\"java-inflector\",\"java-msf4j\",\"java-pkmst\",\"java-play-framework\",\"java-undertow-server\",\"java-vertx\",\"java-vertx-web\",\"javascript\",\"javascript-apollo\",\"javascript-closure-angular\",\"javascript-flowtyped\",\"jaxrs-cxf\",\"jaxrs-cxf-cdi\",\"jaxrs-cxf-client\",\"jaxrs-cxf-extended\",\"jaxrs-jersey\",\"jaxrs-resteasy\",\"jaxrs-resteasy-eap\",\"jaxrs-spec\",\"jmeter\",\"k6\",\"kotlin\",\"kotlin-server\",\"kotlin-spring\",\"kotlin-vertx\",\"lua\",\"markdown\",\"mysql-schema\",\"nim\",\"nodejs-express-server\",\"objc\",\"ocaml\",\"openapi\",\"openapi-yaml\",\"perl\",\"php\",\"php-laravel\",\"php-lumen\",\"php-silex\",\"php-slim4\",\"php-symfony\",\"php-ze-ph\",\"powershell\",\"powershell-experimental\",\"protobuf-schema\",\"python\",\"python-aiohttp\",\"python-blueplanet\",\"python-experimental\",\"python-flask\",\"r\",\"ruby\",\"ruby-on-rails\",\"ruby-sinatra\",\"rust\",\"rust-server\",\"scala-akka\",\"scala-akka-http-server\",\"scala-finch\",\"scala-gatling\",\"scala-lagom-server\",\"scala-play-server\",\"scala-sttp\",\"scalatra\",\"scalaz\",\"spring\",\"swift4\",\"swift5\",\"typescript-angular\",\"typescript-angularjs\",\"typescript-aurelia\",\"typescript-axios\",\"typescript-fetch\",\"typescript-inversify\",\"typescript-jquery\",\"typescript-node\",\"typescript-redux-query\",\"typescript-rxjs\"]}]},\"auth\":{\"type\":\"string\",\"description\":\"adds authorization headers when fetching the OpenAPI definitions remotely. Pass in a URL-encoded string of name:header with a comma separating multiple values\"},\"apiNameSuffix\":{\"type\":\"string\",\"description\":\"suffix that will be appended to all API names ('tags'). Default: Api. e.g. Pet => PetApi. Note: Only ruby, python, jaxrs generators support this feature at the moment\"},\"apiPackage\":{\"type\":\"string\",\"description\":\"package for generated api classes\"},\"artifactId\":{\"type\":\"string\",\"description\":\"artifactId in generated pom.xml. This also becomes part of the generated library's filename\"},\"artifactVersion\":{\"type\":\"string\",\"description\":\"artifact version in generated pom.xml. This also becomes part of the generated library's filename\"},\"config\":{\"type\":\"string\",\"description\":\"path to configuration file. It can be JSON or YAML\"},\"dryRun\":{\"type\":\"boolean\",\"description\":\"try things out and report on potential changes (without actually making changes)\"},\"engine\":{\"type\":\"string\",\"enum\":[\"mustache\",\"handlebars\"],\"description\":\"templating engine: \\\"mustache\\\" (default) or \\\"handlebars\\\" (beta)\"},\"enablePostProcessFile\":{\"type\":\"boolean\",\"description\":\"enable post-processing file using environment variables\"},\"generateAliasAsModel\":{\"type\":\"boolean\",\"description\":\"generate model implementation for aliases to map and array schemas. An 'alias' is an array, map, or list which is defined inline in a OpenAPI document and becomes a model in the generated code. A 'map' schema is an object that can have undeclared properties, i.e. the 'additionalproperties' attribute is set on that object. An 'array' schema is a list of sub schemas in a OAS document\"},\"gitHost\":{\"type\":\"string\",\"description\":\"git host, e.g. gitlab.com\"},\"gitRepoId\":{\"type\":\"string\",\"description\":\"git repo ID, e.g. openapi-generator\"},\"gitUserId\":{\"type\":\"string\",\"description\":\"git user ID, e.g. openapitools\"},\"globalProperty\":{\"anyOf\":[{\"type\":\"string\"},{\"type\":\"object\",\"additionalProperties\":true}],\"description\":\"sets specified global properties (previously called 'system properties') in the format of name=value,name=value (or multiple options, each with name=value)\"},\"groupId\":{\"type\":\"string\",\"description\":\"groupId in generated pom.xml\"},\"httpUserAgent\":{\"type\":\"string\",\"description\":\"HTTP user agent, e.g. codegen_csharp_api_client, default to 'OpenAPI-Generator/{packageVersion}}/{language}'\"},\"inputSpec\":{\"type\":\"string\",\"description\":\"location of the OpenAPI spec, as URL or file (required if not loaded via config using -c)\"},\"ignoreFileOverride\":{\"type\":\"string\",\"description\":\"specifies an override location for the .openapi-generator-ignore file. Most useful on initial generation.\\n\"},\"importMappings\":{\"anyOf\":[{\"type\":\"string\"},{\"type\":\"object\",\"additionalProperties\":true}],\"description\":\"specifies mappings between a given class and the import that should be used for that class in the format of type=import,type=import. You can also have multiple occurrences of this option\"},\"instantiationTypes\":{\"anyOf\":[{\"type\":\"string\"},{\"type\":\"object\",\"additionalProperties\":true}],\"description\":\"sets instantiation type mappings in the format of type=instantiatedType,type=instantiatedType.For example (in Java): array=ArrayList,map=HashMap. In other words array types will get instantiated as ArrayList in generated code. You can also have multiple occurrences of this option\"},\"invokerPackage\":{\"type\":\"string\",\"description\":\"root package for generated code\"},\"languageSpecificPrimitives\":{\"anyOf\":[{\"type\":\"string\"},{\"type\":\"object\",\"additionalProperties\":true}],\"description\":\"specifies additional language specific primitive types in the format of type1,type2,type3,type3. For example: String,boolean,Boolean,Double. You can also have multiple occurrences of this option\"},\"legacyDiscriminatorBehavior\":{\"type\":\"boolean\",\"description\":\"this flag is used by OpenAPITools codegen to influence the processing of the discriminator attribute in OpenAPI documents. This flag has no impact if the OAS document does not use the discriminator attribute. The default value of this flag is set in each language-specific code generator (e.g. Python, Java, go...)using the method toModelName. Note to developers supporting a language generator in OpenAPITools; to fully support the discriminator attribute as defined in the OAS specification 3.x, language generators should set this flag to true by default; however this requires updating the mustache templates to generate a language-specific discriminator lookup function that iterates over {{#mappedModels}} and does not iterate over {{children}}, {{#anyOf}}, or {{#oneOf}}\"},\"library\":{\"type\":\"string\",\"description\":\"library template (sub-template)\"},\"logToStderr\":{\"type\":\"boolean\",\"description\":\"write all log messages (not just errors) to STDOUT. Useful for piping the JSON output of debug options (e.g. `-DdebugOperations`) to an external parser directly while testing a generator\"},\"minimalUpdate\":{\"type\":\"boolean\",\"description\":\"only write output files that have changed\"},\"modelNamePrefix\":{\"type\":\"string\",\"description\":\"prefix that will be prepended to all model names\"},\"modelNameSuffix\":{\"type\":\"string\",\"description\":\"suffix that will be appended to all model names\"},\"modelPackage\":{\"type\":\"string\",\"description\":\"package for generated models\"},\"additionalProperties\":{\"description\":\"sets additional properties that can be referenced by the mustache templates in the format of name=value,name=value. You can also have multiple occurrences of this option\",\"anyOf\":[{\"type\":\"string\"},{\"type\":\"object\",\"additionalProperties\":true}]},\"packageName\":{\"type\":\"string\",\"description\":\"package for generated classes (where supported)\"},\"releaseNote\":{\"type\":\"string\",\"description\":\"release note, default to 'Minor update'\"},\"removeOperationIdPrefix\":{\"type\":\"boolean\",\"description\":\"remove prefix of operationId, e.g. config_getId => getId\"},\"reservedWordsMappings\":{\"anyOf\":[{\"type\":\"string\"},{\"type\":\"object\",\"additionalProperties\":true}],\"description\":\"specifies how a reserved name should be escaped to. Otherwise, the default _<name> is used. For example id=identifier. You can also have multiple occurrences of this option\"},\"skipOverwrite\":{\"type\":\"boolean\",\"description\":\"specifies if the existing files should be overwritten during the generation\"},\"serverVariables\":{\"anyOf\":[{\"type\":\"string\"},{\"type\":\"object\",\"additionalProperties\":true}],\"description\":\"sets server variables overrides for spec documents which support variable templating of servers\"},\"skipValidateSpec\":{\"type\":\"boolean\",\"description\":\"skips the default behavior of validating an input specification\"},\"strictSpec\":{\"type\":\"boolean\",\"description\":\"'MUST' and 'SHALL' wording in OpenAPI spec is strictly adhered to. e.g. when false, no fixes will be applied to documents which pass validation but don't follow the spec\"},\"templateDir\":{\"type\":\"string\",\"description\":\"folder containing the template files\"},\"typeMappings\":{\"anyOf\":[{\"type\":\"string\"},{\"type\":\"object\",\"additionalProperties\":true}],\"description\":\"sets mappings between OpenAPI spec types and generated code types in the format of OpenAPIType=generatedType,OpenAPIType=generatedType. For example: array=List,map=Map,string=String. You can also have multiple occurrences of this option\"},\"verbose\":{\"type\":\"boolean\",\"description\":\"verbose mode\"}}}}}");
1063
+ module.exports = JSON.parse("{\"$id\":\"https://openapitools.org/openapi-generator-cli/config.schema.json\",\"$schema\":\"http://json-schema.org/draft-07/schema#\",\"title\":\"OpenAPI Generator CLI - Config\",\"type\":\"object\",\"required\":[\"generator-cli\"],\"additionalProperties\":false,\"properties\":{\"$schema\":{\"type\":\"string\"},\"spaces\":{\"type\":\"number\",\"default\":2},\"generator-cli\":{\"type\":\"object\",\"required\":[\"version\"],\"properties\":{\"version\":{\"type\":\"string\"},\"storageDir\":{\"type\":\"string\"},\"repository\":{\"queryUrl\":{\"type\":\"string\",\"default\":\"https://search.maven.org/solrsearch/select?q=g:${group.id}+AND+a:${artifact.id}&core=gav&start=0&rows=200\"},\"downloadUrl\":{\"type\":\"string\",\"default\":\"https://repo1.maven.org/maven2/${groupId}/${artifactId}/${versionName}/${artifactId}-${versionName}.jar\"}},\"useDocker\":{\"type\":\"boolean\",\"default\":false},\"dockerImageName\":{\"type\":\"string\",\"default\":\"openapitools/openapi-generator-cli\"},\"generators\":{\"type\":\"object\",\"additionalProperties\":{\"$ref\":\"#/definitions/generator\"}}}}},\"definitions\":{\"strOrAnyObject\":{\"anyOf\":[{\"type\":\"string\"},{\"type\":\"object\",\"additionalProperties\":true}]},\"generator\":{\"type\":\"object\",\"anyOf\":[{\"required\":[\"inputSpec\",\"output\",\"generatorName\"]},{\"required\":[\"glob\",\"output\",\"generatorName\"]}],\"properties\":{\"glob\":{\"description\":\"matches local specification files using a glob pattern\",\"type\":\"string\",\"minLength\":1},\"output\":{\"type\":\"string\",\"minLength\":1},\"disabled\":{\"type\":\"boolean\",\"default\":false},\"generatorName\":{\"description\":\"generator to use (see list command for list)\",\"anyOf\":[{\"type\":\"string\"},{\"type\":\"string\",\"enum\":[\"ada\",\"ada-server\",\"android\",\"apache2\",\"apex\",\"asciidoc\",\"aspnetcore\",\"avro-schema\",\"bash\",\"c\",\"clojure\",\"cpp-pistache-server\",\"cpp-qt5-client\",\"cpp-qt5-qhttpengine-server\",\"cpp-restbed-server\",\"cpp-restsdk\",\"cpp-tizen\",\"csharp\",\"csharp-nancyfx\",\"csharp-netcore\",\"cwiki\",\"dart\",\"dart-dio\",\"dart-jaguar\",\"dynamic-html\",\"eiffel\",\"elixir\",\"elm\",\"erlang-client\",\"erlang-proper\",\"erlang-server\",\"flash\",\"fsharp-functions\",\"fsharp-giraffe-server\",\"go\",\"go-experimental\",\"go-gin-server\",\"go-server\",\"graphql-nodejs-express-server\",\"graphql-schema\",\"groovy\",\"haskell\",\"haskell-http-client\",\"html\",\"html2\",\"java\",\"java-inflector\",\"java-msf4j\",\"java-pkmst\",\"java-play-framework\",\"java-undertow-server\",\"java-vertx\",\"java-vertx-web\",\"javascript\",\"javascript-apollo\",\"javascript-closure-angular\",\"javascript-flowtyped\",\"jaxrs-cxf\",\"jaxrs-cxf-cdi\",\"jaxrs-cxf-client\",\"jaxrs-cxf-extended\",\"jaxrs-jersey\",\"jaxrs-resteasy\",\"jaxrs-resteasy-eap\",\"jaxrs-spec\",\"jmeter\",\"k6\",\"kotlin\",\"kotlin-server\",\"kotlin-spring\",\"kotlin-vertx\",\"lua\",\"markdown\",\"mysql-schema\",\"nim\",\"nodejs-express-server\",\"objc\",\"ocaml\",\"openapi\",\"openapi-yaml\",\"perl\",\"php\",\"php-laravel\",\"php-lumen\",\"php-silex\",\"php-slim4\",\"php-symfony\",\"php-ze-ph\",\"powershell\",\"powershell-experimental\",\"protobuf-schema\",\"python\",\"python-aiohttp\",\"python-blueplanet\",\"python-experimental\",\"python-flask\",\"r\",\"ruby\",\"ruby-on-rails\",\"ruby-sinatra\",\"rust\",\"rust-server\",\"scala-akka\",\"scala-akka-http-server\",\"scala-finch\",\"scala-gatling\",\"scala-lagom-server\",\"scala-play-server\",\"scala-sttp\",\"scalatra\",\"scalaz\",\"spring\",\"swift4\",\"swift5\",\"typescript-angular\",\"typescript-angularjs\",\"typescript-aurelia\",\"typescript-axios\",\"typescript-fetch\",\"typescript-inversify\",\"typescript-jquery\",\"typescript-node\",\"typescript-redux-query\",\"typescript-rxjs\"]}]},\"auth\":{\"type\":\"string\",\"description\":\"adds authorization headers when fetching the OpenAPI definitions remotely. Pass in a URL-encoded string of name:header with a comma separating multiple values\"},\"apiNameSuffix\":{\"type\":\"string\",\"description\":\"suffix that will be appended to all API names ('tags'). Default: Api. e.g. Pet => PetApi. Note: Only ruby, python, jaxrs generators support this feature at the moment\"},\"apiPackage\":{\"type\":\"string\",\"description\":\"package for generated api classes\"},\"artifactId\":{\"type\":\"string\",\"description\":\"artifactId in generated pom.xml. This also becomes part of the generated library's filename\"},\"artifactVersion\":{\"type\":\"string\",\"description\":\"artifact version in generated pom.xml. This also becomes part of the generated library's filename\"},\"config\":{\"type\":\"string\",\"description\":\"path to configuration file. It can be JSON or YAML\"},\"dryRun\":{\"type\":\"boolean\",\"description\":\"try things out and report on potential changes (without actually making changes)\"},\"engine\":{\"type\":\"string\",\"enum\":[\"mustache\",\"handlebars\"],\"description\":\"templating engine: \\\"mustache\\\" (default) or \\\"handlebars\\\" (beta)\"},\"enablePostProcessFile\":{\"type\":\"boolean\",\"description\":\"enable post-processing file using environment variables\"},\"generateAliasAsModel\":{\"type\":\"boolean\",\"description\":\"generate model implementation for aliases to map and array schemas. An 'alias' is an array, map, or list which is defined inline in a OpenAPI document and becomes a model in the generated code. A 'map' schema is an object that can have undeclared properties, i.e. the 'additionalproperties' attribute is set on that object. An 'array' schema is a list of sub schemas in a OAS document\"},\"gitHost\":{\"type\":\"string\",\"description\":\"git host, e.g. gitlab.com\"},\"gitRepoId\":{\"type\":\"string\",\"description\":\"git repo ID, e.g. openapi-generator\"},\"gitUserId\":{\"type\":\"string\",\"description\":\"git user ID, e.g. openapitools\"},\"globalProperty\":{\"anyOf\":[{\"type\":\"string\"},{\"type\":\"object\",\"additionalProperties\":true}],\"description\":\"sets specified global properties (previously called 'system properties') in the format of name=value,name=value (or multiple options, each with name=value)\"},\"groupId\":{\"type\":\"string\",\"description\":\"groupId in generated pom.xml\"},\"httpUserAgent\":{\"type\":\"string\",\"description\":\"HTTP user agent, e.g. codegen_csharp_api_client, default to 'OpenAPI-Generator/{packageVersion}}/{language}'\"},\"inputSpec\":{\"type\":\"string\",\"description\":\"location of the OpenAPI spec, as URL or file (required if not loaded via config using -c)\"},\"ignoreFileOverride\":{\"type\":\"string\",\"description\":\"specifies an override location for the .openapi-generator-ignore file. Most useful on initial generation.\\n\"},\"importMappings\":{\"anyOf\":[{\"type\":\"string\"},{\"type\":\"object\",\"additionalProperties\":true}],\"description\":\"specifies mappings between a given class and the import that should be used for that class in the format of type=import,type=import. You can also have multiple occurrences of this option\"},\"instantiationTypes\":{\"anyOf\":[{\"type\":\"string\"},{\"type\":\"object\",\"additionalProperties\":true}],\"description\":\"sets instantiation type mappings in the format of type=instantiatedType,type=instantiatedType.For example (in Java): array=ArrayList,map=HashMap. In other words array types will get instantiated as ArrayList in generated code. You can also have multiple occurrences of this option\"},\"invokerPackage\":{\"type\":\"string\",\"description\":\"root package for generated code\"},\"languageSpecificPrimitives\":{\"anyOf\":[{\"type\":\"string\"},{\"type\":\"object\",\"additionalProperties\":true}],\"description\":\"specifies additional language specific primitive types in the format of type1,type2,type3,type3. For example: String,boolean,Boolean,Double. You can also have multiple occurrences of this option\"},\"legacyDiscriminatorBehavior\":{\"type\":\"boolean\",\"description\":\"this flag is used by OpenAPITools codegen to influence the processing of the discriminator attribute in OpenAPI documents. This flag has no impact if the OAS document does not use the discriminator attribute. The default value of this flag is set in each language-specific code generator (e.g. Python, Java, go...)using the method toModelName. Note to developers supporting a language generator in OpenAPITools; to fully support the discriminator attribute as defined in the OAS specification 3.x, language generators should set this flag to true by default; however this requires updating the mustache templates to generate a language-specific discriminator lookup function that iterates over {{#mappedModels}} and does not iterate over {{children}}, {{#anyOf}}, or {{#oneOf}}\"},\"library\":{\"type\":\"string\",\"description\":\"library template (sub-template)\"},\"logToStderr\":{\"type\":\"boolean\",\"description\":\"write all log messages (not just errors) to STDOUT. Useful for piping the JSON output of debug options (e.g. `-DdebugOperations`) to an external parser directly while testing a generator\"},\"minimalUpdate\":{\"type\":\"boolean\",\"description\":\"only write output files that have changed\"},\"modelNamePrefix\":{\"type\":\"string\",\"description\":\"prefix that will be prepended to all model names\"},\"modelNameSuffix\":{\"type\":\"string\",\"description\":\"suffix that will be appended to all model names\"},\"modelPackage\":{\"type\":\"string\",\"description\":\"package for generated models\"},\"additionalProperties\":{\"description\":\"sets additional properties that can be referenced by the mustache templates in the format of name=value,name=value. You can also have multiple occurrences of this option\",\"anyOf\":[{\"type\":\"string\"},{\"type\":\"object\",\"additionalProperties\":true}]},\"packageName\":{\"type\":\"string\",\"description\":\"package for generated classes (where supported)\"},\"releaseNote\":{\"type\":\"string\",\"description\":\"release note, default to 'Minor update'\"},\"removeOperationIdPrefix\":{\"type\":\"boolean\",\"description\":\"remove prefix of operationId, e.g. config_getId => getId\"},\"reservedWordsMappings\":{\"anyOf\":[{\"type\":\"string\"},{\"type\":\"object\",\"additionalProperties\":true}],\"description\":\"specifies how a reserved name should be escaped to. Otherwise, the default _<name> is used. For example id=identifier. You can also have multiple occurrences of this option\"},\"skipOverwrite\":{\"type\":\"boolean\",\"description\":\"specifies if the existing files should be overwritten during the generation\"},\"serverVariables\":{\"anyOf\":[{\"type\":\"string\"},{\"type\":\"object\",\"additionalProperties\":true}],\"description\":\"sets server variables overrides for spec documents which support variable templating of servers\"},\"skipValidateSpec\":{\"type\":\"boolean\",\"description\":\"skips the default behavior of validating an input specification\"},\"strictSpec\":{\"type\":\"boolean\",\"description\":\"'MUST' and 'SHALL' wording in OpenAPI spec is strictly adhered to. e.g. when false, no fixes will be applied to documents which pass validation but don't follow the spec\"},\"templateDir\":{\"type\":\"string\",\"description\":\"folder containing the template files\"},\"typeMappings\":{\"anyOf\":[{\"type\":\"string\"},{\"type\":\"object\",\"additionalProperties\":true}],\"description\":\"sets mappings between OpenAPI spec types and generated code types in the format of OpenAPIType=generatedType,OpenAPIType=generatedType. For example: array=List,map=Map,string=String. You can also have multiple occurrences of this option\"},\"verbose\":{\"type\":\"boolean\",\"description\":\"verbose mode\"}}}}}");
983
1064
 
984
1065
  /***/ }),
985
1066
 
package/package.json CHANGED
@@ -27,11 +27,6 @@
27
27
  "publishConfig": {
28
28
  "registry": "https://registry.npmjs.org"
29
29
  },
30
- "husky": {
31
- "hooks": {
32
- "commit-msg": "commitlint -E HUSKY_GIT_PARAMS"
33
- }
34
- },
35
30
  "keywords": [
36
31
  "rest-api",
37
32
  "rest-client",
@@ -56,7 +51,7 @@
56
51
  "text": "Please sponsor OpenAPI Generator."
57
52
  }
58
53
  },
59
- "version": "2.4.25",
54
+ "version": "2.5.1",
60
55
  "name": "@openapitools/openapi-generator-cli",
61
56
  "description": "A npm package wrapper for OpenAPI Generator (https://github.com/OpenAPITools/openapi-generator), generates which API client libraries (SDK generation), server stubs, documentation and configuration automatically given an OpenAPI Spec (v2, v3)",
62
57
  "scripts": {
@@ -71,20 +66,20 @@
71
66
  "main.js"
72
67
  ],
73
68
  "dependencies": {
74
- "@nestjs/common": "8.2.5",
75
- "@nestjs/core": "8.2.5",
69
+ "@nestjs/common": "8.4.4",
70
+ "@nestjs/core": "8.4.4",
76
71
  "@nuxtjs/opencollective": "0.3.2",
77
72
  "chalk": "4.1.2",
78
73
  "commander": "8.3.0",
79
- "compare-versions": "3.6.0",
74
+ "compare-versions": "4.1.3",
80
75
  "concurrently": "6.5.1",
81
76
  "console.table": "0.10.0",
82
- "fs-extra": "10.0.0",
77
+ "fs-extra": "10.0.1",
83
78
  "glob": "7.1.6",
84
- "inquirer": "8.2.0",
79
+ "inquirer": "8.2.2",
85
80
  "lodash": "4.17.21",
86
81
  "reflect-metadata": "0.1.13",
87
- "rxjs": "7.5.2",
82
+ "rxjs": "7.5.5",
88
83
  "tslib": "2.0.3"
89
84
  }
90
85
  }