iris-contrib / swagger

Iris middleware to automatically generate RESTful API documentation with Swagger 2.0
MIT License
115 stars 32 forks source link

How to configure swagger comments with iris using mvc #12

Open vperson opened 3 years ago

vperson commented 3 years ago
....
    mvc.Configure(app.Party("/api/v1"), func(m *mvc.Application) {
        m.Party("/test").Handle(new(v1.Test))
        m.Party("/xiaomai").Handle(new(v1.XiaoMai))
    })
.....
type XiaoMai  struct {
    Ctx iris.Context
}

// @Summary
// @Produce json
// @Param text string true "text"
// @Success 200 {object} restful.JsonResult
// @Failure 500 {object} restful.JsonResult
// @Router /api/v1/tiktok/parse/video
func (t *XiaoMai) PostParseVideo() *restful.JsonResult {
......
......
}
argjentsahiti commented 2 years ago

This is needed because mvc is not currently supported by this package