Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.
Sign upallowing multiple link relation types in rel in the JSON serialization #122
Comments
This comment has been minimized.
This comment has been minimized.
gabesullice
commented
yesterday
•
Here is my formatted message: I think there might be an inconsistency between The link header serialization says "The rel parameter can, however, contain multiple link relation types." https://tools.ietf.org/html/rfc8288#section-3.3 However, in the JSON serialization you define, it appears that it can only support a single link relation type. Unless you mean for user agents to: a. deduplicate links that share a common context and target but a different If either of those is the case, I think it would be good to explicitly give that example. OTOH, I think I would prefer if your link object replaced the |
This comment has been minimized.
This comment has been minimized.
Could it be that you are reacting to version 3 of the Internet Draft, and not version 4 that was released today? See https://tools.ietf.org/html/draft-wilde-linkset-04 |
This comment has been minimized.
This comment has been minimized.
gabesullice
commented
yesterday
@hvdsomp, I followed @dret's tweet directly to version 4. Here is the line in question: https://github.com/dret/I-D/blob/master/linkset/draft-wilde-linkset-04.txt#L351 Specifically:
Consequently, a link context object can have one ore more link target objects but those links can only have a single relation type. The example also makes this clear: {
"linkset":
[
{ "anchor":"http://example.net/bar",
"item": [
{"href": "http://example.com/foo1"},
{"href": "http://example.com/foo2"}
]
}
]
} Which we can reformat into a link header as:
However, how would one serialize this link header back into JSON?
It's not clear in the current draft (v4). There is an example of a link header with multiple link relation types in RFC 8288 (search for What I proposed at the end of my message would look like this: {
"linkset":
[
{ "anchor":"http://example.net/bar",
"target": [
{"href": "http://example.com/foo1",
"rel": ["item", "http://example.net/relation/other1"]},
{"href": "http://example.com/foo2",
"rel": ["item", "http://example.net/relation/other2"]}
]
}
]
} |
This comment has been minimized.
This comment has been minimized.
According to the current spec 04, these links conveyed in a Link header:
would be expressed as JSON as follows:
You are right that the current I-D does not provide such an example and I agree that it should. At first glance, it looks like the syntax you propose could also be a possibility. We have based the current approach on input from @stain and his proposal was inspired by the JSON serialization used for the W3C Web Annotation Data Model. A requirement that resulted from interactions with @stain and @csarven about the serialization is that it should be possible to turn the JSON serialization into a JSON-LD one by adding context. The I-D mentions this. |
dret commentedyesterday
•
edited
this was raised by @gabesullice (https://httpapis.slack.com/archives/C1JQJUF2T/p1567024238000700?thread_ts=1567009616.000200&cid=C1JQJUF2T):
[...] (deleted because @gabesullice now submitted his own version.)