querystring-parser icon indicating copy to clipboard operation
querystring-parser copied to clipboard

Incorrect parsing for arrays

Open mecampbellsoup opened this issue 3 years ago • 1 comments

Hi guys,

I am parsing a querystring that includes an array value. However this library is interpreting it as a hash with a key of ''.

   # intended to be parsed as follows (note this is a Ruby hash)
   "received_on"=>"2012-09-07",
   "invoice_uids"=>["inv_9hchn3xc84mgm"],
   "invoice_id"=>nil

Here is the raw querystring:

payload[transaction][received_on]=2012-09-07&payload[transaction][invoice_uids][]=inv_9hchn3xc84mgm&payload[transaction][invoice_id]=

And here is the output from parsing using this library:

        'received_on': '2012-09-07',
        'invoice_uids': {'': 'inv_9hchn3xc84mgm'},
        'invoice_id': ''

mecampbellsoup avatar Mar 14 '22 19:03 mecampbellsoup

same here, did you figure it out?

Martini002 avatar Aug 02 '23 13:08 Martini002