mnot / I-D

My Internet-Drafts
https://mnot.github.io/I-D/
Other
98 stars 38 forks source link

Correct usage of profiles within Link Hints #317

Closed RubenVerborgh closed 4 months ago

RubenVerborgh commented 4 years ago

While reading https://tools.ietf.org/html/draft-nottingham-link-hint-02, I stumbled upon:

The object MAY have a "links" member, whose value is an object representing links (in the sense of [RFC8288]) whose context is any document that uses that format. Generally, this will be schema or profile ([RFC6906]) information.

However, I am not sure how to exactly do that, given the current phrasing of the text.

Could you confirm whether the following is correct? I am trying to express that /orders/523 is available in JSON with two different profiles http://microformats.org/profile/hcard and http://example.org/other.

{
  "_links": {
    "self": {
      "href": "/orders/523",
      "hints": {
        "formats": {
          "application/json": {
            "links": {
              "self": {
                "hints": {
                  "profile": {
                    "http://microformats.org/profile/hcard": {},
                    "http://example.org/other": {}
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}

Note that I had to invent the profile key; is there a better way?