-
-
Notifications
You must be signed in to change notification settings - Fork 313
Hyper-schema: "create" is not an IANA link relation #47
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
Comments
Apparently the "rel"s are supposed to be URIs already? It's not clear to me how that is supposed to work, but it seems like @geraintluff had something in mind for this? I think it's worth considering a bit of inspiration from JSON-LD's notion of a "context" to allow working with concise names for unregistered relations. I'd call it something like |
Take a look at the RFC for Web Linking and HTML, rel can be an On Sep 17, 2016 14:28, "Henry Andrews" [email protected] wrote:
|
@awwright Are you talking about the "Context IRI"? That defaults to the IRI of the current resource, which I believe would be the schema document. That would mean that the "create" rel in each schema is in fact a different relation from the "create" rels in any other schema. While that definitely avoids relation URI collisions, it also makes the relations overly specific by default. (also, should JSON Schema be specifying IRI in place of URI anywhere? Even the web linking RFC mixes IRIs and URIs in a way that I find totally confusing). |
What Geraint was saying is that "rel" is also a URI reference, very much the same way "href" is. See the definition in Web Linking. And so he figures why can't we use templates there, too? The difference is you have to specify either a full URI or an IANA-registered keyword. If you specify a keyword, it's resolved against the special URI base < As for IRI, if we switch to using IRI we gain the ability to use Unicode characters in links. I suppose that could be useful, I'll make an issue. |
@awwright Understand that |
@handrews In that case you'd get Addition of a link relation to that registry can be requested by anyone, but it requires expert review. |
OK. So as mentioned in issue #48 just now, JSON Hyper-schema proposes If we register a
|
fwiw, I'm not actually opposed to the idea of a "create" link relation, having an explicit "append this to a collection" resource might be useful (normally you just POST to the collection), but it really has no business being in JSON Schema. |
Should we be using "create-form" and "edit-form"? I'm not entirely clear on this point, but I think that despite the name these links are not specific to HTML forms. They just indicate a submittable resource. Given that "create-form" requires HTTP POST unless otherwise specified, and "edit-form" similarly requires HTTP PUT, these relations fit very well with the principle of not specifying HTTP methods in JSON Hyper-Schema (I'm increasingly coming around to this position due to JSON Home addressing the things for I would have needed explicit HTTP method specification). And by "using", I mean "not defining other links in the Hyper-Schema spec that do the same thing as these". I don't mean requiring their use. |
edit-form and create-form are intended to link to an actual HTML form that On Oct 12, 2016 12:28 PM, "Henry Andrews" [email protected] wrote:
|
Is that required by the use of the words "input form"? The word "browser" does not appear anywhere in the RFC, just "automated agent". I was reading this sentence:
to mean that while HTML forms motivated the links, they could be used more broadly. I suppose that just means for media types that also only produce interactive forms? |
Well, but more specifically it's going to show you a document that contains Right now the only thing that can do this in any capacity is HTML though. On Oct 12, 2016 12:44 PM, "Henry Andrews" [email protected] wrote:
|
I believe I fixed this to my satisfaction, I'll go ahead and close this out B-) |
For anyone else who comes along and reads this, @awwright fixed it by removing all of the relation declarations (I agree they have no place here). |
Is there an intention to later add this kind of functionality back or not? I could see how it could be useful, but it may be already covered by other parts of the spec (I don't know) |
If someone can tell me how the functionality is useful, we can figure out if it's a good fit for JSON Hyper-schema and how to implement it if so. The stuff that was taken out was either unused or not in-scope for a hypermedia media type. This is the only significant case where actual functionality was changed. |
From the perspective of where I intend to use json-schema, it kind of has a nice fit. Although, that sort of functionality may be better left to specifications which are designed for specifying an API, like RAML. |
The JSON Hyper-schema spec currently lists the following
But this isn't a useful link relation because there's no such thing as a "create" link.
The place that would best define how to create resources would probably AtomPub, see https://tools.ietf.org/rfc/rfc5023.txt
The specification does later define "create", but it should normatively reference the IANA registry instead.
The text was updated successfully, but these errors were encountered: