{"id":"4f588aa019657ae2","repo":"labstack/echo","slug":"unsupported-value-type-t","errorCode":null,"errorMessage":"unsupported value type: %T","messagePattern":"unsupported value type: %T","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"binder_generic.go","lineNumber":568,"sourceCode":"\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t\t*d = t.In(to.ToInLocation)\n\tcase BindUnmarshaler:\n\t\tif err := d.UnmarshalParam(value); err != nil {\n\t\t\treturn err\n\t\t}\n\tcase encoding.TextUnmarshaler:\n\t\tif err := d.UnmarshalText([]byte(value)); err != nil {\n\t\t\treturn err\n\t\t}\n\tcase json.Unmarshaler:\n\t\tif err := d.UnmarshalJSON([]byte(value)); err != nil {\n\t\t\treturn err\n\t\t}\n\tdefault:\n\t\treturn fmt.Errorf(\"unsupported value type: %T\", dest)\n\t}\n\treturn nil\n}\n","sourceCodeStart":550,"sourceCodeEnd":572,"githubUrl":"https://github.com/labstack/echo/blob/05489dc1730161df26b72d1ae2a3ba6fb8178fc7/binder_generic.go#L550-L572","documentation":"Returned by bindValue (binder_generic.go:567-569) when the destination type matches none of the supported switch cases: bool, floats, ints, uints, string, time.Duration, time.Time, BindUnmarshaler, encoding.TextUnmarshaler, json.Unmarshaler. T fell through to the default branch.","triggerScenarios":"ParseValue[MyStruct](...) where MyStruct implements none of the unmarshaler interfaces; arrays/maps; pointers to unsupported types; structs without a custom unmarshaler.","commonSituations":"Binding a complex struct field from a single scalar value instead of using c.Bind; nested types; third-party types lacking TextUnmarshaler.","solutions":["Implement echo.BindUnmarshaler, encoding.TextUnmarshaler, or json.Unmarshaler on the type","Use c.Bind for whole structs rather than ParseValue per field","Use ParseValues[T] with a slice element type for repeated values"],"exampleFix":"// before\ntype Color struct{ R, G, B int }\nv, err := echo.ParseValue[Color](\"#fff\")\n// after — implement TextUnmarshaler:\nfunc (c *Color) UnmarshalText(b []byte) error { /* parse hex */ return nil }\nv, err := echo.ParseValue[Color](\"#fff\")","handlingStrategy":"type-guard","validationCode":"var z T\nswitch any(z).(type) {\ncase echo.BindUnmarshaler, encoding.TextUnmarshaler, json.Unmarshaler:\n    // ok\ndefault:\n    // fall back to c.Bind for the whole struct\n}","typeGuard":"func isBindable[T any]() bool {\n    var z T\n    switch any(z).(type) {\n    case echo.BindUnmarshaler, encoding.TextUnmarshaler, json.Unmarshaler:\n        return true\n    }\n    return false\n}","tryCatchPattern":null,"preventionTips":["Implement TextUnmarshaler on custom scalar types","Use c.Bind for structs and ParseValue for scalars"],"tags":["binding","type-mismatch"],"analyzedSha":"05489dc1730161df26b72d1ae2a3ba6fb8178fc7","analyzedAt":"2026-08-04T21:32:47.783Z","schemaVersion":2}