-
-
Notifications
You must be signed in to change notification settings - Fork 4
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
"self" links, "hrefSchema", and collections #7
Comments
Related: Is it possible for a resource to have more than one "self" link? I mean where the resource is the context of the link, not the situation where there are "self" links attached to, for instance, individual array items within a larger resource. In that case, each "self" link has a different context so there is still only one per context. It's definitely possible for the same abstract resource to be accessible at multiple URIs, but would those other URIs also be "self" links or would at most one be "canonical" and the others be "alternate"? |
Hi, i am working on project . It's based on json and json schema. In practice href depends from server which keep document. For example json document has been sent from one server to another. It's will be different hyper schema elements for one document and ever different id and related schema's $ref. Really i was inspired by hyper schema first. Especially by media types. I think hyper schema is movement to graphql technology. |
@MetaAbstract it is great to hear from someone working with JSON Hyper-Schema, thanks for letting us know! Please send announcements such as this, as well as general questions, to the JSON Schema Google group/mailing list. Issues such as this are focused on a single topic, and off-topic comments will generally be removed to help us focus on the primary topic. |
Some times ago, I started using "search" links but didn't not pay much attention to what the target the relation should be and I instead designed them to point to search results. I did use On the other hand, following the actual semantics of the relation type, the "search interface" would be a search form which input would be populated according to (I need more time to think about other parts of the issue.) |
@handrews i am in forum already:) , but my comment was about you question
|
@MetaAbstract I'm afraid something is being lost in translation. I do not follow how your comment relates to the question that you quoted. Trying to figure it out, I'm looking at:
Yes, this is true, and a fundamental principle of JSON Hyper-Schema. But it's not relevant to this issue. The question is which link relation the server should chose, not whether the server chooses the link relation. |
Yeah, it's really geared towards interactive hypermedia. "hrefSchema" itself would be the "form" in this case. And we don't have a good way to write link target URIs within the schema (link targets are relative to the instance base, and there is currently no way to access the schema's base URI). I'm not particularly trying to use "search" here. I just brought it up because it seems relevant, but is not actually quite right. |
There are some things that are not addressed here, and most importantly this highlights the problems that I wrote about in issue #421. Hopefully they are more clear when laid out like this and noted in CREFs. I feel like it is a prerequisite of a hypermedia format that claims to be feature-complete to be able to recognize self-describing collections and make use of them without having specific knowledge of the data type of their contents.
There are some things that are not addressed here, and most importantly this highlights the problems that I wrote about in issue #421. Hopefully they are more clear when laid out like this and noted in CREFs. I feel like it is a prerequisite of a hypermedia format that claims to be feature-complete to be able to recognize self-describing collections and make use of them without having specific knowledge of the data type of their contents.
There are some things that are not addressed here, and most importantly this highlights the problems that I wrote about in issue #421. Hopefully they are more clear when laid out like this and noted in CREFs. I feel like it is a prerequisite of a hypermedia format that claims to be feature-complete to be able to recognize self-describing collections and make use of them without having specific knowledge of the data type of their contents.
I suspect we'll need to put draft-07 out and provoke some more feedback before this can really be addressed. I'm going to move it to the "future" milestone and call what we have good enough for a draft. It is only a draft after all- gathering feedback is the point at this stage. Here are the two CREFs that will be left in the draft to help provoke feedback, both attached to the
|
I guess the
And the hyper-schema spec could even define that the
|
While working on the rewrite, it occurred to me that using
hrefSchema
with a "self" link doesn't make much sense. So I wrote up a bit on howhrefSchema
MUST NOT be used with a "self" link, andhrefRequired
SHOULD be used to ensure that the self link can always fully resolve from instance data (or if i cannot, it cannot be used).Then I thought about collections, with filtering and pagination. What does "self" mean in such a case? Strictly speaking, a page of a filtered collection is not the same resource as an unfiltered, unpaginated collection. Or a different page from the same filter, etc. etc. Similar concepts apply to other resources that are logically "modified" or made into a sub-resource by query parameters.
However, there is no inherent distinction between this use of query parameters and a use that produces entirely different resources which are only distinguished by non-hierarchical identifiers.
So if a "self" link MUST NOT use
hrefSchema
(which is a debatable point), how does a collection or similar resource expose its pagination/filtering/whatever interface for users?While there are numerous pagination link relations, they should not take user input for the page parameters either. A "first" link must always go to the first page, a "next" link must always go to the next page, whatever that means.
Using a "collection" link alongside of "self" to specify
hrefSchema
for pagination/filtering/etc doesn't seem to work, as setting the context of "collection" correctly in this scenario is more or less impossible (if there are no items in the collection, then it is entirely impossible).There is a "search" link relation that has as it's target a description of an interface to search the context. This seems close to what we want, although the target would ideally be the
hrefSchema
of... um... something? Ugh.. brain hurts. Anyone have ideas on this?The text was updated successfully, but these errors were encountered: