You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Do you have a new or modified API suggestion to solve the problem?
I'll skip that test for now, and leave it as a known issue, but it would be great if it would be possible to concat into alternatives.
Alternatives
I suspect I could probably come up with a way to detect definitions of this nature, and basically re-write / invert them such that it was a union of intersections, instead of an intersected union. Eg:
(A&C)|(A&C)
But I think this would probably be quite complicated to do correctly supporting arbitrary input.
The text was updated successfully, but these errors were encountered:
Runtime
node.js
Runtime version
22
Module version
17.13.3
Used with
@nahkies/openapi-code-generator
Any other relevant information
No response
What problem are you trying to solve?
Related: mnahkies/openapi-code-generator#282
In openapi 3 definitions you can intersect schemas with unioned schemas, essentially forming something like this in typescript terms:
At the moment the generator attempts to define this as something like:
However this results in a runtime error like:
(unit test here)
Do you have a new or modified API suggestion to solve the problem?
I'll skip that test for now, and leave it as a known issue, but it would be great if it would be possible to
concat
intoalternatives
.Alternatives
I suspect I could probably come up with a way to detect definitions of this nature, and basically re-write / invert them such that it was a union of intersections, instead of an intersected union. Eg:
But I think this would probably be quite complicated to do correctly supporting arbitrary input.
The text was updated successfully, but these errors were encountered: