From 45ef3c67d86d8a282557d8fdab415f909b9b7923 Mon Sep 17 00:00:00 2001 From: Viacheslav Poturaev Date: Thu, 7 Mar 2024 11:22:03 +0100 Subject: [PATCH] Fix default inference from an unexported field (#196) --- request/factory.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/request/factory.go b/request/factory.go index 8978bac..5a4e785 100644 --- a/request/factory.go +++ b/request/factory.go @@ -284,7 +284,7 @@ func (df *DecoderFactory) makeDefaultDecoder(input interface{}, m *decoder) { if d, ok := sf.Tag.Lookup(defaultTag); ok { //nolint:nestif defaults[key] = []string{d} - } else if df.JSONSchemaReflector != nil { + } else if df.JSONSchemaReflector != nil && v.CanInterface() { vi := v.Interface() s, err := df.JSONSchemaReflector.Reflect(vi)