{"action":"created","issue":{"url":"https://api.github.com/repos/elixir-lang/plug/issues/111","labels_url":"https://api.github.com/repos/elixir-lang/plug/issues/111/labels{/name}","comments_url":"https://api.github.com/repos/elixir-lang/plug/issues/111/comments","events_url":"https://api.github.com/repos/elixir-lang/plug/issues/111/events","html_url":"https://github.com/elixir-lang/plug/issues/111","id":45603279,"number":111,"title":"nested params parser result is different between plug and rails ","user":{"login":"falood","id":184053,"avatar_url":"https://avatars.githubusercontent.com/u/184053?v=3","gravatar_id":"","url":"https://api.github.com/users/falood","html_url":"https://github.com/falood","followers_url":"https://api.github.com/users/falood/followers","following_url":"https://api.github.com/users/falood/following{/other_user}","gists_url":"https://api.github.com/users/falood/gists{/gist_id}","starred_url":"https://api.github.com/users/falood/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/falood/subscriptions","organizations_url":"https://api.github.com/users/falood/orgs","repos_url":"https://api.github.com/users/falood/repos","events_url":"https://api.github.com/users/falood/events{/privacy}","received_events_url":"https://api.github.com/users/falood/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2014-10-13T02:57:36Z","updated_at":"2015-01-06T13:02:23Z","closed_at":null,"body":"`/?array[][foo]=foo1&array[][foo]=foo2&array[][bar]=bar2`\r\nresult of rails parser is\r\n`{\"array\"=>[{\"foo\"=>\"foo1\"}, {\"foo\"=>\"foo2\", \"bar\"=>\"bar2\"}]}`\r\nresult of plug parser is \r\n`%{\"array\"=>[%{\"foo\"=>\"foo1\"}, %{\"foo\"=>\"foo2\"}, %{\"bar\"=>\"bar2\"}]}`\r\n\r\nIs this a bug?"},"comment":{"url":"https://api.github.com/repos/elixir-lang/plug/issues/comments/68862260","html_url":"https://github.com/elixir-lang/plug/issues/111#issuecomment-68862260","issue_url":"https://api.github.com/repos/elixir-lang/plug/issues/111","id":68862260,"user":{"login":"josevalim","id":9582,"avatar_url":"https://avatars.githubusercontent.com/u/9582?v=3","gravatar_id":"","url":"https://api.github.com/users/josevalim","html_url":"https://github.com/josevalim","followers_url":"https://api.github.com/users/josevalim/followers","following_url":"https://api.github.com/users/josevalim/following{/other_user}","gists_url":"https://api.github.com/users/josevalim/gists{/gist_id}","starred_url":"https://api.github.com/users/josevalim/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/josevalim/subscriptions","organizations_url":"https://api.github.com/users/josevalim/orgs","repos_url":"https://api.github.com/users/josevalim/repos","events_url":"https://api.github.com/users/josevalim/events{/privacy}","received_events_url":"https://api.github.com/users/josevalim/received_events","type":"User","site_admin":false},"created_at":"2015-01-06T13:02:23Z","updated_at":"2015-01-06T13:02:23Z","body":"Thanks everyone!\r\n\r\nSo, I don't agree with node's result because I would expect to achieve that if I had this:\r\n\r\n    /?array[][foo][]=foo1&array[][foo][]=foo2&array[][bar]=bar2\r\n\r\nFor example, that's exactly what I get by serialising the value back to param using jQuery:\r\n\r\n    > decodeURIComponent(jQuery.param({\"array\":[{\"foo\":[\"foo1\",\"foo2\"],\"bar\":\"bar2\"}]}))\r\n    \"array[0][foo][]=foo1&array[0][foo][]=foo2&array[0][bar]=bar2\"\r\n\r\nI don't seem to find any consensus here. jQuery will serialize arrays only if you have string. Check this out:\r\n\r\n    decodeURIComponent(jQuery.param({\"array\":[{\"foo\": \"foo\"}, \"bar2\"]}))\r\n    \"array[0][foo]=foo&array[]=bar2\"\r\n\r\nBecause the first element of the array is an object, it actually indexed it as `array[0]`. So it seems what we are trying to discuss will never be generated by jQuery and it is hard to come up with any conclusion unless we discuss how and why this is being generated."}}