Skip to content

Commit

Permalink
Generate models referenced only by oneOf
Browse files Browse the repository at this point in the history
Fixes #24
Fixes #28
  • Loading branch information
Luis Fernando Planella Gonzalez committed Jul 26, 2019
1 parent 75ca471 commit cc1b58e
Show file tree
Hide file tree
Showing 3 changed files with 255 additions and 218 deletions.
1 change: 1 addition & 0 deletions lib/ng-openapi-gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,7 @@ export class NgOpenApiGen {
const result: string[] = [];
(schema.allOf || []).forEach(s => Array.prototype.push.apply(result, this.allReferencedNames(s)));
(schema.anyOf || []).forEach(s => Array.prototype.push.apply(result, this.allReferencedNames(s)));
(schema.oneOf || []).forEach(s => Array.prototype.push.apply(result, this.allReferencedNames(s)));
if (schema.properties) {
for (const prop of Object.keys(schema.properties)) {
Array.prototype.push.apply(result, this.allReferencedNames(schema.properties[prop]));
Expand Down
Loading

0 comments on commit cc1b58e

Please sign in to comment.