-
Notifications
You must be signed in to change notification settings - Fork 512
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support for discriminated unions #240
Comments
I've run into this issue today. Is there any planned fix? |
@lukeautry may I ask you for kind support so that I can implement it my own? I'm not familiar with reflection in typescript |
I'm not really familiar with reflection either nor with the enum implementation in tsoa and why it uses purely strings. It seems to me though, like a clean implementation would involve extending
Then, if there is a That would then also involve adding a Are you up for that @AmazingTurtle? I can also try to help. |
@endor I'm up for it. I would give it a shot then. I'm wondering if it is compliant to OpenAPI specs as well? |
At least in 3.0.0 it seems to be supported: https://swagger.io/docs/specification/data-models/inheritance-and-polymorphism/. Might be a good idea to go forward with the 3.0.0 implementation efforts (: |
@AmazingTurtle @endor Hey, is this still being worked on? |
Union types are being tracked under #393 so we’ll close this and track the feature there. |
@adrianplavka, @strongpauly, @AmazingTurtle, I'm happy to report that the we added our first draft of unions and intersections in v2.4.11. Please consider upgrading to it and let us know how it works for you. We would appreciate the feedback. :) Please note: you must have config.swagger.specVersion set to 3 for this to work since oneOf and allOf are not supported in Swagger (but they are in OpenAPI 3.0). |
This is an absolute must have feature!
You can't use
TsoaModel
as@RequestBody
or response type.http://www.typescriptlang.org/docs/handbook/advanced-types.html#discriminated-unions
The text was updated successfully, but these errors were encountered: