修复默认值解析以及枚举值解析的BUG

This commit is contained in:
2025-02-13 21:11:27 +08:00
parent f1c0e473f4
commit 45a25e0018
4 changed files with 68 additions and 10 deletions

View File

@ -25,7 +25,7 @@ import (
func Test_parser_Openapi3(t *testing.T) {
type User struct {
Name string `json:"name" d:"zhang" desc:"用户姓名" binding:"required"`
Age int `json:"age" d:"18" desc:"年龄" binding:"required,oneof:12 13 18 90"`
Age string `json:"age" d:"18" desc:"年龄" binding:"required,oneof=12 13 18 90"`
}
type List struct {
Total int64 `json:"total" binding:"required"`