Skip to content

Instantly share code, notes, and snippets.

@glanotte
Last active August 29, 2015 14:22
Show Gist options
  • Save glanotte/421892bdc40bb02b429e to your computer and use it in GitHub Desktop.
Save glanotte/421892bdc40bb02b429e to your computer and use it in GitHub Desktop.
Collection+JSON item-error extension
{
"collection": {
"version": "123",
"items": [{
"href": "http://example.com/contacts/1",
"data": [
{"name": "id", "value": "1"}
]
},{
"item-error": "This object is invalid",
"data": [
{"name": "id", "value": ""}
]
},{
"href": "http://example.com/contacts/2",
"data": [
{"name": "id", "value": "1"}
]
}]
}
}
@mamund
Copy link

mamund commented Jun 9, 2015

@glanotte

ok, i think i see what you're saying. you want an error property on the item, not the data element (as i suggested) and not just on the representation (where it is now).

so, are you ok, w/ a single string ("itemerror" : "not valid" )?
would a boolean work just as well ("itemerror" : "true")?
do you really need an object here? ("itemerror" : {"code" : "123", "message" : "invalid object"})?

do you plan do use something at the data level at some point?
in human-drive UIs, how do you see this "itemerror" being handled? rendered as a message? something else?

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