From 34e590aba41a9ce4553b08d4f8bb479cd40b419d Mon Sep 17 00:00:00 2001 From: souvik Date: Fri, 12 Jul 2024 11:09:15 +0530 Subject: [PATCH] Update models.ts --- src/commands/generate/models.ts | 1 + 1 file changed, 1 insertion(+) 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')}`);