Skip to content

Commit 475066d

Browse files
authored
Merge pull request #1196 from hey-api/chore/experimental-parser-return
chore: check if ir was generated
2 parents 598028a + 0edcd68 commit 475066d

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

packages/openapi-ts/src/openApi/index.ts

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,15 +78,21 @@ export const parseExperimental = ({
7878
switch (context.spec.openapi) {
7979
case '3.0.3':
8080
parseV3_0_3(context as IRContext<OpenApiV3_0_3>);
81-
return context;
81+
break;
8282
case '3.1.0':
8383
parseV3_1_0(context as IRContext<OpenApiV3_1_0>);
84-
return context;
84+
break;
8585
default:
8686
// TODO: parser - uncomment after removing legacy parser.
8787
// For now, we fall back to legacy parser if spec version
8888
// is not supported
8989
// throw new Error('Unsupported OpenAPI specification');
90-
return;
90+
break;
9191
}
92+
93+
if (!Object.keys(context.ir).length) {
94+
return;
95+
}
96+
97+
return context;
9298
};

0 commit comments

Comments
 (0)