admin管理员组

文章数量:1415697

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:

本文标签: goSwagger OpenAPI 2 Cannot remove model (struct) from models listStack Overflow