ng-openapi 0.2.9 → 0.2.10-pr-53-bugfix-resolve-non-object-types-c28cad9.0

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.
Files changed (3) hide show
  1. package/cli.cjs +13 -2
  2. package/index.js +12 -1
  3. package/package.json +1 -1
package/cli.cjs CHANGED
@@ -44,7 +44,7 @@ var fs4 = __toESM(require("fs"));
44
44
  var path12 = __toESM(require("path"));
45
45
 
46
46
  // package.json
47
- var version = "0.2.8";
47
+ var version = "0.2.9";
48
48
 
49
49
  // src/lib/core/generator.ts
50
50
  var import_ts_morph7 = require("ts-morph");
@@ -620,8 +620,19 @@ var TypeGenerator = class {
620
620
  this.collectCompositeTypeStructure(interfaceName, definition);
621
621
  } else if (definition.items) {
622
622
  this.collectArrayTypeStructure(interfaceName, definition);
623
- } else {
623
+ } else if (definition.properties) {
624
624
  this.collectInterfaceStructure(interfaceName, definition);
625
+ } else {
626
+ const propertyType = this.resolveSwaggerTypeCached(definition);
627
+ this.statements.push({
628
+ kind: import_ts_morph.StructureKind.TypeAlias,
629
+ name: interfaceName,
630
+ isExported: true,
631
+ docs: definition.description ? [
632
+ definition.description
633
+ ] : void 0,
634
+ type: propertyType
635
+ });
625
636
  }
626
637
  }
627
638
  collectEnumStructure(name, definition) {
package/index.js CHANGED
@@ -736,8 +736,19 @@ var _TypeGenerator = class _TypeGenerator {
736
736
  this.collectCompositeTypeStructure(interfaceName, definition);
737
737
  } else if (definition.items) {
738
738
  this.collectArrayTypeStructure(interfaceName, definition);
739
- } else {
739
+ } else if (definition.properties) {
740
740
  this.collectInterfaceStructure(interfaceName, definition);
741
+ } else {
742
+ const propertyType = this.resolveSwaggerTypeCached(definition);
743
+ this.statements.push({
744
+ kind: import_ts_morph.StructureKind.TypeAlias,
745
+ name: interfaceName,
746
+ isExported: true,
747
+ docs: definition.description ? [
748
+ definition.description
749
+ ] : void 0,
750
+ type: propertyType
751
+ });
741
752
  }
742
753
  }
743
754
  collectEnumStructure(name, definition) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ng-openapi",
3
- "version": "0.2.9",
3
+ "version": "0.2.10-pr-53-bugfix-resolve-non-object-types-c28cad9.0",
4
4
  "description": "Generate Angular services and TypeScript types from OpenAPI/Swagger specifications",
5
5
  "keywords": [
6
6
  "ng-openapi",