Skip to content

Commit cac493b

Browse files
authored
Merge pull request json-api#1447 from json-api/describedby
Introduce describedby link relation
2 parents 4f893f5 + 0e1e17d commit cac493b

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

_format/1.1/index.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,8 @@ The top-level [links object][links] **MAY** contain the following members:
114114
resource relationship.
115115
* `profile`: an array of [links][link], each specifying a [profile][profiles]
116116
in use in the document.
117+
* `describedby`: a [link] to a description document (e.g. OpenAPI or JSON
118+
Schema) for the current document.
117119
* [pagination] links for the primary data.
118120

119121
The document's "primary data" is a representation of the resource or collection
@@ -538,6 +540,8 @@ Within this object, a link **MUST** be represented as either:
538540
[relationship object][relationships] in which the link appears.
539541
* `params`: a [link parameter object][link parameters] describing additional
540542
information about the link or its target.
543+
* `describedby`: a [link] to a description document (e.g. OpenAPI or JSON
544+
Schema) for the link target.
541545
* `meta`: a meta object containing non-standard meta-information about the
542546
link.
543547

@@ -552,13 +556,15 @@ key in an [error object]'s links object, each key present in a links object
552556

553557
In the example below, the `self` link is simply a URI string, whereas the
554558
`related` link uses the object form to provide meta information about a
555-
related resource collection:
559+
related resource collection as well as a schema that serves as a description
560+
document for that collection:
556561

557562
```json
558563
"links": {
559-
"self": "http://example.com/articles/1",
564+
"self": "http://example.com/articles/1/relationships/comments",
560565
"related": {
561566
"href": "http://example.com/articles/1/comments",
567+
"describedby": "http://example.com/schemas/article-comments",
562568
"meta": {
563569
"count": 10
564570
}

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