-
-
Notifications
You must be signed in to change notification settings - Fork 309
How to handle multiple "rel" values per RFC 5988 #350
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
it definitely would be nice to have consistent patterns across JSON models for links. but it most definitely is not necessary. just look at how HAL drives everything from the relation: then you end up with a quite different view of how to represent links. |
It seems to me that one difference between JSON Schema's LDO and linkset's link definition is that the latter closely refers to RFC5988(bis) while the former redefines link object's properties. So maybe the question is whether there are use-cases for multiple "rel" values on a single object, especially since this would just be a shortcut to avoid repeating a link definition. Personally, I'd favor simplicity and explicitness over making the spec more complex just for a "shortcut". (No strong opinion though.) |
On Aug 19, 2017, at 03:38, Denis Laxalde ***@***.***> wrote:
It seems to me that one difference between JSON Schema's LDO and linkset's link definition is that the latter closely refers to RFC5988(bis) while the former redefines link object's properties. So maybe the question is whether there are use-cases for multiple "rel" values on a single object, especially since this would just be a shortcut to avoid repeating a link definition. Personally, I'd favor simplicity and explicitness over making the spec more complex just for a "shortcut". (No strong opinion though.)
we had the exact same discussion for linkset JSON and decided to go with the "idiom" that people are probably familiar with because of its support in the native syntax. but you're absolutely right that it's just a shortcut and slightly complicates the representation and processing.
dret/I-D#73
|
@dret, @dlax yeah, I think making it a mandatory array makes sense in the JSON linkset serialization. For JSON Hyper-Schema, if we agree that we can use If we go that route, then I think we would also explicitly forbid multiple values in the |
On Aug 19, 2017, at 11:42, Henry Andrews ***@***.***> wrote:
If we go that route, then I think we would also explicitly forbid multiple values in the rel string. While the current wording does not support multiple values, it's a reasonable enough inference to apply it from other serializations so I think we should address it directly.
absolutely. it's a popular idiom/microsyntax, so it's good to address it explicitly.
|
OK, I'm going to mark this as blocked on #319, since whether we implement that has a pretty big impact on our options here. It doesn't sound like there's anyone (yet) objecting to solving this with LDO references, if we decide to support LDO references. While an array value is definitely the right idiom in plain JSON, I think it's reasonable to consider references a suitable idiom on JSON Hyper-Schema. And if not, that will probably become more clear after we nail down #319 one way or the other. |
Moving this out of consideration for the current draft as #319 is also deferred. |
At this point I think the correct solution is to follow the precedent of As noted in #124 (comment) I'm still inclined to keep Anyone have strong objections to following |
tagging @hvdsomp so that he knows what's going on elsewhere... |
Forgot to close this when #615 was merged. |
@dret has been looking at this issue with respect to JSON serialization for his linkset I-D, and is going in the direction that
"rel"
should always be an array. We could match this (and potentially other things from the linkset work, as having JSON Hyper-Schema LDOs be compatible seems like it would be nice, see also #7 Link Attributes in JSON Hyper-Schema).This would look like:
There are two obvious alternatives for JSON Schema:
"$ref"
for LDOs #319 and allow"$ref"
for LDOs:Of course, we could both accept
"linkDefinitions"
(#319) and specify that"rel"
MUST be an array, as there are other use cases for"linkDefinitions"
. So we may want to satisfy those use cases and also be compatible with linkset serializations, which would require doing both of these things.We could also allow
"rel"
to be either an array or a single value. I dislike that sort of thing, but there is a precedent with"type"
where it is also true that the vast majority of uses call for only a single value. That way we could give people the option of linkset compatibility but also allow for a JSON Hyper-Schema-specific shorthand.The text was updated successfully, but these errors were encountered: