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",