gs1 / EPCIS

Draft files being shared for EPCIS 2.0 development
Other
20 stars 7 forks source link

Maybe REST API HATEOAS links should use the draft-ietf-httpapi-linkset-05 RFC #351

Closed VladimirAlexiev closed 2 years ago

VladimirAlexiev commented 2 years ago

(@mgh128 and @CraigRe I submitted a CommunityReview issue 30 min ago, but we cannot edit them to provide any extra info, so I'm posting a github issue as well).

@domguinard: At the Nov 9 call we discussed what should eg REST /bizSteps or /bizSteps/receiving return: a list of HATEOAS links.

https://www.gs1.org/docs/Digital-Link/GS1_Global_Office_Resolver.pdf refers to https://datatracker.ietf.org/doc/html/draft-ietf-httpapi-linkset-05. That RFC describes a format for returning links, either in JSON payload (with appropriate media type) or using Link header(s).

Dom, could you evaluate if we should use this RFC spec? Note: H. Van de Sompel is the creator of OAI PMH and Memento, so he knows about linking resources

GS1_Global_Office_Resolver.pdf gives an example of what these links could look like for the purpose of DigitalLinks, eg

curl -Haccept:application/json https://id.gs1.org/01/09506000134369?linkType=all
{
  "linkset": [
    {
      "anchor": "https://id.gs1.org/01/09506000134369",
      "itemDescription": "Dal Giardino Extra Virgin Olive Oil Exclusive Selection 1L",
      "unixtime": 1634118628,
      "https://gs1.org/voc/defaultLink": [
        {
          "href": "https://dalgiardino.com/extra-virgin-olive-oil/",
          "title": "Product information"
        }
      ],
      "https://gs1.org/voc/defaultLinkMulti": [
        {
          "href": "https://dalgiardino.com/extra-virgin-olive-oil/",
          "title": "Product information",
          "type": "text/html",
          "hreflang": [
            "en"
          ]
        },
        {
          "href": "https://dalgiardino.com/extra-virgin-olive-oil/index.html.ja",
          "title": "Product information",
          "type": "text/html",
          "hreflang": [
            "ja"
          ]
        }
      ],
      "https://gs1.org/voc/hasRetailers": [
        {
          "href": "https://dalgiardino.com/where-to-buy/",
          "title": "Where to buy",
          "type": "text/html",
          "hreflang": [
            "en"
          ]
        }
      ],
      "https://gs1.org/voc/pip": [
        {
          "href": "https://dalgiardino.com/extra-virgin-olive-oil/",
          "title": "Product information",
          "type": "text/html",
          "hreflang": [
            "en"
          ]
        },
        {
          "href": "https://dalgiardino.com/extra-virgin-olive-oil/index.html.ja",
          "title": "Product information",
          "type": "text/html",
          "hreflang": [
            "ja"
          ]
        }
      ]
    }
  ]
}

@domguinard if you think that

... then just reject this issue.