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
Describe the bug struct with json tag will different to without
To Reproduce Steps to reproduce the behavior:
package main import "github.com/gin-gonic/gin" //go install github.com/abice/go-enum@latest //go:generate go-enum --output-suffix _generate.go //swag i --pd --output ./docs/api --v3.1 // ENUM(a,b,c,d) type EC string type Response[t any] struct { EC EC `json:"ec"` Data t `json:"data"` Error string `json:"error"` } // ENUM(aa,bb,cc,dd) type OtherEnum string type Complex struct { F1 EC `json:"f_1"` F2 []OtherEnum `json:"f_2"` F3 []int `json:"f_3"` } // @contact.name API Support func main() { r := gin.New() r.Run() } // @Summary test1 // @Description test1 // @Produce json // @Success 200 {object} Response[string] // @Router /test1 [get] func test1() {} // @Summary test2 // @Description test2 // @Produce json // @Success 200 {object} Response[[]Complex] // @Router /test2 [get] func test2() {}
this with result
main.Response-array_main_Complex: properties: data: items: $ref: '#/components/schemas/main.Complex' type: array uniqueItems: false ec: type: string x-enum-varnames: - ECA - ECB - ECC - ECD error: type: string type: object
Expected behavior
main.Response-array_main_Complex: properties: data: items: $ref: '#/components/schemas/main.Complex' type: array ec: $ref: '#/components/schemas/main.EC' error: type: string type: object
Your swag version 2.0.0-rc3
Your go version 1.23.2
Desktop (please complete the following information): macos
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Describe the bug
struct with json tag will different to without
To Reproduce
Steps to reproduce the behavior:
this with result
Expected behavior
Your swag version
2.0.0-rc3
Your go version
1.23.2
Desktop (please complete the following information):
macos
The text was updated successfully, but these errors were encountered: