-
Notifications
You must be signed in to change notification settings - Fork 890
Closed
Description
In "Updating" > "Creating a Document" the example document doesn't have any links.
When creating a document with links in the URL style, I'm assuming the top-level "links" template is still required, yes?
Example 1
POST /photos
Content-Type: application/json
Accept: application/json
{
"links": {
"photos.comments": "http://example.com/comments/{posts.comments}"
},
"photos": [{
"title": "Ember Hamster",
"src": "http://example.com/images/productivity.png",
"links": {
"comments": [ "1", "5", "12", "17" ]
}
}]
}
Or is it valid to just include the ID(s) and assume the server knows what type of object you're referencing?
Example 2
POST /photos
Content-Type: application/json
Accept: application/json
{
"photos": [{
"title": "Ember Hamster",
"src": "http://example.com/images/productivity.png",
"links": {
"comments": [ "1", "5", "12", "17" ]
}
}]
}
I'm pretty sure the client should have to be explicit about what it is linking to, despite there not being any way to explicitly communicate whether a server supports ID-based JSON, URL-based JSON or both.
As with #101 it's possible that this is implicit, but I think at least having one of these examples in an appendix makes sense.
Metadata
Metadata
Assignees
Labels
No labels