Skip to content

Commit 1e6f5cf

Browse files
authored
Merge pull request #817 from BitGo/merge-bug
fix: fix merging unions of undefined schemas
2 parents f40acb5 + 1dd7901 commit 1e6f5cf

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

packages/openapi-generator/src/optimize.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,9 @@ function mergeUnions(schema: Schema): Schema {
6868

6969
return {
7070
type: 'union',
71-
schemas: Array.from(resultingSchemas).map((s) => JSON.parse(s)),
71+
schemas: Array.from(resultingSchemas)
72+
.filter((s) => s != undefined)
73+
.map((s) => JSON.parse(s)),
7274
};
7375
}
7476

0 commit comments

Comments
 (0)