-
Notifications
You must be signed in to change notification settings - Fork 93
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
Inconsistent meaning of field “href” #29
Comments
For link objects the Maybe we could add a "type" property on link objects with the value |
For the record, @vivienlacourba pointed me to That last thread seems to indicate that there's no obvious way to tell apart links that stay within the API from links to anything else in the world. @vivienlacourba: can we at least have that |
FWIW, my two API clients don't need this any more: I'm mostly hard-coding fields and properties (for reasons outlined in #73 (comment)), so my clients know how to tell apart subsequent API calls from other URIs. In the worst case, I can look at the origin of any link and see if it matches the origin I know for the API (it's a bit ugly, but this issue isn't progressing, and the ideal of full auto-discoverability isn't feasible anyway). |
In the API,
href
sometimes contains a HATEOAS reference (another URL for the API where more data can be discovered), and sometimes it contains a regular URL intended for humans (eg, the URL of a page or image underw3.org
).For example, look at all values returned inside
href
properties here:https://api-test.w3.org/groups/68239
This may not seem like a big deal, but when trying to use the API programmatically (without hard-coding field names etc), this is an issue. Apiary doesn't know if a
href
is a hyperlink it should simply return to the user, or a pointer to fetch more information from the API. (Yes, it could check the beginning of the URL, but I think that is a weak patch for the issue.)I suggest we always use
href
only for API URLs, andurl
only for URLs of resources outside the API.The text was updated successfully, but these errors were encountered: