solidus_json_api 0.3.0
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 +7 -0
- data/.gitignore +15 -0
- data/.rspec +2 -0
- data/CHANGELOG.md +224 -0
- data/Gemfile +6 -0
- data/LICENSE +26 -0
- data/README.md +94 -0
- data/Rakefile +38 -0
- data/app/controllers/concerns/spree/api/v2/renderable.rb +63 -0
- data/app/controllers/spree/api/v2/base_controller.rb +9 -0
- data/app/controllers/spree/api/v2/children_controller.rb +29 -0
- data/app/controllers/spree/api/v2/countries_controller.rb +21 -0
- data/app/controllers/spree/api/v2/images_controller.rb +29 -0
- data/app/controllers/spree/api/v2/line_items_controller.rb +36 -0
- data/app/controllers/spree/api/v2/option_types_controller.rb +31 -0
- data/app/controllers/spree/api/v2/option_values_controller.rb +29 -0
- data/app/controllers/spree/api/v2/orders_controller.rb +21 -0
- data/app/controllers/spree/api/v2/prices_controller.rb +27 -0
- data/app/controllers/spree/api/v2/products_controller.rb +37 -0
- data/app/controllers/spree/api/v2/states_controller.rb +29 -0
- data/app/controllers/spree/api/v2/taxonomies_controller.rb +21 -0
- data/app/controllers/spree/api/v2/taxons_controller.rb +40 -0
- data/app/controllers/spree/api/v2/variants_controller.rb +35 -0
- data/app/models/spree/base_decorator.rb +5 -0
- data/app/models/spree/image_decorator.rb +3 -0
- data/app/models/spree/line_item_decorator.rb +3 -0
- data/app/models/spree/order_decorator.rb +3 -0
- data/app/models/spree/price_decorator.rb +3 -0
- data/app/models/spree/state_decorator.rb +3 -0
- data/app/serializers/spree/address_serializer.rb +9 -0
- data/app/serializers/spree/base_serializer.rb +13 -0
- data/app/serializers/spree/country_serializer.rb +7 -0
- data/app/serializers/spree/error_serializer.rb +55 -0
- data/app/serializers/spree/image_serializer.rb +13 -0
- data/app/serializers/spree/line_item_serializer.rb +13 -0
- data/app/serializers/spree/option_type_serializer.rb +8 -0
- data/app/serializers/spree/option_value_serializer.rb +8 -0
- data/app/serializers/spree/order_serializer.rb +20 -0
- data/app/serializers/spree/price_serializer.rb +7 -0
- data/app/serializers/spree/product_serializer.rb +12 -0
- data/app/serializers/spree/role_serializer.rb +5 -0
- data/app/serializers/spree/state_serializer.rb +7 -0
- data/app/serializers/spree/store_serializer.rb +6 -0
- data/app/serializers/spree/taxon_serializer.rb +16 -0
- data/app/serializers/spree/taxonomy_serializer.rb +7 -0
- data/app/serializers/spree/user_serializer.rb +5 -0
- data/app/serializers/spree/variant_serializer.rb +12 -0
- data/circle.yml +12 -0
- data/config/locales/en.yml +25 -0
- data/config/routes.rb +53 -0
- data/docs/.nojekyll +0 -0
- data/docs/Dockerfile +12 -0
- data/docs/Gemfile +14 -0
- data/docs/README.md +12 -0
- data/docs/Rakefile +9 -0
- data/docs/config.rb +39 -0
- data/docs/font-selection.json +148 -0
- data/docs/source/CNAME +1 -0
- data/docs/source/fonts/slate.eot +0 -0
- data/docs/source/fonts/slate.svg +14 -0
- data/docs/source/fonts/slate.ttf +0 -0
- data/docs/source/fonts/slate.woff +0 -0
- data/docs/source/fonts/slate.woff2 +0 -0
- data/docs/source/images/favicon.ico +0 -0
- data/docs/source/images/navbar.png +0 -0
- data/docs/source/includes/_countries.md +133 -0
- data/docs/source/includes/_errors.md +17 -0
- data/docs/source/includes/_filtering.md +11 -0
- data/docs/source/includes/_images.md +201 -0
- data/docs/source/includes/_line_items.md +143 -0
- data/docs/source/includes/_option_types.md +267 -0
- data/docs/source/includes/_option_values.md +227 -0
- data/docs/source/includes/_orders.md +150 -0
- data/docs/source/includes/_pagination.md +10 -0
- data/docs/source/includes/_prices.md +188 -0
- data/docs/source/includes/_products.md +407 -0
- data/docs/source/includes/_states.md +96 -0
- data/docs/source/includes/_taxonomies.md +325 -0
- data/docs/source/includes/_taxons.md +414 -0
- data/docs/source/includes/_variants.md +430 -0
- data/docs/source/index.md +51 -0
- data/docs/source/javascripts/all.js +4 -0
- data/docs/source/javascripts/all_nosearch.js +3 -0
- data/docs/source/javascripts/app/_lang.js +162 -0
- data/docs/source/javascripts/app/_search.js +74 -0
- data/docs/source/javascripts/app/_toc.js +55 -0
- data/docs/source/javascripts/lib/_energize.js +169 -0
- data/docs/source/javascripts/lib/_imagesloaded.min.js +7 -0
- data/docs/source/javascripts/lib/_jquery.highlight.js +108 -0
- data/docs/source/javascripts/lib/_jquery.tocify.js +1042 -0
- data/docs/source/javascripts/lib/_jquery_ui.js +566 -0
- data/docs/source/javascripts/lib/_lunr.js +1910 -0
- data/docs/source/layouts/layout.erb +110 -0
- data/docs/source/stylesheets/_icon-font.scss +38 -0
- data/docs/source/stylesheets/_normalize.css +427 -0
- data/docs/source/stylesheets/_syntax.scss.erb +27 -0
- data/docs/source/stylesheets/_variables.scss +109 -0
- data/docs/source/stylesheets/print.css.scss +142 -0
- data/docs/source/stylesheets/screen.css.scss +622 -0
- data/lib/solidus_json_api/config.rb +8 -0
- data/lib/solidus_json_api/engine.rb +21 -0
- data/lib/solidus_json_api.rb +5 -0
- data/solidus_json_api.gemspec +36 -0
- data/spec/controllers/spree/api/v2/base_controller_spec.rb +46 -0
- data/spec/controllers/spree/api/v2/children_controller_spec.rb +28 -0
- data/spec/controllers/spree/api/v2/countries_controller_spec.rb +25 -0
- data/spec/controllers/spree/api/v2/images_controller_spec.rb +91 -0
- data/spec/controllers/spree/api/v2/line_items_controller_spec.rb +101 -0
- data/spec/controllers/spree/api/v2/option_types_controller_spec.rb +71 -0
- data/spec/controllers/spree/api/v2/option_values_controller_spec.rb +88 -0
- data/spec/controllers/spree/api/v2/orders_controller_spec.rb +61 -0
- data/spec/controllers/spree/api/v2/prices_controller_spec.rb +55 -0
- data/spec/controllers/spree/api/v2/products_controller_spec.rb +99 -0
- data/spec/controllers/spree/api/v2/states_controller_spec.rb +42 -0
- data/spec/controllers/spree/api/v2/taxonomies_controller_spec.rb +31 -0
- data/spec/controllers/spree/api/v2/taxons_controller_spec.rb +54 -0
- data/spec/controllers/spree/api/v2/variants_controller_spec.rb +106 -0
- data/spec/lib/solidus_json_api/config_spec.rb +10 -0
- data/spec/models/spree/base_decorator_spec.rb +9 -0
- data/spec/models/spree/price_decorator_spec.rb +3 -0
- data/spec/serializers/spree/address_serializer_spec.rb +35 -0
- data/spec/serializers/spree/country_serializer_spec.rb +27 -0
- data/spec/serializers/spree/error_serializer_spec.rb +141 -0
- data/spec/serializers/spree/image_serializer_spec.rb +30 -0
- data/spec/serializers/spree/line_item_serializer_spec.rb +40 -0
- data/spec/serializers/spree/option_type_serializer_spec.rb +27 -0
- data/spec/serializers/spree/option_value_serializer_spec.rb +29 -0
- data/spec/serializers/spree/order_serializer_spec.rb +68 -0
- data/spec/serializers/spree/price_serializer_spec.rb +28 -0
- data/spec/serializers/spree/product_serializer_spec.rb +47 -0
- data/spec/serializers/spree/role_serializer_spec.rb +17 -0
- data/spec/serializers/spree/state_serializer_spec.rb +25 -0
- data/spec/serializers/spree/store_serializer_spec.rb +25 -0
- data/spec/serializers/spree/taxon_serializer_spec.rb +44 -0
- data/spec/serializers/spree/taxonomy_serializer_spec.rb +27 -0
- data/spec/serializers/spree/user_serializer_spec.rb +17 -0
- data/spec/serializers/spree/variant_serializer_spec.rb +55 -0
- data/spec/spec_helper.rb +57 -0
- data/spec/support/shoulda_matchers.rb +6 -0
- metadata +442 -0
|
@@ -0,0 +1,325 @@
|
|
|
1
|
+
# Taxonomies
|
|
2
|
+
|
|
3
|
+
## List Taxonomies
|
|
4
|
+
|
|
5
|
+
```shell
|
|
6
|
+
curl "https://example.com/api/v2/taxonomies"
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
```json
|
|
10
|
+
{
|
|
11
|
+
"data": [
|
|
12
|
+
{
|
|
13
|
+
"id": "1",
|
|
14
|
+
"type": "spree_taxonomies",
|
|
15
|
+
"attributes": {
|
|
16
|
+
"name": "Category",
|
|
17
|
+
"position": 1
|
|
18
|
+
},
|
|
19
|
+
"relationships": {
|
|
20
|
+
"taxons": {
|
|
21
|
+
"data": [
|
|
22
|
+
{
|
|
23
|
+
"type": "spree_taxons",
|
|
24
|
+
"id": "2"
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
"type": "spree_taxons",
|
|
28
|
+
"id": "1"
|
|
29
|
+
}
|
|
30
|
+
]
|
|
31
|
+
},
|
|
32
|
+
"children": {
|
|
33
|
+
"data": [
|
|
34
|
+
{
|
|
35
|
+
"type": "spree_taxons",
|
|
36
|
+
"id": "2"
|
|
37
|
+
}
|
|
38
|
+
]
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
]
|
|
43
|
+
}
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
List of the taxonomies in the database.
|
|
47
|
+
|
|
48
|
+
## Show Taxonomy
|
|
49
|
+
|
|
50
|
+
```shell
|
|
51
|
+
curl "https://example.com/api/v2/taxonomies/1"
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
```json
|
|
55
|
+
{
|
|
56
|
+
"data": {
|
|
57
|
+
"id": "1",
|
|
58
|
+
"type": "spree_taxonomies",
|
|
59
|
+
"attributes": {
|
|
60
|
+
"name": "Category",
|
|
61
|
+
"position": 1
|
|
62
|
+
},
|
|
63
|
+
"relationships": {
|
|
64
|
+
"taxons": {
|
|
65
|
+
"data": [
|
|
66
|
+
{
|
|
67
|
+
"type": "spree_taxons",
|
|
68
|
+
"id": "2"
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
"type": "spree_taxons",
|
|
72
|
+
"id": "1"
|
|
73
|
+
}
|
|
74
|
+
]
|
|
75
|
+
},
|
|
76
|
+
"children": {
|
|
77
|
+
"data": [
|
|
78
|
+
{
|
|
79
|
+
"type": "spree_taxons",
|
|
80
|
+
"id": "2"
|
|
81
|
+
}
|
|
82
|
+
]
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
Select a taxonomy via the `id`.
|
|
90
|
+
|
|
91
|
+
## List Taxons of a Taxonomy
|
|
92
|
+
|
|
93
|
+
```shell
|
|
94
|
+
curl "https://example.com/api/v2/taxonomies/1/taxons"
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
```json
|
|
98
|
+
{
|
|
99
|
+
"data": [
|
|
100
|
+
{
|
|
101
|
+
"id": "2",
|
|
102
|
+
"type": "spree_taxons",
|
|
103
|
+
"attributes": {
|
|
104
|
+
"name": "SLEEP",
|
|
105
|
+
"permalink": "category/sleep",
|
|
106
|
+
"position": 0,
|
|
107
|
+
"description": null,
|
|
108
|
+
"meta_title": null,
|
|
109
|
+
"meta_description": null,
|
|
110
|
+
"meta_keywords": null,
|
|
111
|
+
"depth": 1,
|
|
112
|
+
"classifications_count": null
|
|
113
|
+
},
|
|
114
|
+
"relationships": {
|
|
115
|
+
"taxonomy": {
|
|
116
|
+
"data": {
|
|
117
|
+
"type": "spree_taxonomies",
|
|
118
|
+
"id": "1"
|
|
119
|
+
}
|
|
120
|
+
},
|
|
121
|
+
"parent": {
|
|
122
|
+
"data": {
|
|
123
|
+
"type": "spree_taxons",
|
|
124
|
+
"id": "1"
|
|
125
|
+
}
|
|
126
|
+
},
|
|
127
|
+
"children": {
|
|
128
|
+
"data": [
|
|
129
|
+
{
|
|
130
|
+
"type": "spree_taxons",
|
|
131
|
+
"id": "3"
|
|
132
|
+
}
|
|
133
|
+
]
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
},
|
|
137
|
+
{
|
|
138
|
+
"id": "1",
|
|
139
|
+
"type": "spree_taxons",
|
|
140
|
+
"attributes": {
|
|
141
|
+
"name": "Category",
|
|
142
|
+
"permalink": "category",
|
|
143
|
+
"position": 0,
|
|
144
|
+
"description": null,
|
|
145
|
+
"meta_title": null,
|
|
146
|
+
"meta_description": null,
|
|
147
|
+
"meta_keywords": null,
|
|
148
|
+
"depth": 0,
|
|
149
|
+
"classifications_count": 1
|
|
150
|
+
},
|
|
151
|
+
"relationships": {
|
|
152
|
+
"taxonomy": {
|
|
153
|
+
"data": {
|
|
154
|
+
"type": "spree_taxonomies",
|
|
155
|
+
"id": "1"
|
|
156
|
+
}
|
|
157
|
+
},
|
|
158
|
+
"parent": {
|
|
159
|
+
"data": null
|
|
160
|
+
},
|
|
161
|
+
"children": {
|
|
162
|
+
"data": [
|
|
163
|
+
{
|
|
164
|
+
"type": "spree_taxons",
|
|
165
|
+
"id": "2"
|
|
166
|
+
}
|
|
167
|
+
]
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
]
|
|
172
|
+
}
|
|
173
|
+
```
|
|
174
|
+
|
|
175
|
+
List all of the taxons that a taxonomy has a reference to.
|
|
176
|
+
|
|
177
|
+
## Show Taxon of a Taxonomy
|
|
178
|
+
|
|
179
|
+
```shell
|
|
180
|
+
curl "https://example.com/api/v2/taxonomies/1/taxons/1"
|
|
181
|
+
```
|
|
182
|
+
|
|
183
|
+
```json
|
|
184
|
+
{
|
|
185
|
+
"data": {
|
|
186
|
+
"id": "1",
|
|
187
|
+
"type": "spree_taxons",
|
|
188
|
+
"attributes": {
|
|
189
|
+
"name": "Category",
|
|
190
|
+
"permalink": "category",
|
|
191
|
+
"position": 0,
|
|
192
|
+
"description": null,
|
|
193
|
+
"meta_title": null,
|
|
194
|
+
"meta_description": null,
|
|
195
|
+
"meta_keywords": null,
|
|
196
|
+
"depth": 0,
|
|
197
|
+
"classifications_count": 1
|
|
198
|
+
},
|
|
199
|
+
"relationships": {
|
|
200
|
+
"taxonomy": {
|
|
201
|
+
"data": {
|
|
202
|
+
"type": "spree_taxonomies",
|
|
203
|
+
"id": "1"
|
|
204
|
+
}
|
|
205
|
+
},
|
|
206
|
+
"parent": {
|
|
207
|
+
"data": null
|
|
208
|
+
},
|
|
209
|
+
"children": {
|
|
210
|
+
"data": [
|
|
211
|
+
{
|
|
212
|
+
"type": "spree_taxons",
|
|
213
|
+
"id": "2"
|
|
214
|
+
}
|
|
215
|
+
]
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
```
|
|
221
|
+
|
|
222
|
+
Find a taxon that the taxonomy owns via the taxonomy's `id` and the taxon's `id`.
|
|
223
|
+
|
|
224
|
+
## List Children of a Taxonomy
|
|
225
|
+
|
|
226
|
+
```shell
|
|
227
|
+
curl "https://example.com/api/v2/taxonomies/1/children"
|
|
228
|
+
```
|
|
229
|
+
|
|
230
|
+
```json
|
|
231
|
+
{
|
|
232
|
+
"data": [
|
|
233
|
+
{
|
|
234
|
+
"id": "2",
|
|
235
|
+
"type": "spree_taxons",
|
|
236
|
+
"attributes": {
|
|
237
|
+
"name": "SLEEP",
|
|
238
|
+
"permalink": "category/sleep",
|
|
239
|
+
"position": 0,
|
|
240
|
+
"description": null,
|
|
241
|
+
"meta_title": null,
|
|
242
|
+
"meta_description": null,
|
|
243
|
+
"meta_keywords": null,
|
|
244
|
+
"depth": 1,
|
|
245
|
+
"classifications_count": null
|
|
246
|
+
},
|
|
247
|
+
"relationships": {
|
|
248
|
+
"taxonomy": {
|
|
249
|
+
"data": {
|
|
250
|
+
"type": "spree_taxonomies",
|
|
251
|
+
"id": "1"
|
|
252
|
+
}
|
|
253
|
+
},
|
|
254
|
+
"parent": {
|
|
255
|
+
"data": {
|
|
256
|
+
"type": "spree_taxons",
|
|
257
|
+
"id": "1"
|
|
258
|
+
}
|
|
259
|
+
},
|
|
260
|
+
"children": {
|
|
261
|
+
"data": [
|
|
262
|
+
{
|
|
263
|
+
"type": "spree_taxons",
|
|
264
|
+
"id": "3"
|
|
265
|
+
}
|
|
266
|
+
]
|
|
267
|
+
}
|
|
268
|
+
}
|
|
269
|
+
}
|
|
270
|
+
]
|
|
271
|
+
}
|
|
272
|
+
```
|
|
273
|
+
|
|
274
|
+
List all of the children of a taxonomy.
|
|
275
|
+
This does _not_ include the root taxon that would be included when listing all of the taxons of this taxonomy.
|
|
276
|
+
|
|
277
|
+
## Show Child of a Taxonomy
|
|
278
|
+
|
|
279
|
+
```shell
|
|
280
|
+
curl "https://example.com/api/v2/taxonomies/1/children/2"
|
|
281
|
+
```
|
|
282
|
+
|
|
283
|
+
```json
|
|
284
|
+
{
|
|
285
|
+
"data": {
|
|
286
|
+
"id": "2",
|
|
287
|
+
"type": "spree_taxons",
|
|
288
|
+
"attributes": {
|
|
289
|
+
"name": "SLEEP",
|
|
290
|
+
"permalink": "category/sleep",
|
|
291
|
+
"position": 0,
|
|
292
|
+
"description": null,
|
|
293
|
+
"meta_title": null,
|
|
294
|
+
"meta_description": null,
|
|
295
|
+
"meta_keywords": null,
|
|
296
|
+
"depth": 1,
|
|
297
|
+
"classifications_count": null
|
|
298
|
+
},
|
|
299
|
+
"relationships": {
|
|
300
|
+
"taxonomy": {
|
|
301
|
+
"data": {
|
|
302
|
+
"type": "spree_taxonomies",
|
|
303
|
+
"id": "1"
|
|
304
|
+
}
|
|
305
|
+
},
|
|
306
|
+
"parent": {
|
|
307
|
+
"data": {
|
|
308
|
+
"type": "spree_taxons",
|
|
309
|
+
"id": "1"
|
|
310
|
+
}
|
|
311
|
+
},
|
|
312
|
+
"children": {
|
|
313
|
+
"data": [
|
|
314
|
+
{
|
|
315
|
+
"type": "spree_taxons",
|
|
316
|
+
"id": "3"
|
|
317
|
+
}
|
|
318
|
+
]
|
|
319
|
+
}
|
|
320
|
+
}
|
|
321
|
+
}
|
|
322
|
+
}
|
|
323
|
+
```
|
|
324
|
+
|
|
325
|
+
Fetch a child of the taxnomy via the taxonomy's `id` and the child's `id`.
|