Skip to content

Commit 8ec97c3

Browse files
committed
Fix deserialization docs.
1 parent 4ae191d commit 8ec97c3

1 file changed

Lines changed: 9 additions & 9 deletions

File tree

source/guides/deserialization/defining.html.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ Example:
5353
class DeserializablePost < JSONAPI::Deserializable::Post
5454
# ...
5555
type do |t|
56-
field primary_type: t.capitalize
56+
{ primary_type: t.capitalize }
5757
end
5858
end
5959
```
@@ -68,7 +68,7 @@ Example:
6868
class DeserializablePost < JSONAPI::Deserializable::Post
6969
# ...
7070
id do |i|
71-
field primary_id: i.to_i
71+
{ primary_id: i.to_i }
7272
end
7373
end
7474
```
@@ -86,7 +86,7 @@ Example:
8686
class DeserializablePost < JSONAPI::Deserializable::Post
8787
# ...
8888
attribute :date do |d|
89-
field created_at: d
89+
{ created_at: d }
9090
end
9191
end
9292
```
@@ -110,9 +110,9 @@ Example:
110110
class DeserializablePost < JSONAPI::Deserializable::Post
111111
# ...
112112
has_many :comments do |rel, ids, types|
113-
field comment_ids: ids
114-
field comment_types: types.map(&:capitalize)
115-
field comment_meta: rel['meta']
113+
{ comment_ids: ids,
114+
comment_types: types.map(&:capitalize),
115+
comment_meta: rel['meta'] }
116116
end
117117
end
118118
```
@@ -131,9 +131,9 @@ Example:
131131
class DeserializablePost < JSONAPI::Deserializable::Post
132132
# ...
133133
has_one :author do |rel, id, type|
134-
field author_id: id
135-
field author_type: type.capitalize
136-
field author_meta: rel['meta']
134+
{ author_id: id,
135+
author_type: type.capitalize,
136+
author_meta: rel['meta'] }
137137
end
138138
end
139139
```

0 commit comments

Comments
 (0)