diff --git a/src/commands/generate/models.ts b/src/commands/generate/models.ts index 8a81b0ecd4e..1915279e33e 100644 --- a/src/commands/generate/models.ts +++ b/src/commands/generate/models.ts @@ -32,6 +32,7 @@ export default class Models extends Command { const inputFile = (await load(file)) || (await load()); const { document, diagnostics ,status } = await parse(this, inputFile, flags); + if (!document || status === 'invalid') { const severityErrors = diagnostics.filter((obj) => obj.severity === 0); this.log(`Input is not a correct AsyncAPI document so it cannot be processed.${formatOutput(severityErrors,'stylish','error')}`);