Skip to content

Instantly share code, notes, and snippets.

@ismasan
Last active August 29, 2015 13:58
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 ismasan/10010055 to your computer and use it in GitHub Desktop.
Save ismasan/10010055 to your computer and use it in GitHub Desktop.
Draft error responses for Bootic's API
{
"class": ["errors", "product"],
"links": {
"schema": {"href":"..."}
},
"properties": {
"title": "iphone",
"id": null,
"slug":"apple-iphone"
},
"errors": [
{
"code": "missing",
"property": "title",
"message": "Cannot be empty"
},
{
"code": "duplicated",
"property": "slug",
"message": "Already exists"
}
],
"entities": {
"variants": [
{
"class": ["errors", "variant"],
"properties": {
"title": ""
},
"errors": [
{"code": "missing", "property": "title", "message":"Cannot be empty"}
]
}
]
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment