From 21a4daf4e7225babfb46a7ac74e543ca55396f1f Mon Sep 17 00:00:00 2001 From: lxy <391861737@qq.com> Date: Sat, 3 May 2025 16:14:29 +0800 Subject: [PATCH] feat: Tag instructed recursive params finding Allow input struct to have fields tagged with `recursive:"true"` to enable a deeper params finding --- huma.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/huma.go b/huma.go index 709e1a73..8b545775 100644 --- a/huma.go +++ b/huma.go @@ -439,7 +439,7 @@ func _findInType[T comparable](t reflect.Type, path []int, result *findResult[T] result.Paths = append(result.Paths, findResultPath[T]{fi, v}) } } - if f.Anonymous || recurseFields || deref(f.Type).Kind() != reflect.Struct { + if f.Anonymous || recurseFields || deref(f.Type).Kind() != reflect.Struct || f.Tag.Get("recursive") == "true" { // Always process embedded structs and named fields which are not // structs. If `recurseFields` is true then we also process named // struct fields recursively.