Support for multiple return types
Jefftree opened this issue · comments
Jeffrey Ying commented
Is there any plan to support an endpoint capable of returning multiple return types? Eg: a ws.Route(...).Writes(TypeA{}}, TypeB{})
Ernest Micklei commented
can you explain the usecase? does the OpenAPI also support this?
Jeffrey Ying commented
OpenAPI V3 supports returning a oneOf (https://swagger.io/specification/#discriminator-object). Kubernetes has endpoints that could return one of multiple values and I think it'd be useful if the WebService object could express that as well.
Ernest Micklei commented
thanks @Jefftree , I will look into the required changes
Ernest Micklei commented
@Jefftree , did you have a look at the PR?
Jeffrey Ying commented
Thanks for the addition, will test it out this week but marking this as closed for now.