Skip to content

Commit

Permalink
adds a collection example (#18)
Browse files Browse the repository at this point in the history
This PR adds an example to the collection section. This helps to understand that the `items` in a `collection` can be any arbitrary thing.
  • Loading branch information
mehrdadrafiee authored Apr 23, 2024
1 parent 6ad0b9d commit 65e12b2
Showing 1 changed file with 39 additions and 0 deletions.
39 changes: 39 additions & 0 deletions versions/1.0/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -384,6 +384,45 @@ A `Collection` **MAY** have the following:
}
```

An example of a `collection` where the `items` are _not Hyperion_ :

```json
{
"@id": "/users?page=2&page_size=4",
"@type": "Collection",
"@links": {
"first": {
"href": "/users?page=1&page_size=4"
},
"next": {
"href": "/users?page=3&page_size=4"
},
"previous": {
"href": "/users?page=1&page_size=4"
},
"last": {
"href": "/users?page=5&page_size=4"
}
},
"items": [
{
"country_code": "USA",
"age": 32,
"given_name": "Hubert",
"family_name": "Farnsworth"
},
{
"country_code": "FRA",
"age": 25,
"given_name": "Philip",
"family_name": "Fry"
},
...
],
"total_items": 20
}
```

## <a href="#document-entry-point" id="document-entry-point" class="headerlink"></a> Entry Point

An `EntryPoint` is a type of [node](#document-components-node) used to represent a resource that clients can use to get more information about an API and provide [links](#document-components-link-collection) to traverse.
Expand Down

0 comments on commit 65e12b2

Please sign in to comment.