-
-
Notifications
You must be signed in to change notification settings - Fork 632
Closed
Labels
bugSomething isn't workingSomething isn't workingopenapi-tsRelevant to the openapi-typescript libraryRelevant to the openapi-typescript library
Description
Description
The OneOf function hits a call stack limit on larger unions (>8 entities).
| Name | Version |
|---|---|
openapi-typescript |
6.1.0 |
| Node.js | 19.1.0 |
| Typescript | 4.9.4 |
| OS + version | macOS 13 |
Reproduction
Visit this sandbox
Expected result
OneOf type handles larger arguments without issue
Actual result
OneOf type exceeds call stack limit after an array of size 8.
Checklist
- I’m willing to open a PR (see CONTRIBUTING.md)
Notes
I've done the following as a workaround, although I suspect this will lead to type inaccuracies.
type OneOf<T extends any[]> = T[number];Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workingopenapi-tsRelevant to the openapi-typescript libraryRelevant to the openapi-typescript library
