Closed StephanoGeorge closed 1 year ago
https://swagger.io/docs/specification/data-models/oneof-anyof-allof-not/
For example:
type Response struct { Data any } func test(c *gin.Context) { switch c.Param("type") { case "string": c.JSON(http.StatusOK, Response{Data: String{...}}) return case "int": c.JSON(http.StatusOK, Response{Data: Int{...}}) return default: } }
Thanks!
Sorry for wrong repo
https://swagger.io/docs/specification/data-models/oneof-anyof-allof-not/
For example:
Thanks!