Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reading array query parameter as []time.Time? #61

Open
ganigeorgiev opened this issue Oct 24, 2020 · 0 comments
Open

Reading array query parameter as []time.Time? #61

ganigeorgiev opened this issue Oct 24, 2020 · 0 comments

Comments

@ganigeorgiev
Copy link

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.

@ganigeorgiev ganigeorgiev changed the title Reading array query parameter in []time.Time? Reading array query parameter as []time.Time? Oct 24, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant