You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Changing that field from *[]string to []string should do the trick. At the moment binder knows to only to handle pointers to common types ala string,bool, structs etc and not their slice variants.
Anyway, I think you are overthinking here with pointers. Unitilialized slice is nil. So if that testcase would have no tags query params this would be after bind:
Thank you for the reply. The problem is that the struct is automatically generated by oapi-codegen and it creates a pointer unless I set the field as required in the OpenAPI spec.
I was hoping this was a bug since binding into a pointer to a slice works with JSON in the request body.
Issue Description
When binding input data into a struct with a field with a pointer to a slice, *[]string for example, Bind method returns "unknown type" error.
Checklist
Expected behaviour
Successfully bind input data into the provided struct
Actual behaviour
Bind method returns "unknown type" error
Steps to reproduce
Version/commit
v4.9.1
The text was updated successfully, but these errors were encountered: