小编Cor*_*AUT的帖子

go-swagger - 未生成/找到/导入类型结构

我正在尝试使用 go-swagger 生成 Go 服务的规范/文档

swagger generate spec -o ./docs/swagger.json --scan-models
Run Code Online (Sandbox Code Playgroud)

我能够生成基本信息+路线,但我的结构遇到了问题\

这里:用户结构未导入

docs/docs.go - github

// Package classification Users' Data API
//
// Documentation for Users' Data API
//
//  Schemes: http
//  BasePath: /v1
//  Version: 0.1.0
//
//  Consumes:
//  - application/json
//
//  Produces:
//  - application/json
//
// swagger:meta
package classification

import (
    M "service-users-data/internals/database/models"
)

// A list of all Users
// swagger:response usersResponse
type productsResponseWrapper struct {
    // All current Users
    // …
Run Code Online (Sandbox Code Playgroud)

api documentation doc go swagger

4
推荐指数
1
解决办法
1425
查看次数

标签 统计

api ×1

doc ×1

documentation ×1

go ×1

swagger ×1