Closed sdelamo closed 5 years ago
You're describing the expansion of a template. I don't think the template is being expanded given an argument. We're receiving query values and attempting to bind them to the argument. So I don't think the RFC you've included there applies to this use case.
I don't think we can or perhaps should assume that a string value with a comma in it represents multiple values when binding to a list. Should ?fields=Hello, Sam
be one item in the list or two?
Also duplicates https://github.com/micronaut-projects/micronaut-core/issues/1610
@jameskleeh - the parsing of comman separated values in list is valid request and actually default way of working with url params. Your statement of: Should ?fields=Hello, Sam be one item in the list or two?
Well it depends if the field is defined as String or List
Section 3.2.1 of RFC 6570
Given:
I was expecting:
curl http://localhost:8080?fields=1,2,3
curl http://localhost:8080?fields=1&fields=2&fields=3"
to return 3.
Only the latter returns 3.
Using an explode ("*") modifier yields the same results.
The workaround we are using is exploding the items manually if the there is only one item.
Environment Information