Skip to content

Commit 166b4a4

Browse files
committed
fix(libs): fix open api parsing
Open API file having nulls in them (typically in example payloads) were throwing errors
1 parent 60e3b5f commit 166b4a4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Diff for: packages/whook/src/libs/openapi.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ export function collectRefs(
7878
for (const item of node) {
7979
seenRefs = collectRefs(rootNode, item, seenRefs);
8080
}
81-
} else if (typeof node === 'object') {
81+
} else if (node !== null && typeof node === 'object') {
8282
const keys = Object.keys(node);
8383

8484
if (typeof node.$ref === 'string' && !seenRefs.includes(node.$ref)) {

0 commit comments

Comments
 (0)