修复部分场景确实min/max解析丢失的问题

This commit is contained in:
白茶清欢 2025-02-19 18:15:10 +08:00
parent 0e1ceaf613
commit 58ba52f919

View File

@ -601,6 +601,8 @@ func (g *Generate) AddComponentsSchema(rootSchemaName string, pkgPath string, in
g.docData.Components.Schemas[schemaName].Properties[propertyName] = &define.Property{ g.docData.Components.Schemas[schemaName].Properties[propertyName] = &define.Property{
Type: convertBaseType, Type: convertBaseType,
Format: inputType.Field(i).Type.String(), Format: inputType.Field(i).Type.String(),
Maximum: ValidateRule.Maximum(inputType.Field(i)),
Minimum: ValidateRule.Minimum(inputType.Field(i)),
Default: ParseStructFieldTag.GetDefaultValue(inputType.Field(i)), Default: ParseStructFieldTag.GetDefaultValue(inputType.Field(i)),
Description: ParseStructFieldTag.GetParamDesc(inputType.Field(i)), Description: ParseStructFieldTag.GetParamDesc(inputType.Field(i)),
} }