Skip to content

Instantly share code, notes, and snippets.

@mamund
Last active August 29, 2015 13:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mamund/9779214 to your computer and use it in GitHub Desktop.
Save mamund/9779214 to your computer and use it in GitHub Desktop.
Using Cj as a diff format
{
"collection" : {
"version" : "1.0",
"href" : "http://example.org/cj-diff.js",
"links" : [
{"rel" : "help", "href" : "http://example.org/cj-diff.html"},
{"rel" : "profile", "href" : "http://exmaple.org/profiles/cj-dff.alps"}
],
"items" : [
{
"href" : "http://example.org/diffs/a",
"data" : [
{"name" : "type", "value" : "add"}
],
"links" : [
{"rel" : "related", "href" : "http://example.org/records/99"}
]
},
{
"href" : "http://example.org/diffs/b",
"data" : [
{"name" : "type", "value" : "replace"}
],
"links" : [
{"rel" : "related", "href" : "http://example.org/records/6"}
]
},
{
"href" : "http://example.org/diffs/c",
"data" : [
{"name" : "type", "value" : "replace"}
],
"links" : [
{"rel" : "related", "href" : "http://example.org/records/8"}
]
},
{
"href" : "http://example.org/diffs/d",
"data" : [
{"name" : "type", "value" : "remove"}
],
"links" : [
{"rel" : "related", "href" : "http://example.org/records/12"}
]
}
],
"queries" : [
{"rel" : "search", "href" : "http://example.org/cj-diffs"}
]
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment