From 8ce50fd235227175443e6433f63c068ce166c0b6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=99=BD=E8=8C=B6=E6=B8=85=E6=AC=A2?= Date: Mon, 5 Jan 2026 18:16:48 +0800 Subject: [PATCH] save code --- openapi/schema.go | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/openapi/schema.go b/openapi/schema.go index 4a6f87f..a165863 100644 --- a/openapi/schema.go +++ b/openapi/schema.go @@ -225,7 +225,7 @@ func generateSchemaRecursive(t reflect.Type, seen map[string]bool) *openapi3.Sch } return &openapi3.SchemaRef{ Value: openapi3.NewObjectSchema(). - WithAdditionalProperties(valueSchema), + WithAdditionalProperties(valueSchema.Value), } case reflect.Ptr: @@ -253,11 +253,10 @@ func applyFieldInfoToSchema(schema *openapi3.Schema, info *StructFieldInfo) { if info.Example != nil { schema.Example = info.Example } - if info.Min != nil { - schema.Min = &openapi3.Min{Value: *info.Min} - } + schema.Min = info.Min + if info.Max != nil { - schema.Max = &openapi3.Max{Value: *info.Max} + schema.Max = info.Max } if info.MinLength != nil { schema.MinLength = *info.MinLength