swaggo / gin-swagger

gin middleware to automatically generate RESTful API documentation with Swagger 2.0.
MIT License
3.76k stars 270 forks source link

cannot find type definition: powerdns.RRType #145

Closed veryrich closed 3 years ago

veryrich commented 3 years ago

hello : i got a problem,

my struct:

type DnsBody struct {
    Zone   string                    `json:"zone"`
    Record string                   `json:"record"`
    Type   powerdns.RRType  `json:"type"`
    TTL    uint32                      `json:"ttl"`
    Ip     string                        `json:"ip"`
}

my gin-swagger code:

// @Title 创建Zone
// @Author goku@cg.app
// @Description 创建一个主域名,比如 qq.com
// @Tags Create Zone
// @Accept json
// @Produce json
// @Param body body DnsBody true "创建的主语"
// @Success 200 {object} DnsReport
// @Router  /v1/dns/createZone [post]

powerdns.RRType It's actually a string , i don't know how to let it works , please give me some help , thank you very much

veryrich commented 3 years ago

i solved my issue just appent --parseDependency to the swag init command.