Skip to content

Instantly share code, notes, and snippets.

@kevinswiber
Created December 16, 2012 17:42
Show Gist options
  • Save kevinswiber/4310097 to your computer and use it in GitHub Desktop.
Save kevinswiber/4310097 to your computer and use it in GitHub Desktop.
Using Siren to demonstrate a PUT with different read/write models.
{
"properties": {
"title": "Error on page load",
"description": "Steps to reproduce: ...",
"severity": 1,
"views": 6,
"version": 3
},
"entities": [
{
"rel": "http://rels.x.io/comments",
"href": "http://x.io/bugs/1/comments"
}
],
"actions": [
{
"name": "bug-update",
"method": "PUT",
"href": "http://x.io/bugs/1",
"type": "application/x-www-form-urlencoded",
"fields": [
{ "name": "title", "type": "text" },
{ "name": "description", "type": "text" },
{ "name": "severity", "type": "number" },
{ "name": "version", "type": "hidden", "value": "3" }
]
}
],
"links": [
{ "rel": "self", "href": "http://x.io/bugs/1" },
{ "rel": "next", "href": "http://x.io/bugs/2" }
]
}
@kevinswiber
Copy link
Author

Siren spec, for reference: https://github.com/kevinswiber/siren

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment