{"action":"created","issue":{"url":"https://api.github.com/repos/NancyFx/Nancy/issues/1889","labels_url":"https://api.github.com/repos/NancyFx/Nancy/issues/1889/labels{/name}","comments_url":"https://api.github.com/repos/NancyFx/Nancy/issues/1889/comments","events_url":"https://api.github.com/repos/NancyFx/Nancy/issues/1889/events","html_url":"https://github.com/NancyFx/Nancy/issues/1889","id":65407332,"number":1889,"title":"Combining TryParse and route constraints fails","user":{"login":"philjones88","id":677167,"avatar_url":"https://avatars.githubusercontent.com/u/677167?v=3","gravatar_id":"","url":"https://api.github.com/users/philjones88","html_url":"https://github.com/philjones88","followers_url":"https://api.github.com/users/philjones88/followers","following_url":"https://api.github.com/users/philjones88/following{/other_user}","gists_url":"https://api.github.com/users/philjones88/gists{/gist_id}","starred_url":"https://api.github.com/users/philjones88/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/philjones88/subscriptions","organizations_url":"https://api.github.com/users/philjones88/orgs","repos_url":"https://api.github.com/users/philjones88/repos","events_url":"https://api.github.com/users/philjones88/events{/privacy}","received_events_url":"https://api.github.com/users/philjones88/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-03-31T09:24:57Z","updated_at":"2015-03-31T09:30:36Z","closed_at":null,"body":"Seems if you do:\r\n\r\n`Get[\"/foos/{id:int}\"] = parameters => {\r\nint id = (int)parameters.id.TryParse<int>(-1);\r\nreturn new {Key = id};\r\n};`\r\n\r\nYou'll end up with -1 as the `Key` value from the `id` parameter.\r\n\r\nThis does seem strange but I upgraded routes to be {id:int} without removing the TryParse's and hit this issue."},"comment":{"url":"https://api.github.com/repos/NancyFx/Nancy/issues/comments/88013700","html_url":"https://github.com/NancyFx/Nancy/issues/1889#issuecomment-88013700","issue_url":"https://api.github.com/repos/NancyFx/Nancy/issues/1889","id":88013700,"user":{"login":"khellang","id":582487,"avatar_url":"https://avatars.githubusercontent.com/u/582487?v=3","gravatar_id":"","url":"https://api.github.com/users/khellang","html_url":"https://github.com/khellang","followers_url":"https://api.github.com/users/khellang/followers","following_url":"https://api.github.com/users/khellang/following{/other_user}","gists_url":"https://api.github.com/users/khellang/gists{/gist_id}","starred_url":"https://api.github.com/users/khellang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/khellang/subscriptions","organizations_url":"https://api.github.com/users/khellang/orgs","repos_url":"https://api.github.com/users/khellang/repos","events_url":"https://api.github.com/users/khellang/events{/privacy}","received_events_url":"https://api.github.com/users/khellang/received_events","type":"User","site_admin":false},"created_at":"2015-03-31T09:30:36Z","updated_at":"2015-03-31T09:30:36Z","body":"If you have `{id:int}`, the `id` parameter should already be an `int` and shouldn't need any parsing."}}