dret / I-D

Internet Drafts I've authored or contributed to.
16 stars 13 forks source link

How to represent more than one link the same anchor and link relation type with JSON? #143

Closed gabesullice closed 3 years ago

gabesullice commented 3 years ago

There are many link relation types that could easily be used by more than a single link. E.g. author, item, related, stylesheet, subsection, etc.

This figure clearly shows it is possible with Link header format, but the JSON example does not.

It seems that the intent is for the linkset array to contain multiple link context objects with the same anchor value, but this is not explicitly stated or exemplified. Am I interpreting the intent correctly?

The fact that the application/linkset example shows this scenario but the application/linkset+json example does not seems like an intentional omission. Is that true?

hvdsomp commented 3 years ago

I think this was discussed in quite some detail in the closed issue https://github.com/dret/I-D/issues/122

dret commented 3 years ago

can you please check out #122 and either close this one here or let us know more specifically what is different about this new issue, @gabesullice? thanks!

gabesullice commented 3 years ago

122 was about the case where a single link has more than one rel.

Link: </resource>; rel="foo bar"

This issue is about the case where there is more than one link with the same rel:

Link: </jane-doe>; rel="author"
Link: </john-doe>; rel="author"

However, I just looked at the same figure that I linked and I clearly see now that there's an array of objects under the "item" rel:

      "item": [
        {
          "href": "https://example.org/article/7507/item/1",
          "type": "application/pdf"
        },
        {
          "href": "https://example.org/article/7507/item/2",
          "type": "text/csv"
        }
      ]

I genuinely don't know how I missed that. I was staring right at it! Sorry for the distraction.