emicklei / go-restful

package for building REST-style Web Services using Go

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Support for multiple return types

Jefftree opened this issue · comments

Is there any plan to support an endpoint capable of returning multiple return types? Eg: a ws.Route(...).Writes(TypeA{}}, TypeB{})

can you explain the usecase? does the OpenAPI also support this?

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.

thanks @Jefftree , I will look into the required changes

@Jefftree , did you have a look at the PR?

Thanks for the addition, will test it out this week but marking this as closed for now.