ng-openapi 0.0.41-pr-8-feature-url-support-7d492ee.0 → 0.0.41

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/cli.cjs CHANGED
@@ -39,9 +39,9 @@ var SwaggerParser = class _SwaggerParser {
39
39
  }
40
40
  spec;
41
41
  constructor(spec, config) {
42
- const generateClient = config.generateClientIf?.(spec) ?? true;
43
- if (!generateClient) {
44
- throw new Error("Client generation is disabled by configuration. Check your `generateClientIf` condition.");
42
+ const isInputValid = config.validateInput?.(spec) ?? true;
43
+ if (!isInputValid) {
44
+ throw new Error("Swagger spec is not valid. Check your `validateInput` condition.");
45
45
  }
46
46
  this.spec = spec;
47
47
  }
package/index.d.ts CHANGED
@@ -137,7 +137,7 @@ interface GeneratorConfig {
137
137
  input: string;
138
138
  output: string;
139
139
  clientName?: string;
140
- generateClientIf?: (swaggerSpec: SwaggerSpec) => boolean;
140
+ validateInput?: (spec: SwaggerSpec) => boolean;
141
141
  options: {
142
142
  dateType: "string" | "Date";
143
143
  enumStyle: "enum" | "union";
package/index.js CHANGED
@@ -86,9 +86,9 @@ var _SwaggerParser = class _SwaggerParser {
86
86
  constructor(spec, config) {
87
87
  __publicField(this, "spec");
88
88
  var _a, _b;
89
- const generateClient = (_b = (_a = config.generateClientIf) == null ? void 0 : _a.call(config, spec)) != null ? _b : true;
90
- if (!generateClient) {
91
- throw new Error("Client generation is disabled by configuration. Check your `generateClientIf` condition.");
89
+ const isInputValid = (_b = (_a = config.validateInput) == null ? void 0 : _a.call(config, spec)) != null ? _b : true;
90
+ if (!isInputValid) {
91
+ throw new Error("Swagger spec is not valid. Check your `validateInput` condition.");
92
92
  }
93
93
  this.spec = spec;
94
94
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ng-openapi",
3
- "version": "0.0.41-pr-8-feature-url-support-7d492ee.0",
3
+ "version": "0.0.41",
4
4
  "description": "Generate Angular services and TypeScript types from OpenAPI/Swagger specifications",
5
5
  "keywords": [
6
6
  "angular",