在GoAPI中创建空的招摇过市规范

在GoAPI中创建空的招摇过市规范,go,swagger,go-swagger,Go,Swagger,Go Swagger,我正试图从我的API处理程序中使用generate swagger spec 我已从go-get安装了go-swagger: go get -u github.com/go-swagger/go-swagger/cmd/swagger 见以下项目结构: main.go在products.go中使用处理程序定义。(API工作并经过测试) product.go中的招摇过市规范: // Package classification of Product API. // // Documenting

我正试图从我的API处理程序中使用generate swagger spec

我已从
go-get
安装了go-swagger:

go get -u github.com/go-swagger/go-swagger/cmd/swagger
见以下项目结构:

main.go
products.go
中使用处理程序定义。(API工作并经过测试)

product.go中的招摇过市规范

// Package classification of Product API.
//
// Documenting for Product API
//
//
//
// Schemes: http, https
// BasePath: /
// Version: 0.0.1
//
// Consumes:
// - application/json
//
// Produces:
// - application/json
//
// swagger:meta
main.go
path运行以下命令:

GO111MODULE=off swagger generate spec -o ./swagger.yaml --scan-models
答复:

info: {}
paths: {}
swagger: "2.0"
basePath: /
consumes:
- application/json
info:
  description: Documenting for Product API
  title: 
  version: 0.0.1
paths: {}
producrs:
- application/json
schemes:
- http
swagger: "2.0"
预期答复:

basePath: /
consumes:
- application/json
info:
  description: Documenting for Product API
  title: 
  version: 0.0.1
paths: {}
producrs:
- application/json
schemes:
- http
swagger: "2.0"