Skip to content

Commit

Permalink
fix: 修复swagger文档中的枚举值错误
Browse files Browse the repository at this point in the history
  • Loading branch information
zodial committed May 16, 2023
1 parent 5983bf4 commit da42461
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions console/commands/swagger.go
Original file line number Diff line number Diff line change
Expand Up @@ -446,13 +446,13 @@ func enumToMessage(pge string, enum parser.Enum) (string, *openapi.Schema) {
schema := &openapi.Schema{}
schema.Description = enum.Doc
properties := make(map[string]*openapi.Schema)
for i, opt := range enum.Opt {
for _, opt := range enum.Opt {
attr := &openapi.Schema{
Description: "enum|" + getTitle(opt.Doc),
Type: "number",
Format: "uint",
}
properties[strconv.Itoa(i)] = attr
properties[fmt.Sprint(opt.Num)] = attr
}
schema.Properties = properties
schema.Format = "number"
Expand Down

0 comments on commit da42461

Please sign in to comment.