修复类型为字符串时,最大值 最小值的配置

This commit is contained in:
2025-02-19 21:46:05 +08:00
parent 9f915c779d
commit d248c1a093
2 changed files with 34 additions and 8 deletions

View File

@ -138,6 +138,8 @@ type Schema struct {
Format string `json:"format,omitempty"` // 格式化类型
Maximum *int64 `json:"maximum,omitempty"` // 最大值
Minimum *int64 `json:"minimum,omitempty"` // 最小值
MinLength *int64 `json:"minLength,omitempty"` // 字符串最小长度
MaxLength *int64 `json:"maxLength,omitempty"` // 字符串最大长度
Default any `json:"default,omitempty"` // 默认值
}
@ -155,6 +157,8 @@ type Property struct {
Description string `json:"description,omitempty"` // 数据描述, CommonMark syntax可以被用来呈现富文本格式.
Maximum *int64 `json:"maximum,omitempty"` // 最大值
Minimum *int64 `json:"minimum,omitempty"` // 最小值
MinLength *int64 `json:"minLength,omitempty"` // 字符串最小长度
MaxLength *int64 `json:"maxLength,omitempty"` // 字符串最大长度
AllOf []*PropertyXOf `json:"allOf,omitempty"` // type 是一个对象, allOf 指向对象描述
OneOf []*PropertyXOf `json:"oneOf,omitempty"` // type 是一个对象, allOf 指向对象描述
AnyOf []*PropertyXOf `json:"anyOf,omitempty"` // type 是一个对象, allOf 指向对象描述