From a040f9c83be451d31f3ffa51e306e972c57b0430 Mon Sep 17 00:00:00 2001 From: Robert Thomas <31854736+wolveix@users.noreply.github.com> Date: Fri, 20 Feb 2026 21:02:01 +0000 Subject: [PATCH] Fix form param doc regression --- huma.go | 2 +- huma_test.go | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/huma.go b/huma.go index e2189964..78b286e3 100644 --- a/huma.go +++ b/huma.go @@ -257,7 +257,7 @@ func findParams(registry Registry, op *Operation, t reflect.Type) *findResult[*p pfi.TimeFormat = timeFormat } - if !boolTag(f, "hidden", false) { + if !boolTag(f, "hidden", false) && pfi.Loc != "form" { documentParam(op, pl) } diff --git a/huma_test.go b/huma_test.go index 9e0f4a74..2f76b27f 100644 --- a/huma_test.go +++ b/huma_test.go @@ -1277,6 +1277,11 @@ func TestFeatures(t *testing.T) { assert.Equal(t, "object", mpContent.Schema.Type) assert.Equal(t, "binary", mpContent.Schema.Properties["file"].Format) assert.Equal(t, "binary", mpContent.Schema.Properties["greetings"].Items.Format) + + // Ensure no invalid "in": "form" parameters are present. + for _, param := range api.OpenAPI().Paths["/upload"].Post.Parameters { + assert.NotEqual(t, "form", param.In) + } }, Method: http.MethodPost, URL: "/upload",