{"action":"created","issue":{"url":"https://api.github.com/repos/aurelia/path/issues/23","repository_url":"https://api.github.com/repos/aurelia/path","labels_url":"https://api.github.com/repos/aurelia/path/issues/23/labels{/name}","comments_url":"https://api.github.com/repos/aurelia/path/issues/23/comments","events_url":"https://api.github.com/repos/aurelia/path/issues/23/events","html_url":"https://github.com/aurelia/path/pull/23","id":172939093,"number":23,"title":"Build and parse queries also in traditional style","user":{"login":"fragsalat","id":1099747,"avatar_url":"https://avatars.githubusercontent.com/u/1099747?v=3","gravatar_id":"","url":"https://api.github.com/users/fragsalat","html_url":"https://github.com/fragsalat","followers_url":"https://api.github.com/users/fragsalat/followers","following_url":"https://api.github.com/users/fragsalat/following{/other_user}","gists_url":"https://api.github.com/users/fragsalat/gists{/gist_id}","starred_url":"https://api.github.com/users/fragsalat/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fragsalat/subscriptions","organizations_url":"https://api.github.com/users/fragsalat/orgs","repos_url":"https://api.github.com/users/fragsalat/repos","events_url":"https://api.github.com/users/fragsalat/events{/privacy}","received_events_url":"https://api.github.com/users/fragsalat/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2016-08-24T12:31:32Z","updated_at":"2016-08-29T13:11:10Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/aurelia/path/pulls/23","html_url":"https://github.com/aurelia/path/pull/23","diff_url":"https://github.com/aurelia/path/pull/23.diff","patch_url":"https://github.com/aurelia/path/pull/23.patch"},"body":"#### Purpose:\r\nSome frameworks and libraries still doesn't support the modern style of query string in URI's. The RFC6570 standard describes the traditional way for URI templates. This PR intends to make the functions `buildQueryString` and `parseQueryString` able to handle those traditional style.\r\n\r\n#### What I did:\r\nRegarding the issue #21 I added a optional flag to the `buildQueryString` function to either build the query in the traditional rfc 6570 standard or in the modern style. The modern style is the default to don't implement changes for existing users.\r\n\r\nIn the rfc 6570 standard is mentioned that a repeated parameter key doesn't override the value but indicates a list of values. Therefore I adjusted the parseQueryString behavior to don't override existing keys but wrap the value in an array.\r\n\r\n#### Examples:\r\n```js\r\nbuildQueryString({var: 1, list: [1, 2]}) === 'list=1&list=2&var=1'\r\nbuildQueryString({var: 1, obj: {asd: 1}, list: [1, 2, {asd: 23}]}) === 'list=1&list=2&list=[object Object]&obj=[object Object]&var=1'\r\n\r\nparseQueryString('a=c&a=e') == {\"a\":[\"c\",\"e\"]}\r\nparseQueryString('a=c&a[2]=e&a=d&a[]=f') == {\"a\":[\"c\",null,\"e\",\"d\",\"f\"]}\r\n```"},"comment":{"url":"https://api.github.com/repos/aurelia/path/issues/comments/243119440","html_url":"https://github.com/aurelia/path/pull/23#issuecomment-243119440","issue_url":"https://api.github.com/repos/aurelia/path/issues/23","id":243119440,"user":{"login":"fragsalat","id":1099747,"avatar_url":"https://avatars.githubusercontent.com/u/1099747?v=3","gravatar_id":"","url":"https://api.github.com/users/fragsalat","html_url":"https://github.com/fragsalat","followers_url":"https://api.github.com/users/fragsalat/followers","following_url":"https://api.github.com/users/fragsalat/following{/other_user}","gists_url":"https://api.github.com/users/fragsalat/gists{/gist_id}","starred_url":"https://api.github.com/users/fragsalat/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fragsalat/subscriptions","organizations_url":"https://api.github.com/users/fragsalat/orgs","repos_url":"https://api.github.com/users/fragsalat/repos","events_url":"https://api.github.com/users/fragsalat/events{/privacy}","received_events_url":"https://api.github.com/users/fragsalat/received_events","type":"User","site_admin":false},"created_at":"2016-08-29T13:11:10Z","updated_at":"2016-08-29T13:11:10Z","body":"Oh sry my fault^^\r\n@EisenbergEffect  How about mergin this pr?\r\nWho's responsible for this repository?"}}
{"actor":{"display_login":"fragsalat"}}