Skip to content

Commit

Permalink
Consistently refer to the 'JSON API' and the 'JsonApi' adapter
Browse files Browse the repository at this point in the history
  • Loading branch information
bf4 committed Sep 4, 2015
1 parent fae5e0e commit fcbae45
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ The key can be customized using `meta_key` option.
render json: @post, meta: { total: 10 }, meta_key: "custom_meta"
```

`meta` will only be included in your response if you are using an Adapter that supports `root`, as JsonAPI and Json adapters, the default adapter (Attributes) doesn't have `root`.
`meta` will only be included in your response if you are using an Adapter that supports `root`, as JSON API and Json adapters, the default adapter (Attributes) doesn't have `root`.

### Overriding association methods

Expand Down Expand Up @@ -184,7 +184,7 @@ Doesn't follow any specifc convention.
It also generates a json response but always with a root key. The root key **can't be overridden**, and will be automatically defined accordingly with the objects being serialized.
Doesn't follow any specifc convention.

#### JSONAPI
#### JSON API

This adapter follows 1.0 of the format specified in
[jsonapi.org/format](http://jsonapi.org/format). It will include the associated
Expand Down Expand Up @@ -276,7 +276,7 @@ The `url` declaration describes which named routes to use while generating URLs
for your JSON. Not every adapter will require URLs.
## Pagination

Pagination links will be included in your response automatically as long as the resource is paginated using [Kaminari](https://github.com/amatsuda/kaminari) or [WillPaginate](https://github.com/mislav/will_paginate) and if you are using a ```JSON-API``` adapter.
Pagination links will be included in your response automatically as long as the resource is paginated using [Kaminari](https://github.com/amatsuda/kaminari) or [WillPaginate](https://github.com/mislav/will_paginate) and if you are using a ```JSON API``` adapter.

Although the others adapters does not have this feature, it is possible to implement pagination links to `JSON` adapter. For more information about it, please see in our docs [How to add pagination links](https://github.com/rails-api/active_model_serializers/blob/master/docs/howto/add_pagination_links.md)

Expand Down
2 changes: 1 addition & 1 deletion docs/general/adapters.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Doesn't follow any specifc convention.
It also generates a json response but always with a root key. The root key **can't be overridden**, and will be automatically defined accordingly to the objects being serialized.
Doesn't follow any specifc convention.

### JSONAPI
### JSON API

This adapter follows **version 1.0** of the format specified in
[jsonapi.org/format](http://jsonapi.org/format). It will include the associated
Expand Down
4 changes: 2 additions & 2 deletions docs/howto/add_pagination_links.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# How to add pagination links

### JSON-API adapter
### JSON API adapter

Pagination links will be included in your response automatically as long as the resource is paginated and if you are using a ```JSON-API``` adapter.
Pagination links will be included in your response automatically as long as the resource is paginated and if you are using a ```JSON API``` adapter.

If you want pagination links in your response, use [Kaminari](https://github.com/amatsuda/kaminari) or [WillPaginate](https://github.com/mislav/will_paginate).

Expand Down
4 changes: 2 additions & 2 deletions test/action_controller/serialization_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ def render_using_implicit_serializer

def render_using_default_adapter_root
with_adapter ActiveModel::Serializer::Adapter::JsonApi do
# JSON-API adapter sets root by default
# JSON API adapter sets root by default
@profile = Profile.new({ name: 'Name 1', description: 'Description 1', comments: 'Comments 1' })
render json: @profile
end
Expand Down Expand Up @@ -145,7 +145,7 @@ def generate_cached_serializer(obj)

def with_adapter(adapter)
old_adapter = ActiveModel::Serializer.config.adapter
# JSON-API adapter sets root by default
# JSON API adapter sets root by default
ActiveModel::Serializer.config.adapter = adapter
yield
ensure
Expand Down

0 comments on commit fcbae45

Please sign in to comment.