Using swaggo/swag package for GoLang
I need the SignOutRequest model to disappear from the list of models in the inner part of the Swagger page, but the model description remains in this place (I don't know what it's called):
I have types/user.go file with this struct:
type SignOutRequest struct {
RefreshToken string `json:"refresh_token"`
}
also I have http-server/user.go file with this swagger code:
// @Summary SignOut
// @Tags Auth
// @Description delete refresh token
// @ID delete-refresh-tokens
// @Accept json
// @Produce json
// @Param input body SignOutRequest true "deletes refresh_tokens"
// @Success 200 {object} Response
// @Failure 400,404 {object} Response
// @Failure 500 {object} Response
// @Failure default {object} Response
// @Router /api/auth/sign-out [post]
How to remove this from the model list?
I tried this in the user types file:
//go:build swaggo_ignore
// +build swaggo_ignore
also I tried to add
swaggerignore:true
to the field, like this:
RefreshToken string `json:"refresh_token"`
but this just removes field from the UI, the model is still remaining:
发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745237661a4617985.html
评论列表(0条)