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