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 Enum values do not get added when using v3.1 flag on 2.0.0-rc4
To Reproduce Reproduction code:
package main import ( "log" "net/http" ) type EnhancementType string // @name EnhancementType const ( Foo EnhancementType = "FOO" Bar EnhancementType = "BAR" ) type Enhancement struct { EnhancementType EnhancementType `json:"enhancement_type" example:"FOO"` } // Enhance - handler for / // @Summary Example Data // @Tags example // @Accept json // @Produce json // @Param enhance body Enhancement true "Enhancement Request Body" // @Success 200 {object} Enhancement // @Failure 400 {object} object // @Failure 404 {object} object // @Failure 500 {object} object // @Router / [post] func example(w http.ResponseWriter, r *http.Request) { w.Write([]byte("{\"enhancement_type\": \"BAR\"}")) } func handleRequests() { http.HandleFunc("/", example) log.Fatal(http.ListenAndServe(":10000", nil)) } // @title Swagger Example API // @version 1.0 // @description This is a sample server // @host localhost:10000 func main() { handleRequests() }
Command:
swag init -d ./ -g ./main.go -o ./docs --parseDependency --parseInternal --parseDepth 3 --v3.1 --ot yaml,go
Expected behavior Enum is generated
EnhancementType: enum: - FOO - BAR type: string x-enum-varnames: - Foo - Bar
Actual behavior Adds x-enum-varnames but not enum:
components: schemas: main.Enhancement: properties: enhancement_type: $ref: '#/components/schemas/main.EnhancementType' type: object main.EnhancementType: example: FOO type: string x-enum-varnames: - Foo - Bar
Your swag version 2.0.0-rc4
Your go version go version go1.23.2 darwin/arm64
Desktop (please complete the following information):
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Describe the bug
Enum values do not get added when using v3.1 flag on 2.0.0-rc4
To Reproduce
Reproduction code:
Command:
Expected behavior
Enum is generated
Actual behavior
Adds x-enum-varnames but not enum:
Your swag version
2.0.0-rc4
Your go version
go version go1.23.2 darwin/arm64
Desktop (please complete the following information):
The text was updated successfully, but these errors were encountered: