升级文档管理, 支持openapi3, 使用 github.com/getkin/kin-openapi/openapi3 实现 #23

Merged
zhangdeman merged 26 commits from feature/upgrade_api_doc_generate into master 2026-01-06 23:26:37 +08:00
Showing only changes of commit 8ce50fd235 - Show all commits

View File

@@ -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