Skip to content

Instantly share code, notes, and snippets.

@erichocean
Created April 3, 2011 00:04
Show Gist options
  • Select an option

  • Save erichocean/900030 to your computer and use it in GitHub Desktop.

Select an option

Save erichocean/900030 to your computer and use it in GitHub Desktop.
A standardized JSON changeset format for SproutCore.
// Changeset v2 format
{
"sc_version": 2, // I guess we should start versioning if I'm going to change it ;)
"sc_types": ["Foo", "Bar"],
// TODO: Should we include Namespace information as well?
"Foo": {
"created": [
"<primaryKey>"
// ... more created record ids of type "Foo"
],
"updated": [
"<primaryKey>"
// ... more update record ids of type "Foo"
],
"deleted": [
"<primaryKey"
// ...more deleted record ids of type "Foo"
],
"attributes": {
"<primaryKey>": {
// attributes hash keys and values
}
// ... more attribute hashes for records of type "Foo"
}
},
"Bar": {
"created": [
"<primaryKey>"
// ... more created record ids of type "Bar"
],
"updated": [
"<primaryKey>"
// ... more update record ids of type "Bar"
],
"deleted": [
"<primaryKey"
// ...more deleted record ids of type "Bar"
],
"attributes": {
"<primaryKey>": {
// attributes hash keys and values
}
// ... more attribute hashes for records of type "Bar"
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment