@openapitools/openapi-generator-cli 2.4.26 → 2.5.2

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,12 +4,13 @@
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
11
10
  configuration automatically given an OpenAPI Spec (both 2.0 and 3.0 are supported). Please see
12
- [OpenAPITools/openapi-generator](https://github.com/OpenAPITools/openapi-generator)
11
+ [OpenAPITools/openapi-generator](https://github.com/OpenAPITools/openapi-generator).
12
+
13
+ The OpenAPI Generator is a Java project. `openapi-generator-cli` will download the approprate JAR file and invoke the `java` executable to run the OpenAPI Generator. You must have the `java` binary executable available on your `PATH` for this to work.
13
14
 
14
15
  ---
15
16
 
@@ -173,6 +174,26 @@ is automatically used to generate your code. 🎉
173
174
  | relPath | file name and extension of file relative to the glob provided | docs/auth.yaml |
174
175
  | ext | just file extension | yaml |
175
176
 
177
+ ### Using custom / private maven registry
178
+
179
+ If you're using a private maven registry you can configure the `downloadUrl` and `queryUrl` like this:
180
+
181
+ ```json
182
+ {
183
+ "$schema": "node_modules/@openapitools/openapi-generator-cli/config.schema.json",
184
+ "spaces": 2,
185
+ "generator-cli": {
186
+ "version": "5.3.0",
187
+ "repository": {
188
+ "queryUrl": "https://private.maven.intern/solrsearch/select?q=g:${group.id}+AND+a:${artifact.id}&core=gav&start=0&rows=200",
189
+ "downloadUrl": "https://private.maven.intern/maven2/${groupId}/${artifactId}/${versionName}/${artifactId}-${versionName}.jar"
190
+ }
191
+ }
192
+ }
193
+ ```
194
+
195
+ If the `version` property param is set it is not necessary to configure the `queryUrl`.
196
+
176
197
  ## Run specific generators
177
198
 
178
199
  | cmd | v3.0 runs | v2.0 runs |
@@ -181,6 +202,18 @@ is automatically used to generate your code. 🎉
181
202
  | openapi-generator-cli generate --generator-key v3.0 v2.0 | yes | yes |
182
203
  | openapi-generator-cli generate --generator-key foo | no | no |
183
204
 
205
+ ## Use Docker instead of running java locally
206
+
207
+ ```json
208
+ {
209
+ "$schema": "node_modules/@openapitools/openapi-generator-cli/config.schema.json",
210
+ "spaces": 2,
211
+ "generator-cli": {
212
+ "useDocker": true
213
+ }
214
+ }
215
+ ```
216
+
184
217
  ## Custom Generators
185
218
 
186
219
  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,17 @@ __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 os__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! os */ "os");
407
+ /* harmony import */ var os__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(os__WEBPACK_IMPORTED_MODULE_8__);
408
+ /* harmony import */ var _version_manager_service__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./version-manager.service */ "./apps/generator-cli/src/app/services/version-manager.service.ts");
409
+ /* harmony import */ var _config_service__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./config.service */ "./apps/generator-cli/src/app/services/config.service.ts");
410
+ /* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../constants */ "./apps/generator-cli/src/app/constants/index.ts");
401
411
  var _a, _b, _c;
402
412
 
403
413
 
@@ -409,6 +419,8 @@ var _a, _b, _c;
409
419
 
410
420
 
411
421
 
422
+
423
+
412
424
  let GeneratorService = class GeneratorService {
413
425
  constructor(logger, configService, versionManager) {
414
426
  this.logger = logger;
@@ -416,15 +428,35 @@ let GeneratorService = class GeneratorService {
416
428
  this.versionManager = versionManager;
417
429
  this.configPath = 'generator-cli.generators';
418
430
  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(' ');
431
+ this.cmd = (customGenerator, appendix, dockerVolumes = {}) => {
432
+ if (this.configService.useDocker) {
433
+ const volumes = Object.entries(dockerVolumes).map(([k, v]) => `-v "${v}:${k}"`).join(' ');
434
+ const userInfo = os__WEBPACK_IMPORTED_MODULE_8__["userInfo"]();
435
+ const userArg = userInfo.uid !== -1 ? `--user ${userInfo.uid}:${userInfo.gid}` : ``;
436
+ return [
437
+ `docker run --rm`,
438
+ userArg,
439
+ volumes,
440
+ this.versionManager.getDockerImageName(),
441
+ 'generate',
442
+ appendix
443
+ ].join(' ');
444
+ }
445
+ const cliPath = this.versionManager.filePath();
446
+ const subCmd = customGenerator
447
+ ? `-cp "${[cliPath, customGenerator].join(this.isWin() ? ';' : ':')}" org.openapitools.codegen.OpenAPIGenerator`
448
+ : `-jar "${cliPath}"`;
449
+ return [
450
+ 'java',
451
+ process.env['JAVA_OPTS'],
452
+ subCmd,
453
+ 'generate',
454
+ appendix,
455
+ ].filter(lodash__WEBPACK_IMPORTED_MODULE_2__["isString"]).join(' ');
456
+ };
457
+ this.isWin = () => process.platform === "win32";
426
458
  }
427
- generate(...keys) {
459
+ generate(customGenerator, ...keys) {
428
460
  return Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__awaiter"])(this, void 0, void 0, function* () {
429
461
  const cwd = this.configService.cwd;
430
462
  const generators = Object.entries(this.configService.get(this.configPath, {}));
@@ -432,13 +464,13 @@ let GeneratorService = class GeneratorService {
432
464
  .filter(([key, { disabled }]) => {
433
465
  if (!disabled)
434
466
  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`));
467
+ this.logger.log(chalk__WEBPACK_IMPORTED_MODULE_7__["grey"](`[info] Skip ${chalk__WEBPACK_IMPORTED_MODULE_7__["yellow"](key)}, because this generator is disabled`));
436
468
  return false;
437
469
  })
438
470
  .filter(([key]) => {
439
471
  if (!keys.length || keys.includes(key))
440
472
  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`));
473
+ 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
474
  return false;
443
475
  });
444
476
  const globsWithNoMatches = [];
@@ -448,16 +480,16 @@ let GeneratorService = class GeneratorService {
448
480
  if (!globPattern) {
449
481
  return [{
450
482
  name: `[${name}] ${params.inputSpec}`,
451
- command: this.buildCommand(cwd, params)
483
+ command: this.buildCommand(cwd, params, customGenerator)
452
484
  }];
453
485
  }
454
- const specFiles = glob__WEBPACK_IMPORTED_MODULE_5__["sync"](globPattern, { cwd });
486
+ const specFiles = glob__WEBPACK_IMPORTED_MODULE_6__["sync"](globPattern, { cwd });
455
487
  if (specFiles.length < 1) {
456
488
  globsWithNoMatches.push(globPattern);
457
489
  }
458
- return glob__WEBPACK_IMPORTED_MODULE_5__["sync"](globPattern, { cwd }).map(spec => ({
490
+ return glob__WEBPACK_IMPORTED_MODULE_6__["sync"](globPattern, { cwd }).map(spec => ({
459
491
  name: `[${name}] ${spec}`,
460
- command: this.buildCommand(cwd, params, spec)
492
+ command: this.buildCommand(cwd, params, customGenerator, spec)
461
493
  }));
462
494
  }));
463
495
  const generated = commands.length > 0 && (yield (() => Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__awaiter"])(this, void 0, void 0, function* () {
@@ -470,7 +502,7 @@ let GeneratorService = class GeneratorService {
470
502
  return false;
471
503
  }
472
504
  }))());
473
- globsWithNoMatches.map(g => this.logger.log(chalk__WEBPACK_IMPORTED_MODULE_6__["yellow"](`[warn] Did not found any file matching glob "${g}"`)));
505
+ globsWithNoMatches.map(g => this.logger.log(chalk__WEBPACK_IMPORTED_MODULE_7__["yellow"](`[warn] Did not found any file matching glob "${g}"`)));
474
506
  return generated;
475
507
  });
476
508
  }
@@ -478,13 +510,27 @@ let GeneratorService = class GeneratorService {
478
510
  this.logger.log(Object(lodash__WEBPACK_IMPORTED_MODULE_2__["sortBy"])(res, 'command.name').map(({ exitCode, command }) => {
479
511
  const failed = exitCode > 0;
480
512
  return [
481
- chalk__WEBPACK_IMPORTED_MODULE_6__[failed ? 'red' : 'green'](command.name),
482
- ...(failed ? [chalk__WEBPACK_IMPORTED_MODULE_6__["yellow"](` ${command.command}\n`)] : []),
513
+ chalk__WEBPACK_IMPORTED_MODULE_7__[failed ? 'red' : 'green'](command.name),
514
+ ...(failed ? [chalk__WEBPACK_IMPORTED_MODULE_7__["yellow"](` ${command.command}\n`)] : []),
483
515
  ].join('\n');
484
516
  }).join('\n'));
485
517
  }
486
- buildCommand(cwd, params, specFile) {
518
+ buildCommand(cwd, params, customGenerator, specFile) {
519
+ const dockerVolumes = {};
487
520
  const absoluteSpecPath = specFile ? path__WEBPACK_IMPORTED_MODULE_4__["resolve"](cwd, specFile) : String(params.inputSpec);
521
+ const ext = path__WEBPACK_IMPORTED_MODULE_4__["extname"](absoluteSpecPath);
522
+ const name = path__WEBPACK_IMPORTED_MODULE_4__["basename"](absoluteSpecPath, ext);
523
+ const placeholders = {
524
+ name,
525
+ Name: Object(lodash__WEBPACK_IMPORTED_MODULE_2__["upperFirst"])(name),
526
+ cwd,
527
+ base: path__WEBPACK_IMPORTED_MODULE_4__["basename"](absoluteSpecPath),
528
+ dir: specFile && path__WEBPACK_IMPORTED_MODULE_4__["dirname"](absoluteSpecPath),
529
+ path: absoluteSpecPath,
530
+ relDir: specFile && path__WEBPACK_IMPORTED_MODULE_4__["dirname"](specFile),
531
+ relPath: specFile,
532
+ ext: ext.split('.').slice(-1).pop()
533
+ };
488
534
  const command = Object.entries(Object.assign({ inputSpec: absoluteSpecPath }, params)).map(([k, v]) => {
489
535
  const key = Object(lodash__WEBPACK_IMPORTED_MODULE_2__["kebabCase"])(k);
490
536
  const value = (() => {
@@ -497,35 +543,35 @@ let GeneratorService = class GeneratorService {
497
543
  case 'boolean':
498
544
  return undefined;
499
545
  default:
546
+ if (this.configService.useDocker) {
547
+ v = this.replacePlaceholders(placeholders, v);
548
+ if (key === 'output') {
549
+ fs_extra__WEBPACK_IMPORTED_MODULE_5__["ensureDirSync"](v);
550
+ }
551
+ if (fs_extra__WEBPACK_IMPORTED_MODULE_5__["existsSync"](v)) {
552
+ dockerVolumes[`/local/${key}`] = path__WEBPACK_IMPORTED_MODULE_4__["resolve"](cwd, v);
553
+ return `"/local/${key}"`;
554
+ }
555
+ }
500
556
  return `"${v}"`;
501
557
  }
502
558
  })();
503
559
  return value === undefined ? `--${key}` : `--${key}=${value}`;
504
560
  }).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)
561
+ return this.cmd(customGenerator, this.replacePlaceholders(placeholders, command), dockerVolumes);
562
+ }
563
+ replacePlaceholders(placeholders, input) {
564
+ return Object.entries(placeholders)
519
565
  .filter(([, replacement]) => !!replacement)
520
- .reduce((cmd, [search, replacement]) => {
521
- return cmd.split(`#{${search}}`).join(replacement);
522
- }, command));
566
+ .reduce((acc, [search, replacement]) => {
567
+ return acc.split(`#{${search}}`).join(replacement);
568
+ }, input);
523
569
  }
524
570
  };
525
571
  GeneratorService = Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([
526
572
  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])
573
+ Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__param"])(0, Object(_nestjs_common__WEBPACK_IMPORTED_MODULE_1__["Inject"])(_constants__WEBPACK_IMPORTED_MODULE_11__["LOGGER"])),
574
+ Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__metadata"])("design:paramtypes", [typeof (_a = typeof _constants__WEBPACK_IMPORTED_MODULE_11__["LOGGER"] !== "undefined" && _constants__WEBPACK_IMPORTED_MODULE_11__["LOGGER"]) === "function" ? _a : Object, typeof (_b = typeof _config_service__WEBPACK_IMPORTED_MODULE_10__["ConfigService"] !== "undefined" && _config_service__WEBPACK_IMPORTED_MODULE_10__["ConfigService"]) === "function" ? _b : Object, typeof (_c = typeof _version_manager_service__WEBPACK_IMPORTED_MODULE_9__["VersionManagerService"] !== "undefined" && _version_manager_service__WEBPACK_IMPORTED_MODULE_9__["VersionManagerService"]) === "function" ? _c : Object])
529
575
  ], GeneratorService);
530
576
 
531
577
 
@@ -590,7 +636,9 @@ __webpack_require__.r(__webpack_exports__);
590
636
  /* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../constants */ "./apps/generator-cli/src/app/constants/index.ts");
591
637
  /* harmony import */ var _generator_service__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./generator.service */ "./apps/generator-cli/src/app/services/generator.service.ts");
592
638
  /* 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;
639
+ /* harmony import */ var _config_service__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./config.service */ "./apps/generator-cli/src/app/services/config.service.ts");
640
+ var _a, _b, _c, _d, _e;
641
+
594
642
 
595
643
 
596
644
 
@@ -601,10 +649,11 @@ var _a, _b, _c, _d;
601
649
 
602
650
 
603
651
  let PassThroughService = class PassThroughService {
604
- constructor(logger, program, versionManager, generatorService) {
652
+ constructor(logger, program, versionManager, configService, generatorService) {
605
653
  this.logger = logger;
606
654
  this.program = program;
607
655
  this.versionManager = versionManager;
656
+ this.configService = configService;
608
657
  this.generatorService = generatorService;
609
658
  this.passThrough = (cmd) => {
610
659
  const args = [cmd.name(), ...cmd.args];
@@ -670,11 +719,13 @@ let PassThroughService = class PassThroughService {
670
719
  commands.get('generate')
671
720
  .option("--generator-key <generator...>", "Run generator by key. Separate by comma to run many generators")
672
721
  .action((_, cmd) => Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__awaiter"])(this, void 0, void 0, function* () {
722
+ var _a;
673
723
  if (cmd.args.length === 0 || cmd.opts().generatorKey) {
724
+ const customGenerator = (_a = this.program.opts()) === null || _a === void 0 ? void 0 : _a.customGenerator;
674
725
  const generatorKeys = cmd.opts().generatorKey || [];
675
726
  if (this.generatorService.enabled) {
676
727
  // @todo cover by unit test
677
- if (!(yield this.generatorService.generate(...generatorKeys))) {
728
+ if (!(yield this.generatorService.generate(customGenerator, ...generatorKeys))) {
678
729
  this.logger.log(chalk__WEBPACK_IMPORTED_MODULE_2__["red"]('Code generation failed'));
679
730
  process.exit(1);
680
731
  }
@@ -687,6 +738,12 @@ let PassThroughService = class PassThroughService {
687
738
  }
688
739
  cmd() {
689
740
  var _a;
741
+ if (this.configService.useDocker) {
742
+ return [
743
+ `docker run --rm -v "${this.configService.cwd}:/local"`,
744
+ this.versionManager.getDockerImageName(),
745
+ ].join(' ');
746
+ }
690
747
  const customGenerator = (_a = this.program.opts()) === null || _a === void 0 ? void 0 : _a.customGenerator;
691
748
  const cliPath = this.versionManager.filePath();
692
749
  const subCmd = customGenerator
@@ -702,7 +759,7 @@ PassThroughService = Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([
702
759
  Object(_nestjs_common__WEBPACK_IMPORTED_MODULE_1__["Injectable"])(),
703
760
  Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__param"])(0, Object(_nestjs_common__WEBPACK_IMPORTED_MODULE_1__["Inject"])(_constants__WEBPACK_IMPORTED_MODULE_6__["LOGGER"])),
704
761
  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])
762
+ 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
763
  ], PassThroughService);
707
764
 
708
765
 
@@ -813,6 +870,8 @@ __webpack_require__.r(__webpack_exports__);
813
870
  /* harmony import */ var _config_service__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./config.service */ "./apps/generator-cli/src/app/services/config.service.ts");
814
871
  /* harmony import */ var _config_schema_json__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../../config.schema.json */ "./apps/generator-cli/src/config.schema.json");
815
872
  var _config_schema_json__WEBPACK_IMPORTED_MODULE_11___namespace = /*#__PURE__*/__webpack_require__.t(/*! ../../config.schema.json */ "./apps/generator-cli/src/config.schema.json", 1);
873
+ /* harmony import */ var child_process__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! child_process */ "child_process");
874
+ /* harmony import */ var child_process__WEBPACK_IMPORTED_MODULE_12___default = /*#__PURE__*/__webpack_require__.n(child_process__WEBPACK_IMPORTED_MODULE_12__);
816
875
  var _a, _b, _c;
817
876
 
818
877
 
@@ -826,6 +885,7 @@ var _a, _b, _c;
826
885
 
827
886
 
828
887
 
888
+
829
889
  const mvn = {
830
890
  repo: 'https://search.maven.org',
831
891
  groupId: 'org.openapitools',
@@ -874,6 +934,9 @@ let VersionManagerService = class VersionManagerService {
874
934
  getSelectedVersion() {
875
935
  return this.configService.get('generator-cli.version');
876
936
  }
937
+ getDockerImageName(versionName) {
938
+ return `${this.configService.dockerImageName}:v${versionName || this.getSelectedVersion()}`;
939
+ }
877
940
  setSelectedVersion(versionName) {
878
941
  return Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__awaiter"])(this, void 0, void 0, function* () {
879
942
  const downloaded = yield this.downloadIfNeeded(versionName);
@@ -885,13 +948,33 @@ let VersionManagerService = class VersionManagerService {
885
948
  }
886
949
  remove(versionName) {
887
950
  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));
951
+ if (this.configService.useDocker) {
952
+ yield new Promise(resolve => {
953
+ Object(child_process__WEBPACK_IMPORTED_MODULE_12__["spawn"])('docker', ['rmi', this.getDockerImageName(versionName)], {
954
+ stdio: 'inherit',
955
+ shell: true
956
+ }).on('exit', () => resolve());
957
+ });
958
+ }
959
+ else {
960
+ fs_extra__WEBPACK_IMPORTED_MODULE_4__["removeSync"](this.filePath(versionName));
961
+ }
889
962
  this.logger.log(chalk__WEBPACK_IMPORTED_MODULE_7__["green"](`Removed ${versionName}`));
890
963
  });
891
964
  }
892
965
  download(versionName) {
893
966
  return Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__awaiter"])(this, void 0, void 0, function* () {
894
967
  this.logger.log(chalk__WEBPACK_IMPORTED_MODULE_7__["yellow"](`Download ${versionName} ...`));
968
+ if (this.configService.useDocker) {
969
+ yield new Promise(resolve => {
970
+ Object(child_process__WEBPACK_IMPORTED_MODULE_12__["spawn"])('docker', ['pull', this.getDockerImageName(versionName)], {
971
+ stdio: 'inherit',
972
+ shell: true
973
+ }).on('exit', () => resolve());
974
+ });
975
+ this.logger.log(chalk__WEBPACK_IMPORTED_MODULE_7__["green"](`Downloaded ${versionName}`));
976
+ return;
977
+ }
895
978
  const downloadLink = this.createDownloadLink(versionName);
896
979
  const filePath = this.filePath(versionName);
897
980
  try {
@@ -929,6 +1012,10 @@ let VersionManagerService = class VersionManagerService {
929
1012
  });
930
1013
  }
931
1014
  isDownloaded(versionName) {
1015
+ if (this.configService.useDocker) {
1016
+ const { status } = Object(child_process__WEBPACK_IMPORTED_MODULE_12__["spawnSync"])('docker', ['image', 'inspect', this.getDockerImageName(versionName)]);
1017
+ return status === 0;
1018
+ }
932
1019
  return fs_extra__WEBPACK_IMPORTED_MODULE_4__["existsSync"](path__WEBPACK_IMPORTED_MODULE_5__["resolve"](this.storage, `${versionName}.jar`));
933
1020
  }
934
1021
  filterVersionsByTags(versions, tags) {
@@ -979,7 +1066,7 @@ VersionManagerService = Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])
979
1066
  /*! exports provided: $id, $schema, title, type, required, additionalProperties, properties, definitions, default */
980
1067
  /***/ (function(module) {
981
1068
 
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\"}}}}}");
1069
+ 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
1070
 
984
1071
  /***/ }),
985
1072
 
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.26",
54
+ "version": "2.5.2",
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.6",
75
- "@nestjs/core": "8.2.6",
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
  }