Skip to content

Commit c43b2ac

Browse files
committed
Update readme.
1 parent 0b4385c commit c43b2ac

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

README.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -219,12 +219,6 @@ def unformat_name(attribute_name)
219219
end
220220
```
221221
```ruby
222-
# Override this to provide a resource-object jsonapi object containing the version in use.
223-
# http://jsonapi.org/format/#document-jsonapi-object
224-
def jsonapi
225-
end
226-
```
227-
```ruby
228222
# Override this to provide resource-object metadata.
229223
# http://jsonapi.org/format/#document-structure-resource-objects
230224
def meta
@@ -237,6 +231,12 @@ def base_url
237231
end
238232
```
239233
```ruby
234+
# Override this to provide a resource-object jsonapi object containing the version in use.
235+
# http://jsonapi.org/format/#document-jsonapi-object
236+
def jsonapi
237+
end
238+
```
239+
```ruby
240240
def self_link
241241
"#{base_url}/#{type}/#{id}"
242242
end
@@ -318,9 +318,9 @@ JSONAPI::Serializer.serialize(post, base_url: 'http://example.com')
318318

319319
Note: if you override `self_link` in your serializer and leave out `base_url`, it will not be included.
320320

321-
### Root jsonapi object
321+
### Root 'jsonapi' object
322322

323-
You can pass a `jsonapi` argument to specify a top-level jsonapi block containing the version of JSON:API in use:
323+
You can pass a `jsonapi` argument to specify a [top-level "jsonapi" key](http://jsonapi.org/format/#document-jsonapi-object) containing the version of JSON:API in use:
324324

325325
```ruby
326326
JSONAPI::Serializer.serialize(post, jsonapi: {version: '1.0'})

0 commit comments

Comments
 (0)