Skip to content

Commit 9ed48cd

Browse files
committed
Further simplication of link objets by removing the anchor target attribute and language changes.
1 parent bf45cb4 commit 9ed48cd

File tree

1 file changed

+38
-41
lines changed

1 file changed

+38
-41
lines changed

_format/1.1/index.md

Lines changed: 38 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -746,38 +746,19 @@ of this member **MUST** be an object (a "links object").
746746
<a href="#document-links-link" id="document-links-link"></a>
747747
Within this object, a link **MUST** be represented as either:
748748

749-
* a URI-reference [[RFC3986 Section 4.1](https://tools.ietf.org/html/rfc3986#section-4.1)] to the link's target.
750-
* <a id="document-links-link-object"></a>an object ("link object") which **MAY**
751-
contain the following members:
752-
* `href`: a URI-reference [[RFC3986 Section 4.1](https://tools.ietf.org/html/rfc3986#section-4.1)] to the link's target.
753-
* `rel`: a [link relation type][link relation type] defining the semantics of
754-
the link.
755-
* `anchor`: a URI-reference [[RFC3986 Section 4.1](https://tools.ietf.org/html/rfc3986#section-4.1)]
756-
to the link's context. By default, the context of a link is the
757-
[top-level object][top level], [resource object][resource objects], or
758-
[relationship object][relationships] in which the link appears.
759-
* `describedby`: a [link] to a description document (e.g. OpenAPI or JSON
760-
Schema) for the link target.
761-
* `title`: a string which serves as a label for the destination of a link
762-
such that it can be used as a human-readable identifier (e.g., a menu
763-
entry) in the language indicated by the `Content-Language` header field (if
764-
present).
765-
* `type`: a string a which serves as a hint indicating the media type of the
766-
target resource.
767-
* `hreflang`: a string or an array of strings which serve as a hint
768-
indicating the language of target resource. An array of strings indicates
769-
that multiple languages of the target resource are available. Each string
770-
**MUST** be a valid language tag
771-
[[RFC5646](https://tools.ietf.org/html/rfc5646)].
772-
* `meta`: a meta object containing non-standard meta-information about the
773-
link.
749+
* a string whose value is a URI-reference [[RFC3986 Section 4.1](https://tools.ietf.org/html/rfc3986#section-4.1)]
750+
pointing to the link's target.
751+
* a [link object]
774752

775-
> Note: the `type` and `hreflang` members are only hints; the target resource
776-
> is not guaranteed to be available in the indicated media type or language
777-
> when the link is actually followed.
753+
A link's relation type **SHOULD** be inferred from the name of the link unless a
754+
`rel` member is present on the [link object].
778755

779-
In the example below, the `self` link is simply a URI string, whereas the
780-
`related` link uses the object form to provide meta information about a
756+
A link's context is the [top-level object][top level], [resource
757+
object][resource objects], or [relationship object][relationships] in which its
758+
parent links object appears.
759+
760+
In the example below, the `self` link is a string, whereas the `related` link
761+
is a [link object]. The link object provides additional information about a
781762
related resource collection as well as a schema that serves as a description
782763
document for that collection:
783764

@@ -786,6 +767,7 @@ document for that collection:
786767
"self": "http://example.com/articles/1/relationships/comments",
787768
"related": {
788769
"href": "http://example.com/articles/1/comments",
770+
"title": "Comments",
789771
"describedby": "http://example.com/schemas/article-comments",
790772
"meta": {
791773
"count": 10
@@ -794,21 +776,36 @@ document for that collection:
794776
}
795777
```
796778

797-
##### <a href="#document-links-link-relation-type" id="document-links-link-relation-type" class="headerlink"></a> Link relation type
779+
#### <a id="document-links-link-object"></a> Link objects
780+
781+
A "link object" is an object that represents a [web link](https://tools.ietf.org/html/rfc8288).
798782

799-
The value of the `rel` member **MUST** be a string that represents a link relation
800-
type. Valid link relation types are defined by
801-
[RFC8288 Section 2.1](https://tools.ietf.org/html/rfc8288#section-2.1).
783+
A link object **MUST** contain the following member:
802784

803-
If a `rel` member is not given on a link object, the link's relation type
804-
**SHOULD** be inferred from the name of the link object.
785+
* `href`: a string whose value is a URI-reference [[RFC3986 Section 4.1](https://tools.ietf.org/html/rfc3986#section-4.1)]
786+
pointing to the link's target.
805787

806-
In order to represent a link with reversed semantics, it is **RECOMMENDED**
807-
that an alternate link relation type be used or, less preferably, that the
808-
`anchor` and `href` members be interchanged.
788+
A link object **MAY** also contain any of the following members:
809789

810-
> Note: Historically, a `rev` link parameter was used for this purpose but has
811-
> since been deprecated by [RFC8288 Section 3.3](https://tools.ietf.org/html/rfc8288#section-3.3).
790+
* `rel`: a string indicating the link's relation type. The string **MUST** be a
791+
[valid link relation type](https://tools.ietf.org/html/rfc8288#section-2.1).
792+
* `describedby`: a [link] to a description document (e.g. OpenAPI or JSON
793+
Schema) for the link target.
794+
* `title`: a string which serves as a label for the destination of a link
795+
such that it can be used as a human-readable identifier (e.g., a menu
796+
entry) in the language indicated by the `Content-Language` header field (if
797+
present).
798+
* `type`: a string indicating the media type of the link's target.
799+
* `hreflang`: a string or an array of strings indicating the language(s) of the
800+
link's target. An array of strings indicates that multiple languages of the
801+
link's target are available. Each string **MUST** be a valid language tag
802+
[[RFC5646](https://tools.ietf.org/html/rfc5646)].
803+
* `meta`: a meta object containing non-standard meta-information about the
804+
link.
805+
806+
> Note: the `type` and `hreflang` members are only hints; the target resource
807+
> is not guaranteed to be available in the indicated media type or language
808+
> when the link is actually followed.
812809
813810
### <a href="#document-jsonapi-object" id="document-jsonapi-object" class="headerlink"></a> JSON:API Object
814811

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy