Skip to content

Commit 1dd7901

Browse files
committed
fix: fix merging unions of undefined schemas
DX-501
1 parent f40acb5 commit 1dd7901

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)