You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It's usual for collections to end the URL with a trailing slash. I know the server answers the same way to requests with and without a trailing slash (and that is good), but I would like to always show the trailing slash in the self link when referring to collections.
The spec doesn't touch this point, but I believe the self link should always be the same for the same resource. Right now it only reflects whatever the client has requested. So a request to /articles results in "self": "/articles" and a request to /articles/ results in "self": "/articles/". They have a different link but refers to the same collection.
This also complicates my integration tests, because I have to be consistent when making the requests to always use the trailing slash, otherwise I'll have a false alarm.
My proposal is to always use the trailing slash for collections (since they are akin to directories in a filesystem) and always show that in the self link, even if the server responds to both addresses. I'm okay with removing the trailing slash too, but at least be consistent.
The text was updated successfully, but these errors were encountered:
I agree with being consistent, and I also prefer the trailing backslash as a best practice. We will get round to addressing this at some point, but if you're willing to submit a PR to fix it we'll be very happy to review and merge it.
It's usual for collections to end the URL with a trailing slash. I know the server answers the same way to requests with and without a trailing slash (and that is good), but I would like to always show the trailing slash in the
self
link when referring to collections.The spec doesn't touch this point, but I believe the
self
link should always be the same for the same resource. Right now it only reflects whatever the client has requested. So a request to/articles
results in"self": "/articles"
and a request to/articles/
results in"self": "/articles/"
. They have a different link but refers to the same collection.This also complicates my integration tests, because I have to be consistent when making the requests to always use the trailing slash, otherwise I'll have a false alarm.
My proposal is to always use the trailing slash for collections (since they are akin to directories in a filesystem) and always show that in the
self
link, even if the server responds to both addresses. I'm okay with removing the trailing slash too, but at least be consistent.The text was updated successfully, but these errors were encountered: