{"action":"created","issue":{"url":"https://api.github.com/repos/actix/actix-web/issues/70","repository_url":"https://api.github.com/repos/actix/actix-web","labels_url":"https://api.github.com/repos/actix/actix-web/issues/70/labels{/name}","comments_url":"https://api.github.com/repos/actix/actix-web/issues/70/comments","events_url":"https://api.github.com/repos/actix/actix-web/issues/70/events","html_url":"https://github.com/actix/actix-web/issues/70","id":296032662,"number":70,"title":"Type-safe path/query parameter handling, using serde","user":{"login":"radix","id":227068,"avatar_url":"https://avatars1.githubusercontent.com/u/227068?v=4","gravatar_id":"","url":"https://api.github.com/users/radix","html_url":"https://github.com/radix","followers_url":"https://api.github.com/users/radix/followers","following_url":"https://api.github.com/users/radix/following{/other_user}","gists_url":"https://api.github.com/users/radix/gists{/gist_id}","starred_url":"https://api.github.com/users/radix/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/radix/subscriptions","organizations_url":"https://api.github.com/users/radix/orgs","repos_url":"https://api.github.com/users/radix/repos","events_url":"https://api.github.com/users/radix/events{/privacy}","received_events_url":"https://api.github.com/users/radix/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":19,"created_at":"2018-02-09T22:31:16Z","updated_at":"2018-03-28T00:46:47Z","closed_at":null,"author_association":"CONTRIBUTOR","body":"Users should be able to define structures that hold parameters that need to be passed to a request handler. We could use the serde `Deserialize` trait. The goal is to make it easier for users to access parameters without having to deal with error-handling themselves, and hopefully to avoid the current situation where making a typo in your handler vs your route means that you get a runtime error instead of a compile-time error.\r\n\r\nThe goal is to somehow allow the user to type this:\r\n\r\n```rust\r\n#[derive(Deserialize)]\r\nstruct MyParams {\r\n    name: String,\r\n}\r\n```\r\n\r\nand then, define a handler like this:\r\n\r\n\r\n```rust\r\nfn my_handler(req: HttpRequest<_>, my_params: MyParams) -> _ {\r\n}\r\n```\r\n\r\nor, alternatively:\r\n\r\n```rust\r\nfn my_hadler(req: HttpRequest<_>) -> _ {\r\n    let my_params = req.get_params::<MyParams>();\r\n}\r\n```\r\n\r\nThis will require some way to declare the route for my_handler with MyParams.\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/actix/actix-web/issues/comments/376722248","html_url":"https://github.com/actix/actix-web/issues/70#issuecomment-376722248","issue_url":"https://api.github.com/repos/actix/actix-web/issues/70","id":376722248,"user":{"login":"mockersf","id":8672791,"avatar_url":"https://avatars3.githubusercontent.com/u/8672791?v=4","gravatar_id":"","url":"https://api.github.com/users/mockersf","html_url":"https://github.com/mockersf","followers_url":"https://api.github.com/users/mockersf/followers","following_url":"https://api.github.com/users/mockersf/following{/other_user}","gists_url":"https://api.github.com/users/mockersf/gists{/gist_id}","starred_url":"https://api.github.com/users/mockersf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mockersf/subscriptions","organizations_url":"https://api.github.com/users/mockersf/orgs","repos_url":"https://api.github.com/users/mockersf/repos","events_url":"https://api.github.com/users/mockersf/events{/privacy}","received_events_url":"https://api.github.com/users/mockersf/received_events","type":"User","site_admin":false},"created_at":"2018-03-28T00:46:47Z","updated_at":"2018-03-28T00:46:47Z","author_association":"CONTRIBUTOR","body":"Extractors look great, thanks @fafhrd91 !\r\nJust so you know, I ran into an issue with serde_urlencoded: Unit Enum are not properly decoded. There is a PR waiting to fix that: https://github.com/nox/serde_urlencoded/pull/30"}}
{"actor":{"display_login":"mockersf"}}