You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Noticed while adding Parameters from a package that declares multiple structs in one statement.
Appears that the annotation "//swagger:parameters" needs to be above the "type" keyword
I expected the annotation "//swagger:parameters" to be able to be inserted directly above each struct declaration
Steps to reproduce
This will NOT work. Notice the syntax for declaring multiple structs/types
type (
//swagger:parameters myOpID
Request struct {
//in:body
//swagger:name -
RequestBody struct {
//Foo of body
Foo string `json:"foo"`
//Bar of body
Bar string `json:"bar"`
}
}
)
This will work.
//swagger:parameters myOpID
type Request struct {
//in:body
//swagger:name -
RequestBody struct {
//Foo of body
Foo string `json:"foo"`
//Bar of body
Bar string `json:"bar"`
}
}
Environment
swagger version: 2.0
go version: go version go1.10.4 linux/amd64
OS: Ubuntu 18.04.2 LTS
To get the spec to generate was an easy fix. My main problem is that the documentation has dictated (minimally) how application code is written outside of comment annotations.
FYI: I am new to go so forgive me if I used incorrect terminology
The text was updated successfully, but these errors were encountered:
Problem statement
Noticed while adding Parameters from a package that declares multiple structs in one statement.
Appears that the annotation "//swagger:parameters" needs to be above the "type" keyword
I expected the annotation "//swagger:parameters" to be able to be inserted directly above each struct declaration
Steps to reproduce
This will NOT work. Notice the syntax for declaring multiple structs/types
This will work.
Environment
swagger version: 2.0
go version: go version go1.10.4 linux/amd64
OS: Ubuntu 18.04.2 LTS
To get the spec to generate was an easy fix. My main problem is that the documentation has dictated (minimally) how application code is written outside of comment annotations.
FYI: I am new to go so forgive me if I used incorrect terminology
The text was updated successfully, but these errors were encountered: