Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added extension for accepts property on link object
- Loading branch information
Michael Levy
committed
Jul 4, 2015
1 parent
1da67ce
commit 9c70e81
Showing
1 changed file
with
39 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
# 'accepts' property for link | ||
|
||
Add an optional property, <code>accepts</code>, to the <code>link</code> object whose purpose is to allow the server to indicate the representations available for the indicated resource. If present, the value MUST be a string and SHOULD contain a comma separated list of valid media types. | ||
|
||
##example | ||
```json | ||
{ | ||
"collection": { | ||
"version":"1.0", | ||
"href":"/members/pending", | ||
"items": { | ||
{ | ||
"href":"/members/1", | ||
"data": [ | ||
{"prompt":"name", "name":"full-name", "value":"john doe"}, | ||
{"prompt":"enrollment date", "name":"enrollment-date", "value":"2015-06-01"}, | ||
], | ||
"links" : [ | ||
{"href":"/members/1/contract", "rel":"/rels/contract", "prompt":"contract", "name":"contract", "accepts":"application/pdf, text/html"} | ||
] | ||
}, | ||
{ | ||
"href":"/members/2", | ||
"data": [ | ||
{"prompt":"name", "name":"full-name", "value":"homer"}, | ||
{"prompt":"enrollment date", "name":"enrollment-date", "value":"2015-05-29"}, | ||
], | ||
"links" : [ | ||
{"href":"/members/2/contract", "rel":"/rels/contract", "prompt":"contract", "name":"contract", "accepts":"application/pdf, text/html"} | ||
] | ||
} | ||
} | ||
} | ||
} | ||
|
||
``` | ||
|
||
##References | ||
[https://groups.google.com/forum/#!topic/collectionjson/C1GB4UC7_mc](https://groups.google.com/forum/#!topic/collectionjson/C1GB4UC7_mc) |