Skip to content

Commit 0091be8

Browse files
committed
Consistently refer to the 'JSON API' and the 'JsonApi' adapter
1 parent ee40e9f commit 0091be8

File tree

5 files changed

+20
-10
lines changed

5 files changed

+20
-10
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,4 @@
1111
* remove root key option and split JSON adapter [@joaomdmoura]
1212
* adds FlattenJSON as default adapter [@joaomdmoura]
1313
* adds support for `pagination links` at top level of JsonApi adapter [@bacarini]
14-
* adds extended format for `include` option to JSONAPI adapter [@beauby]
14+
* adds extended format for `include` option to JsonApi adapter [@beauby]

README.md

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,8 @@ The key can be customized using `meta_key` option.
136136
render json: @post, meta: { total: 10 }, meta_key: "custom_meta"
137137
```
138138

139-
`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 (FlattenJson) doesn't have `root`.
139+
`meta` will only be included in your response if you are using an Adapter that supports `root`,
140+
as JsonAPI and Json adapters, the default adapter (FlattenJson) doesn't have `root`.
140141

141142
### Using a serializer without `render`
142143

@@ -199,7 +200,7 @@ Doesn't follow any specifc convention.
199200
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.
200201
Doesn't follow any specifc convention.
201202

202-
#### JSONAPI
203+
#### JSON API
203204

204205
This adapter follows 1.0 of the format specified in
205206
[jsonapi.org/format](http://jsonapi.org/format). It will include the associated
@@ -285,9 +286,15 @@ And you can change the JSON key that the serializer should use for a particular
285286

286287
## Pagination
287288

288-
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.
289+
Pagination links will be included in your response automatically as long
290+
as the resource is paginated using [Kaminari](https://github.com/amatsuda/kaminari) or
291+
[WillPaginate](https://github.com/mislav/will_paginate) and
292+
if you are using the ```JsonApi``` adapter.
289293

290-
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)
294+
Although the others adapters does not have this feature, it is possible to
295+
implement pagination links to `JSON` adapter. For more information about it,
296+
please see in our docs [How to add pagination
297+
links](https://github.com/rails-api/active_model_serializers/blob/master/docs/howto/add_pagination_links.md).
291298

292299
## Caching
293300

docs/general/adapters.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ Doesn't follow any specifc convention.
1717
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.
1818
Doesn't follow any specifc convention.
1919

20-
### JSONAPI
20+
### JSON API
2121

2222
This adapter follows **version 1.0** of the format specified in
2323
[jsonapi.org/format](http://jsonapi.org/format). It will include the associated

docs/howto/add_pagination_links.md

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,15 @@
11
# How to add pagination links
22

3-
### JSON-API adapter
3+
### JSON API adapter
44

5-
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.
5+
Pagination links will be included in your response automatically as long as
6+
the resource is paginated and if you are using the ```JsonApi``` adapter.
67

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

911
###### Kaminari examples
12+
1013
```ruby
1114
#array
1215
@posts = Kaminari.paginate_array([1, 2, 3]).page(3).per(1)

lib/active_model/serializer/utils.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
module ActiveModel::Serializer::Utils
22
module_function
33

4-
# Translates a comma separated list of dot separated paths (JSONAPI format) into a Hash.
4+
# Translates a comma separated list of dot separated paths (JSON API format) into a Hash.
55
# Example: `'posts.author, posts.comments.upvotes, posts.comments.author'` would become `{ posts: { author: {}, comments: { author: {}, upvotes: {} } } }`.
66
#
77
# @param [String] included

0 commit comments

Comments
 (0)