carlesjove / collection_json_serializer

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

Builder should validate that the required attributes for each object are present #7

Open carlesjove opened 9 years ago

carlesjove commented 9 years ago

Required objects are:

"collection": {
}

If any object uses the data array:

"data" : [
  {"name" : STRING}
]

If it uses the queries object:

{
  "queries" :
  [
    {"href" : URI, "rel" : STRING}, // does not use data
    {"href" : URI, "rel" : STRING, // uses data
      "data" :
      [
        {"name" : STRING}
      ]
    }
  ]
}

If it uses the links array:

"links" : [
  {"href" : URI, "rel" : STRING}
]
carlesjove commented 9 years ago

This is related to #20

carlesjove commented 9 years ago

This might already be fixed, but needs to be revised.