解析枚举值

This commit is contained in:
2025-02-13 18:27:31 +08:00
parent 7307c85cfd
commit f1c0e473f4
3 changed files with 18 additions and 4 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"`
Age int `json:"age" d:"18" desc:"年龄" binding:"required,oneof:12 13 18 90"`
}
type List struct {
Total int64 `json:"total" binding:"required"`