-
-
Save glanotte/421892bdc40bb02b429e to your computer and use it in GitHub Desktop.
{ | |
"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"} | |
] | |
}] | |
} | |
} |
Interesting thought, for our current scenario - I don't think so. Overall, I think it is a great idea. I think I would prefer that to listing off errors in the errors
object. In our scenario it is going to matter less what the exact error is. We are going to care more about which objects had errors. Down the road though, I could see us using an error
on the data
array.
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?
question:
would adding an
error
property to thedata
element work just as well?