-
Notifications
You must be signed in to change notification settings - Fork 172
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
#/definitions/article/links/1/href: failed schema #285
Comments
I think this may just be a consistency thing. Having an href there of either |
Hi,
If equivalent in usage, they still can be considered semantically different: I 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. From 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). I know there's an infinitely long debate here, let's not start another (Woops, I started, I'm very sorry, and not proud):
But I know it's controversial:
Very controversial:
Yet ... 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 ? So if you're definitely on the "no trailing /" side, a warning should be more appropriate than a "throw exception and exit" here ? |
Fair point, I'd never really thought about/worried about it very deeply to be honest (hence my comment about interchangeability), for me they were roughly equivalent and in cases where there are equivalences I like to just pick one and stick with it. That said, I still don't feel particularly strongly about this one way or another, I'm amenable to allowing the trailing slash, would you be up for making a pull request to loosen the expectation? Thanks! |
Hi,
I'm getting a:
Which is true, I have a:
Which 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").
Why does URI with a trailing are forbidden ? They look right to me, can you allow it in the URL regex ?
The text was updated successfully, but these errors were encountered: