ozzo-routing
ozzo-routing copied to clipboard
Reading array query parameter as `[]time.Time`?
Reading array query parameters doesn't seem to work with common non primitive types (eg. []time.Time
, []uuid.UUID
, etc.).
Example:
// url: http://localhost:8090/api/test?Names=test1&Dates=2020-10-11T21%3A00%3A00.000Z
data := &struct{
Names []string
Dates []time.Time
}{}
ctx.Read(data) // result: { Names: [ "test1" ], Dates: [] }
I guess if an alias type with custom encoding.TextUnmarshaler
is provided it would work, but that seems redundant because the non slice version is correctly unmarshalized.