Skip to content

reserve attributes in top level of resource object #588

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 6, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 14 additions & 6 deletions extensions/bulk/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,16 @@ Accept: application/vnd.api+json; ext=bulk
{
"data": [{
"type": "photos",
"title": "Ember Hamster",
"src": "http://example.com/images/productivity.png"
"attributes": {
"title": "Ember Hamster",
"src": "http://example.com/images/productivity.png"
}
}, {
"type": "photos",
"title": "Mustaches on a Stick",
"src": "http://example.com/images/mustaches.png"
"attributes": {
"title": "Mustaches on a Stick",
"src": "http://example.com/images/mustaches.png"
}
}]
}
```
Expand All @@ -69,11 +73,15 @@ Accept: application/vnd.api+json; ext=bulk
"data": [{
"type": "articles",
"id": "1",
"title": "To TDD or Not"
"attributes": {
"title": "To TDD or Not"
}
}, {
"type": "articles",
"id": "2",
"title": "LOL Engineering"
"attributes": {
"title": "LOL Engineering"
}
}]
}
```
Expand Down
54 changes: 32 additions & 22 deletions extensions/jsonpatch/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,10 @@ Accept: application/vnd.api+json; ext=jsonpatch
"path": "/-",
"value": {
"type": "photos",
"title": "Ember Hamster",
"src": "http://example.com/images/productivity.png"
"attributes": {
"title": "Ember Hamster",
"src": "http://example.com/images/productivity.png"
}
}
}
]
Expand Down Expand Up @@ -130,7 +132,7 @@ A server **MUST** respond to Patch operations that target a *to-many
relationship URL* as described below.

For all operations, the `"value"` **MUST** contain an object that contains
an array of linkage objects or an empty array, to remove all elements
an array of linkage objects or an empty array, to remove all elements
of the relationship.

If a client requests a `"replace"` operation to a *to-many relationship URL*, the
Expand All @@ -147,12 +149,12 @@ Content-Type: application/vnd.api+json; ext=jsonpatch
Accept: application/vnd.api+json; ext=jsonpatch

[
{
"op": "replace",
"path": "",
{
"op": "replace",
"path": "",
"value": [
{ "type": "tags", "id": "2" },
{ "type": "tags", "id": "3" }
{ "type": "tags", "id": "2" },
{ "type": "tags", "id": "3" }
]
}
]
Expand All @@ -171,9 +173,9 @@ Content-Type: application/vnd.api+json; ext=jsonpatch
Accept: application/vnd.api+json; ext=jsonpatch

[
{
"op": "add",
"path": "/-",
{
"op": "add",
"path": "/-",
"value": [
{ "type": "comments", "id": "123" }
]
Expand All @@ -193,9 +195,9 @@ Content-Type: application/vnd.api+json; ext=jsonpatch
Accept: application/vnd.api+json; ext=jsonpatch

[
{
"op": "remove",
"path": "",
{
"op": "remove",
"path": "",
"value": [
{ "type": "comments", "id": "5" },
{ "type": "comments", "id": "13" }
Expand Down Expand Up @@ -255,17 +257,21 @@ Accept: application/vnd.api+json; ext=jsonpatch
"path": "/-",
"value": {
"type": "photos",
"title": "Ember Hamster",
"src": "http://example.com/images/productivity.png"
"attributes": {
"title": "Ember Hamster",
"src": "http://example.com/images/productivity.png"
}
}
},
{
"op": "add",
"path": "/-",
"value": {
"type": "photos",
"title": "Mustaches on a Stick",
"src": "http://example.com/images/mustaches.png"
"attributes": {
"title": "Mustaches on a Stick",
"src": "http://example.com/images/mustaches.png"
}
}
}
]
Expand All @@ -283,15 +289,19 @@ Content-Type: application/vnd.api+json; ext=jsonpatch
"data": [{
"type": "photos",
"id": "123",
"title": "Ember Hamster",
"src": "http://example.com/images/productivity.png"
"attributes": {
"title": "Ember Hamster",
"src": "http://example.com/images/productivity.png"
}
}]
}, {
"data": [{
"type": "photos",
"id": "124",
"title": "Mustaches on a Stick",
"src": "http://example.com/images/mustaches.png"
"attributes": {
"title": "Mustaches on a Stick",
"src": "http://example.com/images/mustaches.png"
}
}]
}
]
Expand Down
Loading
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