carlesjove / collection_json_serializer

A Ruby gem to respond with Collection+JSON
MIT License
3 stars 1 forks source link

Add support for error #10

Open carlesjove opened 9 years ago

carlesjove commented 9 years ago

From the spec:

The error object contains additional information on the latest error condition reported by the server. This is an OPTIONAL object and there MUST NOT be more than one error object in a Collection+JSON document. It is a top-level document property.

The following elements MAY appear as child properties of the error object: code message and title.

// sample error object
{
  "error" :
  {
    "title" : STRING,
    "code" : STRING,
    "message" : STRING
  }
}