Closed wvengen closed 9 years ago
thanks for reporting this! can you give some quick example code of how you were running into this issue? (is it in a controller or?)
I guess this would help - #423
Good news, bad news on this.. i can pretty easily get it to output ?q[0]=1&q[1]=3
but not ?q[]=1&q[]=3
- and i'm pretty sure things like rails doesn't like the index to be there. The reason why it currently outputs ?q=1&q=3
is
qs is setup to be able to parse either option, but i think it only ever outputs with index. Would having the index in the array be a deal breaker for you? I'm having problems finding anything in node that formats it with []
's... but they can all read it with them.
Thanks for looking into this!
I've tested Ruby on Rails 4.1.6 and that doesn't accept arrays indexed with numbers :( And I'm probably not the only one using Rails. I see a couple of options:
indices
is set to 'empty'
output with ?q[]=1&q[]=3
)It seems this has the attention of upstream :) See https://github.com/hapijs/qs/issues/46 and https://github.com/hapijs/qs/pull/65
thanks for all the info on this! just opened up a PR for it.
Thank you, it works! And I guess after arrayFormat
has been implemented, we might be able to use qs again.
After a recent update of master, I find that array parameters are passed through differently (see title). This broke querying with array parameters for my Rails-based API.
I suspect that 33ba3149bbe0e112a764213ef9aa9b969af4da82 is the culprit, with
url.format
usingquerystring
to create the query string, instead of passing through the path as composed byqs
(I guess here).