jsonapi-serializers 0.2.0 → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +5 -4
- data/lib/jsonapi-serializers/serializer.rb +1 -1
- data/lib/jsonapi-serializers/version.rb +1 -1
- data/spec/serializer_spec.rb +12 -12
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8ed468d4f475c6f5cc477c9089298f2d25150d3b
|
4
|
+
data.tar.gz: 01666903a3ab5543c0ec31507945a58082d9f98e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2286b179a75007f1e48922c3067bdf74316753d1390cec68b6605480e258cbceb3a1da616777977975c741da9873e77a10616f0a585105280a415e973e06d72e
|
7
|
+
data.tar.gz: 82109f3851e69a7a05697a4c5876182bfab4740dc44d21a30604ea637e895044b2d64fba8dbb57e816712738a91f89872f49b10ba35649d2a4090f4b5997b821
|
data/README.md
CHANGED
@@ -280,7 +280,7 @@ Returns:
|
|
280
280
|
"relationships": {
|
281
281
|
"author": {
|
282
282
|
"links": {
|
283
|
-
"self": "/posts/1/
|
283
|
+
"self": "/posts/1/relationships/author",
|
284
284
|
"related": "/posts/1/author"
|
285
285
|
},
|
286
286
|
"data": {
|
@@ -290,7 +290,7 @@ Returns:
|
|
290
290
|
},
|
291
291
|
"comments": {
|
292
292
|
"links": {
|
293
|
-
"self": "/posts/1/
|
293
|
+
"self": "/posts/1/relationships/comments",
|
294
294
|
"related": "/posts/1/comments"
|
295
295
|
},
|
296
296
|
"data": [
|
@@ -326,7 +326,7 @@ Returns:
|
|
326
326
|
"relationships": {
|
327
327
|
"user": {
|
328
328
|
"links": {
|
329
|
-
"self": "/comments/1/
|
329
|
+
"self": "/comments/1/relationships/user",
|
330
330
|
"related": "/comments/1/user"
|
331
331
|
},
|
332
332
|
"data": {
|
@@ -336,7 +336,7 @@ Returns:
|
|
336
336
|
},
|
337
337
|
"post": {
|
338
338
|
"links": {
|
339
|
-
"self": "/comments/1/
|
339
|
+
"self": "/comments/1/relationships/post",
|
340
340
|
"related": "/comments/1/post"
|
341
341
|
}
|
342
342
|
}
|
@@ -434,6 +434,7 @@ end
|
|
434
434
|
|
435
435
|
## Release notes
|
436
436
|
|
437
|
+
* v0.2.1: Compliance fix for self links.
|
437
438
|
* v0.2.0: Initial release with support for the final v1 JSON API spec.
|
438
439
|
|
439
440
|
## Contributing
|
data/spec/serializer_spec.rb
CHANGED
@@ -43,13 +43,13 @@ describe JSONAPI::Serializer do
|
|
43
43
|
'relationships' => {
|
44
44
|
'user' => {
|
45
45
|
'links' => {
|
46
|
-
'self' => '/long-comments/1/
|
46
|
+
'self' => '/long-comments/1/relationships/user',
|
47
47
|
'related' => '/long-comments/1/user',
|
48
48
|
},
|
49
49
|
},
|
50
50
|
'post' => {
|
51
51
|
'links' => {
|
52
|
-
'self' => '/long-comments/1/
|
52
|
+
'self' => '/long-comments/1/relationships/post',
|
53
53
|
'related' => '/long-comments/1/post',
|
54
54
|
},
|
55
55
|
},
|
@@ -96,13 +96,13 @@ describe JSONAPI::Serializer do
|
|
96
96
|
# Both to-one and to-many links are present, but neither include linkage:
|
97
97
|
'author' => {
|
98
98
|
'links' => {
|
99
|
-
'self' => '/posts/1/
|
99
|
+
'self' => '/posts/1/relationships/author',
|
100
100
|
'related' => '/posts/1/author',
|
101
101
|
},
|
102
102
|
},
|
103
103
|
'long-comments' => {
|
104
104
|
'links' => {
|
105
|
-
'self' => '/posts/1/
|
105
|
+
'self' => '/posts/1/relationships/long-comments',
|
106
106
|
'related' => '/posts/1/long-comments',
|
107
107
|
},
|
108
108
|
},
|
@@ -131,7 +131,7 @@ describe JSONAPI::Serializer do
|
|
131
131
|
'relationships' => {
|
132
132
|
'author' => {
|
133
133
|
'links' => {
|
134
|
-
'self' => '/posts/1/
|
134
|
+
'self' => '/posts/1/relationships/author',
|
135
135
|
'related' => '/posts/1/author',
|
136
136
|
},
|
137
137
|
# Spec: Resource linkage MUST be represented as one of the following:
|
@@ -141,7 +141,7 @@ describe JSONAPI::Serializer do
|
|
141
141
|
},
|
142
142
|
'long-comments' => {
|
143
143
|
'links' => {
|
144
|
-
'self' => '/posts/1/
|
144
|
+
'self' => '/posts/1/relationships/long-comments',
|
145
145
|
'related' => '/posts/1/long-comments',
|
146
146
|
},
|
147
147
|
'data' => [],
|
@@ -169,7 +169,7 @@ describe JSONAPI::Serializer do
|
|
169
169
|
'relationships' => {
|
170
170
|
'author' => {
|
171
171
|
'links' => {
|
172
|
-
'self' => '/posts/1/
|
172
|
+
'self' => '/posts/1/relationships/author',
|
173
173
|
'related' => '/posts/1/author',
|
174
174
|
},
|
175
175
|
# Spec: Resource linkage MUST be represented as one of the following:
|
@@ -182,7 +182,7 @@ describe JSONAPI::Serializer do
|
|
182
182
|
},
|
183
183
|
'long-comments' => {
|
184
184
|
'links' => {
|
185
|
-
'self' => '/posts/1/
|
185
|
+
'self' => '/posts/1/relationships/long-comments',
|
186
186
|
'related' => '/posts/1/long-comments',
|
187
187
|
},
|
188
188
|
'data' => [],
|
@@ -210,14 +210,14 @@ describe JSONAPI::Serializer do
|
|
210
210
|
'relationships' => {
|
211
211
|
'author' => {
|
212
212
|
'links' => {
|
213
|
-
'self' => '/posts/1/
|
213
|
+
'self' => '/posts/1/relationships/author',
|
214
214
|
'related' => '/posts/1/author',
|
215
215
|
},
|
216
216
|
'data' => nil,
|
217
217
|
},
|
218
218
|
'long-comments' => {
|
219
219
|
'links' => {
|
220
|
-
'self' => '/posts/1/
|
220
|
+
'self' => '/posts/1/relationships/long-comments',
|
221
221
|
'related' => '/posts/1/long-comments',
|
222
222
|
},
|
223
223
|
# Spec: Resource linkage MUST be represented as one of the following:
|
@@ -249,14 +249,14 @@ describe JSONAPI::Serializer do
|
|
249
249
|
'relationships' => {
|
250
250
|
'author' => {
|
251
251
|
'links' => {
|
252
|
-
'self' => '/posts/1/
|
252
|
+
'self' => '/posts/1/relationships/author',
|
253
253
|
'related' => '/posts/1/author',
|
254
254
|
},
|
255
255
|
'data' => nil,
|
256
256
|
},
|
257
257
|
'long-comments' => {
|
258
258
|
'links' => {
|
259
|
-
'self' => '/posts/1/
|
259
|
+
'self' => '/posts/1/relationships/long-comments',
|
260
260
|
'related' => '/posts/1/long-comments',
|
261
261
|
},
|
262
262
|
# Spec: Resource linkage MUST be represented as one of the following:
|