-
Notifications
You must be signed in to change notification settings - Fork 73
Description
There are several method specific parameters when creating unions.
It would enhance DX if those are only available when the respective method is chosen (defined using the method param).
This is a perfect usecase for discriminated unions.
The advantages are clear: Instead of being optional params, the specific params would become required for the respective method.
There would also be a little less clutter in the list of common params.
There are two things to clear up before:
-
The
methodparam can also be an array of methods.
How would this work here? Can I provide params for multiple methods?
Or are these methods not intended to be used in conjunction with others? -
The docs page is currently unclear about which params are optional and which required when using the respective method. This will need to be clarified.