Skip to content

Commit 6ad5541

Browse files
committed
fix: 优化对 openapi 标识符的判断
1 parent f6968c4 commit 6ad5541

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/printer/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ export class Printer {
4343
) {
4444
const { openapi } = document;
4545

46+
if (!openapi) throw new Error(`未找到 openapi 版本号`);
4647
if (!openapi.startsWith('3.')) throw new Error(`当前仅支持 openapi 3.x,当前版本为 ${openapi}`);
4748

4849
this.registerComponents();

0 commit comments

Comments
 (0)