I am using gin-swagger for generating API document.
It shows Models
at the bottom of the page list by default.
How to hide it?
I am using gin-swagger for generating API document.
It shows Models
at the bottom of the page list by default.
How to hide it?
I met the same issue before, I removed one annotation in comment and Models gone. But I could not remember the name of annotation, however, you can compare your annotaions with below and remove the additional one.
// @Summary Get all users
// @Description Get all users
// @Tags UserMgt
// @Accept json
// @Produce json
// @Param filter body object{UserFilter} true "filter"
// @Success 200 {array} object{models.User} "users"
// @Failure 400 {object} object{models.User} "users not found"
// @Router /user/all [post]
// @Security ApiKeyAuth
func GetAllUsers(ctx *gin.Context) {
....omitted....
}
You juste have to add this line
ginSwagger.DefaultModelsExpandDepth(-1))
like that
ginSwagger.WrapHandler(swaggerFiles.Handler,
ginSwagger.DefaultModelsExpandDepth(-1))