{"action":"created","issue":{"url":"https://api.github.com/repos/interagent/prmd/issues/285","repository_url":"https://api.github.com/repos/interagent/prmd","labels_url":"https://api.github.com/repos/interagent/prmd/issues/285/labels{/name}","comments_url":"https://api.github.com/repos/interagent/prmd/issues/285/comments","events_url":"https://api.github.com/repos/interagent/prmd/issues/285/events","html_url":"https://github.com/interagent/prmd/issues/285","id":142966311,"number":285,"title":"#/definitions/article/links/1/href: failed schema","user":{"login":"JulienPalard","id":239510,"avatar_url":"https://avatars.githubusercontent.com/u/239510?v=3","gravatar_id":"","url":"https://api.github.com/users/JulienPalard","html_url":"https://github.com/JulienPalard","followers_url":"https://api.github.com/users/JulienPalard/followers","following_url":"https://api.github.com/users/JulienPalard/following{/other_user}","gists_url":"https://api.github.com/users/JulienPalard/gists{/gist_id}","starred_url":"https://api.github.com/users/JulienPalard/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JulienPalard/subscriptions","organizations_url":"https://api.github.com/users/JulienPalard/orgs","repos_url":"https://api.github.com/users/JulienPalard/repos","events_url":"https://api.github.com/users/JulienPalard/events{/privacy}","received_events_url":"https://api.github.com/users/JulienPalard/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2016-03-23T13:58:17Z","updated_at":"2016-03-24T16:38:58Z","closed_at":null,"body":"Hi,\r\n\r\nI'm getting a:\r\n\r\n    unverified_schema.json: #/definitions/article/links/1/href: failed schema #/definitions/resourceLink/properties/href: /articles/ does not match /^(\\/((?!-|_)[a-z0-9_\\-]+(?<!-|_)|\\{\\(.*\\)\\}))+$/.\r\n\r\nWhich is true, I have a:\r\n\r\n    {\r\n        \"description\": \"List some articles.\",\r\n        \"href\": \"/articles/\",\r\n        \"method\": \"GET\",\r\n        \"rel\": \"instances\",\r\n        \"targetSchema\": {\r\n            \"$ref\": \"/schemata/article#/definitions/list_of_article\"\r\n        },\r\n        \"title\": \"Article list\"\r\n    }\r\n\r\nWhich looks right to me, listing articles (a collection, a direcrory of articles) is at \"/articles/\", not at \"/article\" (which means a file, which is different from a collection of files), linking to articles with URLs like \"/articles/1234\" (\"files\").\r\n\r\nWhy does URI with a trailing are forbidden ? They look right to me, can you allow it in the URL regex ?"},"comment":{"url":"https://api.github.com/repos/interagent/prmd/issues/comments/200916817","html_url":"https://github.com/interagent/prmd/issues/285#issuecomment-200916817","issue_url":"https://api.github.com/repos/interagent/prmd/issues/285","id":200916817,"user":{"login":"JulienPalard","id":239510,"avatar_url":"https://avatars.githubusercontent.com/u/239510?v=3","gravatar_id":"","url":"https://api.github.com/users/JulienPalard","html_url":"https://github.com/JulienPalard","followers_url":"https://api.github.com/users/JulienPalard/followers","following_url":"https://api.github.com/users/JulienPalard/following{/other_user}","gists_url":"https://api.github.com/users/JulienPalard/gists{/gist_id}","starred_url":"https://api.github.com/users/JulienPalard/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JulienPalard/subscriptions","organizations_url":"https://api.github.com/users/JulienPalard/orgs","repos_url":"https://api.github.com/users/JulienPalard/repos","events_url":"https://api.github.com/users/JulienPalard/events{/privacy}","received_events_url":"https://api.github.com/users/JulienPalard/received_events","type":"User","site_admin":false},"created_at":"2016-03-24T16:38:58Z","updated_at":"2016-03-24T16:38:58Z","body":"Hi,\r\n\r\n> Having an href there of either /articles/ or /articles should be equivalent in usage\r\n\r\nIf equivalent in usage, they still can be considered semantically different:\r\n\r\nI like to see a REST API as as simple HTTP server serving files, so, for me: \"/articles/\" is a directory (a collection), and \"/article\" is a file which does not exists. \"/articles/1\" is a file which exists, and \"/articles/1/\" is a directory which does not exists.\r\n\r\nFrom my very personal point of view, a REST API is not just bytes flowing on networks (the usage), it should me meaningfull, it should expose resouces in an expressive and semantical way, and here, trailing slash helps me being explicit and expressive (for the users).\r\n\r\nI know there's an infinitely long debate here, let's not start another (Woops, I started, I'm very sorry, and not proud):\r\n\r\n - Having a trailing slash like \"/article/\" permits relative URI like \"1\" to resolve to \"/articles/1/\" which is NOT to case with \"/article\" in which a URI like \"1\" resolve to \"/1\" which does not exists.\r\n - https://en.wikipedia.org/wiki/Representational_state_transfer#Example examples with \"/\" being collections and without \"/\" being collection members\r\n - Some blog (yeark) speaking about trailing slashes : https://cdivilly.wordpress.com/2014/03/11/why-trailing-slashes-on-uris-are-important/\r\n - I don't want to redirect \"not slash\" to \"slash\": that's a useless redirection the developper could have fixed upfront hitting a violent 404, avoiding de facto a huge number of very useless 301/302 in production (useless round-trips, useless increased load times ....)\r\n\r\nBut I know it's controversial:\r\n - https://github.com/nicolaiarocci/eve/issues/118\r\n - I don't remember seeing any reference to this in the Fielding thesis\r\n - http://masnun.com/2013/09/18/django-rest-framework-angularjs-resource-trailing-slash-problem.html\r\n\r\nVery controversial:\r\n - if /users/ is a collection of users (a directory)\r\n - and /users/1 is a user (a file)\r\n - but /users/1/posts/ is a collection of the 1st user posts\r\n - WTF did I just said ? A file having a directory in it ?\r\n\r\nYet ... the API I'm writing HyperSchema for already exists, obviously can't be changed, is already documented and used with the philosophy \"trailing slash means collection\". Does the existence of a debate, even with more people against it that agreeing on it, should prohibe us to documents this API ?\r\n\r\nSo if you're definitely on the \"no trailing /\" side, a warning should be more appropriate than a \"throw exception and exit\" here ?\r\n"}}