Skip to content

Commit

Permalink
Merge pull request #817 from BitGo/merge-bug
Browse files Browse the repository at this point in the history
fix: fix merging unions of undefined schemas
  • Loading branch information
ad-world authored Jul 2, 2024
2 parents f40acb5 + 1dd7901 commit 1e6f5cf
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/openapi-generator/src/optimize.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,9 @@ function mergeUnions(schema: Schema): Schema {

return {
type: 'union',
schemas: Array.from(resultingSchemas).map((s) => JSON.parse(s)),
schemas: Array.from(resultingSchemas)
.filter((s) => s != undefined)
.map((s) => JSON.parse(s)),
};
}

Expand Down

0 comments on commit 1e6f5cf

Please sign in to comment.