Skip to content

Commit

Permalink
update generator service
Browse files Browse the repository at this point in the history
  • Loading branch information
magicmatatjahu committed Jan 20, 2022
1 parent b231b50 commit 82c94e9
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/services/generator.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,10 @@ export class GeneratorService {

if (typeof asyncapi === 'string') {
await generator.generateFromString(asyncapi, parserOptions);
} else {
await generator.generate(asyncapi, parserOptions);
} else if (asyncapi instanceof AsyncAPIDocument) {
await generator.generate(asyncapi);
} else { // object case
await generator.generateFromString(JSON.stringify(asyncapi), parserOptions);
}
}
}

0 comments on commit 82c94e9

Please sign in to comment.