plexus / yaks

Ruby library for building hypermedia APIs
http://rubygems.org/gems/yaks
MIT License
236 stars 26 forks source link

Fix singular resources for JSON API #77

Closed janko closed 9 years ago

janko commented 9 years ago

Maybe before all resources were shown as an array, but now the JSON API documentation states that singular resources should be returned as a hash instead of an array:

{
  "data": {
    "type": "articles",
    "title": "Singular"
  }
}

You can see that e.g. in Top level. Since JSON API is in RC3 now, we can safely assume this isn't going to change before 1.0.

plexus commented 9 years ago

Looks good. Thanks for the patch!