Add support for top level jsonapi member.

This commit is contained in:
Benjamin Fleischer
2015-10-01 13:22:28 -05:00
parent 1f08865a10
commit 9d7da8afc4
7 changed files with 157 additions and 6 deletions

View File

@@ -9,3 +9,11 @@ The following configuration options can be set on `ActiveModel::Serializer.confi
## JSON API
- `jsonapi_resource_type`: Whether the `type` attributes of resources should be singular or plural. Possible values: `:singular, :plural`. Default: `:plural`.
- `jsonapi_include_toplevel_object`: Whether to include a [top level JSON API member](http://jsonapi.org/format/#document-jsonapi-object)
in the response document.
Default: `false`.
- Used when `jsonapi_include_toplevel_object` is `true`:
- `jsonapi_version`: The latest version of the spec the API conforms to.
Default: `'1.0'`.
- `jsonapi_toplevel_meta`: Optional metadata. Not included if empty.
Default: `{}`.