save code

This commit is contained in:
2026-01-05 18:16:48 +08:00
parent 20b6c48640
commit 8ce50fd235

View File

@@ -225,7 +225,7 @@ func generateSchemaRecursive(t reflect.Type, seen map[string]bool) *openapi3.Sch
} }
return &openapi3.SchemaRef{ return &openapi3.SchemaRef{
Value: openapi3.NewObjectSchema(). Value: openapi3.NewObjectSchema().
WithAdditionalProperties(valueSchema), WithAdditionalProperties(valueSchema.Value),
} }
case reflect.Ptr: case reflect.Ptr:
@@ -253,11 +253,10 @@ func applyFieldInfoToSchema(schema *openapi3.Schema, info *StructFieldInfo) {
if info.Example != nil { if info.Example != nil {
schema.Example = info.Example schema.Example = info.Example
} }
if info.Min != nil { schema.Min = info.Min
schema.Min = &openapi3.Min{Value: *info.Min}
}
if info.Max != nil { if info.Max != nil {
schema.Max = &openapi3.Max{Value: *info.Max} schema.Max = info.Max
} }
if info.MinLength != nil { if info.MinLength != nil {
schema.MinLength = *info.MinLength schema.MinLength = *info.MinLength