go - Swagger OpenAPI 2: Cannot remove model (struct) from models list - Stack Overflow

Using swaggoswag package for GoLangI need the SignOutRequest model to disappear from the list of mode

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条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信