We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I am generating the swagger json by running below command
swagger generate spec -m -o ./doc/swagger.json
It generates the json, however it does not include the fields in the definition and only includes
"definitions": { "MyStruct": { "x-go-package": "github.com/myorg/my-service-repo/model/" } }
I have the struct with swagger comments as below
// swagger:model MyStruct type MyStruct struct { Field1 string `json:"field1" binding:"required"` Field2 string `json:"field2" binding:"required"` }
Generate swagger from root directory
swagger version version: v0.30.5 commit: ab6a7885723430004f1d7db6395369b6e7f3370b
go version go version go1.20.5 darwin/amd64
sw_vers ProductName: macOS ProductVersion: 14.4.1 BuildVersion: 23E224
The text was updated successfully, but these errors were encountered:
by setting env variable export SWAGGER_GENERATE_EXTENSION=false it eliminates x-go-package but still keeps the definitions empty
"definitions": { "MyStruct": { } }
Sorry, something went wrong.
I confirm that the issue is with the binary built. It works fine with installing the go module
go install github.com/go-swagger/go-swagger/cmd/swagger@latest
Please release the proper binary.
No branches or pull requests
Problem statement
I am generating the swagger json by running below command
swagger generate spec -m -o ./doc/swagger.json
It generates the json, however it does not include the fields in the definition and only includes
I have the struct with swagger comments as below
Steps to reproduce
Generate swagger from root directory
swagger generate spec -m -o ./doc/swagger.json
Environment
The text was updated successfully, but these errors were encountered: