{"action":"created","issue":{"url":"https://api.github.com/repos/peej/tonic/issues/191","labels_url":"https://api.github.com/repos/peej/tonic/issues/191/labels{/name}","comments_url":"https://api.github.com/repos/peej/tonic/issues/191/comments","events_url":"https://api.github.com/repos/peej/tonic/issues/191/events","html_url":"https://github.com/peej/tonic/issues/191","id":73265793,"number":191,"title":"Trailing slash removed from URI when finding resource","user":{"login":"neekfenwick","id":266415,"avatar_url":"https://avatars.githubusercontent.com/u/266415?v=3","gravatar_id":"","url":"https://api.github.com/users/neekfenwick","html_url":"https://github.com/neekfenwick","followers_url":"https://api.github.com/users/neekfenwick/followers","following_url":"https://api.github.com/users/neekfenwick/following{/other_user}","gists_url":"https://api.github.com/users/neekfenwick/gists{/gist_id}","starred_url":"https://api.github.com/users/neekfenwick/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/neekfenwick/subscriptions","organizations_url":"https://api.github.com/users/neekfenwick/orgs","repos_url":"https://api.github.com/users/neekfenwick/repos","events_url":"https://api.github.com/users/neekfenwick/events{/privacy}","received_events_url":"https://api.github.com/users/neekfenwick/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-05-05T09:52:57Z","updated_at":"2015-05-05T14:53:22Z","closed_at":null,"body":"I'm not sure if this is a true Issue or not, but my experience with RESTful javascript stores, in the Dojo project dojo/store/JsonRest, it always recommend specifying the target of the store with a trailing slash, e.g. /api/SomeThing/ .. this means that when a query for all objects is done, the request is to /api/SomeThing/ and when a specific resource is requested by ID, the request is to /api/SomeThing/1234.\r\n\r\nI find that with tonic, specifying '/api/SomeThing/' as the target results in the Request classes getURIFromEnvironment() function resolving the uri as /api/SomeThing.  This means that when I specify the endpoint in the comment as `@uri /api/SomeThing/` and hit /api/SomeThing/ in a request, it fails to find my Resource, because the Request's uri attribute isn't actually what as in the HTTP request.\r\n\r\nOf course this is easy to work around by simply specifying `@uri /api/SomeThing`, and then calling either /api/SomeThing or /api/SomeThing/ both hit that Resource.\r\n\r\nDo you think it's buggy, that getURIFromEnvironment() resolves the uri to something other than was in the original request?"},"comment":{"url":"https://api.github.com/repos/peej/tonic/issues/comments/99103545","html_url":"https://github.com/peej/tonic/issues/191#issuecomment-99103545","issue_url":"https://api.github.com/repos/peej/tonic/issues/191","id":99103545,"user":{"login":"neekfenwick","id":266415,"avatar_url":"https://avatars.githubusercontent.com/u/266415?v=3","gravatar_id":"","url":"https://api.github.com/users/neekfenwick","html_url":"https://github.com/neekfenwick","followers_url":"https://api.github.com/users/neekfenwick/followers","following_url":"https://api.github.com/users/neekfenwick/following{/other_user}","gists_url":"https://api.github.com/users/neekfenwick/gists{/gist_id}","starred_url":"https://api.github.com/users/neekfenwick/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/neekfenwick/subscriptions","organizations_url":"https://api.github.com/users/neekfenwick/orgs","repos_url":"https://api.github.com/users/neekfenwick/repos","events_url":"https://api.github.com/users/neekfenwick/events{/privacy}","received_events_url":"https://api.github.com/users/neekfenwick/received_events","type":"User","site_admin":false},"created_at":"2015-05-05T14:53:22Z","updated_at":"2015-05-05T14:53:22Z","body":"I have found that since upgrading my installed tonic library to 3.2, I am having to go back over a few systems I built and remove that trailing slash from the `@uri` annotation.  It looks like whatever previous version of tonic I had supported the trailing slash but the newer versions strip it, so it feels like a regression to me.\r\n\r\nI'm hoping you don't need me to dig around and find exactly what version I had, it should be easy enough to prove that calling an endpoint with the trailing slash gets it stripped in the way I describe, and I hope you do consider it to be bad behaviour on the part of tonic.  For now, I'll fix my code, but I guess it'll break again if this behaviour is fixed in tonic."}}