{"action":"created","issue":{"url":"https://api.github.com/repos/alexmingoia/koa-router/issues/179","labels_url":"https://api.github.com/repos/alexmingoia/koa-router/issues/179/labels{/name}","comments_url":"https://api.github.com/repos/alexmingoia/koa-router/issues/179/comments","events_url":"https://api.github.com/repos/alexmingoia/koa-router/issues/179/events","html_url":"https://github.com/alexmingoia/koa-router/issues/179","id":107870039,"number":179,"title":"Supporting arrays (repeating params) in URL","user":{"login":"nettiopsu","id":9055454,"avatar_url":"https://avatars.githubusercontent.com/u/9055454?v=3","gravatar_id":"","url":"https://api.github.com/users/nettiopsu","html_url":"https://github.com/nettiopsu","followers_url":"https://api.github.com/users/nettiopsu/followers","following_url":"https://api.github.com/users/nettiopsu/following{/other_user}","gists_url":"https://api.github.com/users/nettiopsu/gists{/gist_id}","starred_url":"https://api.github.com/users/nettiopsu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nettiopsu/subscriptions","organizations_url":"https://api.github.com/users/nettiopsu/orgs","repos_url":"https://api.github.com/users/nettiopsu/repos","events_url":"https://api.github.com/users/nettiopsu/events{/privacy}","received_events_url":"https://api.github.com/users/nettiopsu/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/alexmingoia/koa-router/labels/enhancement","name":"enhancement","color":"84b6eb"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-09-23T08:12:13Z","updated_at":"2015-09-30T17:08:15Z","closed_at":null,"body":"It is ok to use arrays in koa.js in a query string, e.g. `/something?param=1&param=2`\r\n\r\nthis.request.query will return in this case an array:\r\n`[\r\nparam: [1, 2]\r\n]`\r\n\r\nWhy not to support this also in koa-router:\r\n`/something/param/1/param/2`\r\nfor URL pattern like `/something/param/:param`\r\n\r\nIt could return an array also in the same style as this.request.query"},"comment":{"url":"https://api.github.com/repos/alexmingoia/koa-router/issues/comments/144479034","html_url":"https://github.com/alexmingoia/koa-router/issues/179#issuecomment-144479034","issue_url":"https://api.github.com/repos/alexmingoia/koa-router/issues/179","id":144479034,"user":{"login":"alexmingoia","id":1112718,"avatar_url":"https://avatars.githubusercontent.com/u/1112718?v=3","gravatar_id":"","url":"https://api.github.com/users/alexmingoia","html_url":"https://github.com/alexmingoia","followers_url":"https://api.github.com/users/alexmingoia/followers","following_url":"https://api.github.com/users/alexmingoia/following{/other_user}","gists_url":"https://api.github.com/users/alexmingoia/gists{/gist_id}","starred_url":"https://api.github.com/users/alexmingoia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alexmingoia/subscriptions","organizations_url":"https://api.github.com/users/alexmingoia/orgs","repos_url":"https://api.github.com/users/alexmingoia/repos","events_url":"https://api.github.com/users/alexmingoia/events{/privacy}","received_events_url":"https://api.github.com/users/alexmingoia/received_events","type":"User","site_admin":false},"created_at":"2015-09-30T17:08:15Z","updated_at":"2015-09-30T17:08:15Z","body":"Neat. It's a little magical for my taste but it makes sense. If there's only one parameter given, how does the router know it should be an array? Code would always have to check if `req.query.product-id` is an array or not.\r\n\r\nMy 2cents from my own experience building APIs... I recommend going with `?json=` and using `JSON.stringify()` and `JSON.parse()` for simpler, more robust, and reliable queries compared to the various express-style query parameter parsing schemes. It removes a whole layer of unnecessary abstraction imho."}}