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

Model binding of query strings does not work for arrays #403

Closed
nickkossolapov opened this issue Feb 25, 2020 · 1 comment
Closed

Model binding of query strings does not work for arrays #403

nickkossolapov opened this issue Feb 25, 2020 · 1 comment
Labels
bug Reproducible bug PR approved A PR for this issue will get accepted (as long as inline with the comms)

Comments

@nickkossolapov
Copy link

With the model

[<CLIMutable>]
type SearchRequest = {
    searchTerms = string[]
}

trying to bind a collection in a query string to the array on the model, e.g. localhost:8084??searchTerms=search1&searchTerms=search2, the binding fails and the array is set to null.

When the model is changed to use a list, e.g.

[<CLIMutable>]
type SearchRequest = {
    searchTerms: string list
}

the binding works correctly. It seems that arrays are not catered for in ModelBinding.parseValue

@dustinmoris dustinmoris added bug Reproducible bug PR approved A PR for this issue will get accepted (as long as inline with the comms) labels Apr 12, 2020
@dustinmoris
Copy link
Member

Thanks for raising this issue. I'll try to get this fixed for the next bigger release!

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Reproducible bug PR approved A PR for this issue will get accepted (as long as inline with the comms)
Projects
None yet
Development

No branches or pull requests

2 participants