{"action":"created","issue":{"url":"https://api.github.com/repos/zalando/connexion/issues/346","repository_url":"https://api.github.com/repos/zalando/connexion","labels_url":"https://api.github.com/repos/zalando/connexion/issues/346/labels{/name}","comments_url":"https://api.github.com/repos/zalando/connexion/issues/346/comments","events_url":"https://api.github.com/repos/zalando/connexion/issues/346/events","html_url":"https://github.com/zalando/connexion/issues/346","id":189738479,"number":346,"title":"Trailing slash endpoint routing returns 404","user":{"login":"tomas-fp","id":19695060,"avatar_url":"https://avatars.githubusercontent.com/u/19695060?v=3","gravatar_id":"","url":"https://api.github.com/users/tomas-fp","html_url":"https://github.com/tomas-fp","followers_url":"https://api.github.com/users/tomas-fp/followers","following_url":"https://api.github.com/users/tomas-fp/following{/other_user}","gists_url":"https://api.github.com/users/tomas-fp/gists{/gist_id}","starred_url":"https://api.github.com/users/tomas-fp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tomas-fp/subscriptions","organizations_url":"https://api.github.com/users/tomas-fp/orgs","repos_url":"https://api.github.com/users/tomas-fp/repos","events_url":"https://api.github.com/users/tomas-fp/events{/privacy}","received_events_url":"https://api.github.com/users/tomas-fp/received_events","type":"User","site_admin":false},"labels":[{"id":213413500,"url":"https://api.github.com/repos/zalando/connexion/labels/bug","name":"bug","color":"fc2929","default":true}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2016-11-16T15:30:38Z","updated_at":"2016-11-21T15:55:48Z","closed_at":null,"body":"### Description\r\n\r\nIt's well-known that most HTTP routers deals with the trailing slash accordingly, matching both `/foo` or `/foo/` path expressions.\r\n\r\nI'm not sure if this was already supported and can be easily enabled programmatically.\r\n\r\n### Expected behaviour\r\n\r\nMatching the route and reply with a `301` status and redirect it accordingly to `/foo` (however redirection can be optional).\r\n\r\n### Actual behaviour\r\n\r\n`404` status code is returned instead.\r\n\r\n### Steps to reproduce\r\n\r\nJust make an HTTP request against a valid endpoint in a connext+Flask app adding a final slash.\r\n\r\n### Additional info:\r\n\r\n- `python 3.5.2`\r\n- `connexion version 1.0.129`\r\n"},"comment":{"url":"https://api.github.com/repos/zalando/connexion/issues/comments/261978207","html_url":"https://github.com/zalando/connexion/issues/346#issuecomment-261978207","issue_url":"https://api.github.com/repos/zalando/connexion/issues/346","id":261978207,"user":{"login":"tomas-fp","id":19695060,"avatar_url":"https://avatars.githubusercontent.com/u/19695060?v=3","gravatar_id":"","url":"https://api.github.com/users/tomas-fp","html_url":"https://github.com/tomas-fp","followers_url":"https://api.github.com/users/tomas-fp/followers","following_url":"https://api.github.com/users/tomas-fp/following{/other_user}","gists_url":"https://api.github.com/users/tomas-fp/gists{/gist_id}","starred_url":"https://api.github.com/users/tomas-fp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tomas-fp/subscriptions","organizations_url":"https://api.github.com/users/tomas-fp/orgs","repos_url":"https://api.github.com/users/tomas-fp/repos","events_url":"https://api.github.com/users/tomas-fp/events{/privacy}","received_events_url":"https://api.github.com/users/tomas-fp/received_events","type":"User","site_admin":false},"created_at":"2016-11-21T15:55:47Z","updated_at":"2016-11-21T15:55:47Z","body":"Apparently Flask, based on Werkzeug’s routing module, does a redirection only if a trailing slash is present, otherwise, the expected behaviour would be a 404 response error, as we have now. \r\nSee section \"Unique URLs / Redirection Behavior\":\r\nhttp://flask.pocoo.org/docs/0.11/quickstart/#variable-rules\r\n\r\nI suspect that `connexion` should register an additional route that matches the same route with a trailing slash, but I think that behaviour should not be supported by default, instead, it should be explicitly enabled, perhaps via a custom `x-*` directive at OpenAPI spec endpoint level.\r\n\r\nWhat do you guys think?"}}
{"actor":{"display_login":"tomas-fp"}}