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
版权声明:本文标题:go - Swagger OpenAPI 2: Cannot remove model (struct) from models list - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1745237660a2649131.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论