reqcord 0.1.1 → 0.1.2
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/CHANGELOG.md +13 -0
- data/Gemfile +5 -0
- data/README.md +13 -0
- data/gemfiles/rails_7.1.gemfile +13 -0
- data/gemfiles/rails_7.2.gemfile +13 -0
- data/gemfiles/rails_8.0.gemfile +13 -0
- data/gemfiles/rails_8.1.gemfile +13 -0
- data/lib/reqcord/version.rb +1 -1
- data/reqcord.gemspec +18 -4
- metadata +65 -217
- data/.gitignore +0 -8
- data/Gemfile.lock +0 -171
- data/examples/complex-spec-app/.rspec +0 -1
- data/examples/complex-spec-app/README.md +0 -21
- data/examples/complex-spec-app/app.rb +0 -363
- data/examples/complex-spec-app/docs/api/README.md +0 -104
- data/examples/complex-spec-app/docs/api/api/v1/admin/products/create.md +0 -117
- data/examples/complex-spec-app/docs/api/api/v1/admin/products/destroy.md +0 -51
- data/examples/complex-spec-app/docs/api/api/v1/admin/products/index.md +0 -11
- data/examples/complex-spec-app/docs/api/api/v1/admin/products/list.md +0 -106
- data/examples/complex-spec-app/docs/api/api/v1/auth/index.md +0 -9
- data/examples/complex-spec-app/docs/api/api/v1/auth/login.md +0 -76
- data/examples/complex-spec-app/docs/api/api/v1/cart-items/create.md +0 -91
- data/examples/complex-spec-app/docs/api/api/v1/cart-items/destroy.md +0 -51
- data/examples/complex-spec-app/docs/api/api/v1/cart-items/index.md +0 -10
- data/examples/complex-spec-app/docs/api/api/v1/carts/checkout.md +0 -102
- data/examples/complex-spec-app/docs/api/api/v1/carts/index.md +0 -10
- data/examples/complex-spec-app/docs/api/api/v1/carts/show.md +0 -73
- data/examples/complex-spec-app/docs/api/api/v1/home/index.md +0 -9
- data/examples/complex-spec-app/docs/api/api/v1/home/list.md +0 -47
- data/examples/complex-spec-app/docs/api/api/v1/notes/create.md +0 -94
- data/examples/complex-spec-app/docs/api/api/v1/notes/index.md +0 -10
- data/examples/complex-spec-app/docs/api/api/v1/notes/list.md +0 -61
- data/examples/complex-spec-app/docs/api/api/v1/orders/cancel.md +0 -69
- data/examples/complex-spec-app/docs/api/api/v1/orders/create.md +0 -150
- data/examples/complex-spec-app/docs/api/api/v1/orders/destroy.md +0 -37
- data/examples/complex-spec-app/docs/api/api/v1/orders/index.md +0 -13
- data/examples/complex-spec-app/docs/api/api/v1/orders/list.md +0 -78
- data/examples/complex-spec-app/docs/api/api/v1/orders/show.md +0 -83
- data/examples/complex-spec-app/docs/api/api/v1/products/index.md +0 -11
- data/examples/complex-spec-app/docs/api/api/v1/products/list.md +0 -83
- data/examples/complex-spec-app/docs/api/api/v1/products/search.md +0 -88
- data/examples/complex-spec-app/docs/api/api/v1/products/show.md +0 -71
- data/examples/complex-spec-app/docs/api/api/v1/profiles/index.md +0 -10
- data/examples/complex-spec-app/docs/api/api/v1/profiles/show.md +0 -61
- data/examples/complex-spec-app/docs/api/api/v1/profiles/update.md +0 -91
- data/examples/complex-spec-app/docs/api/api/v2/products/index.md +0 -9
- data/examples/complex-spec-app/docs/api/api/v2/products/list.md +0 -77
- data/examples/complex-spec-app/docs/api/curl/api/v1/admin/products/create.sh +0 -18
- data/examples/complex-spec-app/docs/api/curl/api/v1/admin/products/destroy.sh +0 -9
- data/examples/complex-spec-app/docs/api/curl/api/v1/admin/products/list.sh +0 -9
- data/examples/complex-spec-app/docs/api/curl/api/v1/auth/login.sh +0 -9
- data/examples/complex-spec-app/docs/api/curl/api/v1/cart-items/create.sh +0 -16
- data/examples/complex-spec-app/docs/api/curl/api/v1/cart-items/destroy.sh +0 -9
- data/examples/complex-spec-app/docs/api/curl/api/v1/carts/checkout.sh +0 -13
- data/examples/complex-spec-app/docs/api/curl/api/v1/carts/show.sh +0 -9
- data/examples/complex-spec-app/docs/api/curl/api/v1/home/list.sh +0 -8
- data/examples/complex-spec-app/docs/api/curl/api/v1/notes/create.sh +0 -15
- data/examples/complex-spec-app/docs/api/curl/api/v1/notes/list.sh +0 -9
- data/examples/complex-spec-app/docs/api/curl/api/v1/orders/cancel.sh +0 -9
- data/examples/complex-spec-app/docs/api/curl/api/v1/orders/create.sh +0 -29
- data/examples/complex-spec-app/docs/api/curl/api/v1/orders/destroy.sh +0 -9
- data/examples/complex-spec-app/docs/api/curl/api/v1/orders/list.sh +0 -9
- data/examples/complex-spec-app/docs/api/curl/api/v1/orders/show.sh +0 -9
- data/examples/complex-spec-app/docs/api/curl/api/v1/products/list.sh +0 -8
- data/examples/complex-spec-app/docs/api/curl/api/v1/products/search.sh +0 -8
- data/examples/complex-spec-app/docs/api/curl/api/v1/products/show.sh +0 -8
- data/examples/complex-spec-app/docs/api/curl/api/v1/profiles/show.sh +0 -9
- data/examples/complex-spec-app/docs/api/curl/api/v1/profiles/update.sh +0 -16
- data/examples/complex-spec-app/docs/api/curl/api/v2/products/list.sh +0 -8
- data/examples/complex-spec-app/docs/api/dataset.json +0 -5116
- data/examples/complex-spec-app/docs/api/postman/collection.json +0 -2519
- data/examples/complex-spec-app/generate.rb +0 -14
- data/examples/complex-spec-app/reqcord.yml +0 -28
- data/examples/complex-spec-app/spec/requests/admin_spec.rb +0 -67
- data/examples/complex-spec-app/spec/requests/cart_spec.rb +0 -61
- data/examples/complex-spec-app/spec/requests/home_and_auth_spec.rb +0 -49
- data/examples/complex-spec-app/spec/requests/orders_spec.rb +0 -124
- data/examples/complex-spec-app/spec/requests/products_spec.rb +0 -65
- data/examples/complex-spec-app/spec/spec_helper.rb +0 -17
- data/examples/complex-test-app/README.md +0 -40
- data/examples/complex-test-app/app.rb +0 -384
- data/examples/complex-test-app/docs/api/README.md +0 -104
- data/examples/complex-test-app/docs/api/api/v1/admin/products/create.md +0 -117
- data/examples/complex-test-app/docs/api/api/v1/admin/products/destroy.md +0 -51
- data/examples/complex-test-app/docs/api/api/v1/admin/products/index.md +0 -11
- data/examples/complex-test-app/docs/api/api/v1/admin/products/list.md +0 -106
- data/examples/complex-test-app/docs/api/api/v1/auth/index.md +0 -9
- data/examples/complex-test-app/docs/api/api/v1/auth/login.md +0 -76
- data/examples/complex-test-app/docs/api/api/v1/cart-items/create.md +0 -91
- data/examples/complex-test-app/docs/api/api/v1/cart-items/destroy.md +0 -51
- data/examples/complex-test-app/docs/api/api/v1/cart-items/index.md +0 -10
- data/examples/complex-test-app/docs/api/api/v1/carts/checkout.md +0 -102
- data/examples/complex-test-app/docs/api/api/v1/carts/index.md +0 -10
- data/examples/complex-test-app/docs/api/api/v1/carts/show.md +0 -73
- data/examples/complex-test-app/docs/api/api/v1/home/index.md +0 -9
- data/examples/complex-test-app/docs/api/api/v1/home/list.md +0 -47
- data/examples/complex-test-app/docs/api/api/v1/notes/create.md +0 -94
- data/examples/complex-test-app/docs/api/api/v1/notes/index.md +0 -10
- data/examples/complex-test-app/docs/api/api/v1/notes/list.md +0 -61
- data/examples/complex-test-app/docs/api/api/v1/orders/cancel.md +0 -69
- data/examples/complex-test-app/docs/api/api/v1/orders/create.md +0 -150
- data/examples/complex-test-app/docs/api/api/v1/orders/destroy.md +0 -37
- data/examples/complex-test-app/docs/api/api/v1/orders/index.md +0 -13
- data/examples/complex-test-app/docs/api/api/v1/orders/list.md +0 -71
- data/examples/complex-test-app/docs/api/api/v1/orders/show.md +0 -83
- data/examples/complex-test-app/docs/api/api/v1/products/index.md +0 -11
- data/examples/complex-test-app/docs/api/api/v1/products/list.md +0 -83
- data/examples/complex-test-app/docs/api/api/v1/products/search.md +0 -88
- data/examples/complex-test-app/docs/api/api/v1/products/show.md +0 -71
- data/examples/complex-test-app/docs/api/api/v1/profiles/index.md +0 -10
- data/examples/complex-test-app/docs/api/api/v1/profiles/show.md +0 -61
- data/examples/complex-test-app/docs/api/api/v1/profiles/update.md +0 -91
- data/examples/complex-test-app/docs/api/api/v2/products/index.md +0 -9
- data/examples/complex-test-app/docs/api/api/v2/products/list.md +0 -77
- data/examples/complex-test-app/docs/api/curl/api/v1/admin/products/create.sh +0 -18
- data/examples/complex-test-app/docs/api/curl/api/v1/admin/products/destroy.sh +0 -9
- data/examples/complex-test-app/docs/api/curl/api/v1/admin/products/list.sh +0 -9
- data/examples/complex-test-app/docs/api/curl/api/v1/auth/login.sh +0 -9
- data/examples/complex-test-app/docs/api/curl/api/v1/cart-items/create.sh +0 -16
- data/examples/complex-test-app/docs/api/curl/api/v1/cart-items/destroy.sh +0 -9
- data/examples/complex-test-app/docs/api/curl/api/v1/carts/checkout.sh +0 -13
- data/examples/complex-test-app/docs/api/curl/api/v1/carts/show.sh +0 -9
- data/examples/complex-test-app/docs/api/curl/api/v1/home/list.sh +0 -8
- data/examples/complex-test-app/docs/api/curl/api/v1/notes/create.sh +0 -15
- data/examples/complex-test-app/docs/api/curl/api/v1/notes/list.sh +0 -9
- data/examples/complex-test-app/docs/api/curl/api/v1/orders/cancel.sh +0 -9
- data/examples/complex-test-app/docs/api/curl/api/v1/orders/create.sh +0 -29
- data/examples/complex-test-app/docs/api/curl/api/v1/orders/destroy.sh +0 -9
- data/examples/complex-test-app/docs/api/curl/api/v1/orders/list.sh +0 -9
- data/examples/complex-test-app/docs/api/curl/api/v1/orders/show.sh +0 -9
- data/examples/complex-test-app/docs/api/curl/api/v1/products/list.sh +0 -8
- data/examples/complex-test-app/docs/api/curl/api/v1/products/search.sh +0 -8
- data/examples/complex-test-app/docs/api/curl/api/v1/products/show.sh +0 -8
- data/examples/complex-test-app/docs/api/curl/api/v1/profiles/show.sh +0 -9
- data/examples/complex-test-app/docs/api/curl/api/v1/profiles/update.sh +0 -16
- data/examples/complex-test-app/docs/api/curl/api/v2/products/list.sh +0 -8
- data/examples/complex-test-app/docs/api/dataset.json +0 -5109
- data/examples/complex-test-app/docs/api/postman/collection.json +0 -2568
- data/examples/complex-test-app/generate.rb +0 -14
- data/examples/complex-test-app/reqcord.yml +0 -28
- data/examples/complex-test-app/test/integration/admin_test.rb +0 -70
- data/examples/complex-test-app/test/integration/cart_test.rb +0 -64
- data/examples/complex-test-app/test/integration/home_and_auth_test.rb +0 -53
- data/examples/complex-test-app/test/integration/orders_test.rb +0 -127
- data/examples/complex-test-app/test/integration/products_test.rb +0 -66
- data/examples/spec-app/.rspec +0 -1
- data/examples/spec-app/README.md +0 -36
- data/examples/spec-app/app.rb +0 -209
- data/examples/spec-app/docs/api/README.md +0 -45
- data/examples/spec-app/docs/api/api/v1/customers/create.md +0 -95
- data/examples/spec-app/docs/api/api/v1/customers/index.md +0 -11
- data/examples/spec-app/docs/api/api/v1/customers/list.md +0 -67
- data/examples/spec-app/docs/api/api/v1/customers/show.md +0 -65
- data/examples/spec-app/docs/api/api/v1/tasks/complete.md +0 -51
- data/examples/spec-app/docs/api/api/v1/tasks/create.md +0 -90
- data/examples/spec-app/docs/api/api/v1/tasks/destroy.md +0 -35
- data/examples/spec-app/docs/api/api/v1/tasks/index.md +0 -14
- data/examples/spec-app/docs/api/api/v1/tasks/list.md +0 -65
- data/examples/spec-app/docs/api/api/v1/tasks/show.md +0 -65
- data/examples/spec-app/docs/api/api/v1/tasks/update.md +0 -74
- data/examples/spec-app/docs/api/api/v1/users/create.md +0 -95
- data/examples/spec-app/docs/api/api/v1/users/index.md +0 -11
- data/examples/spec-app/docs/api/api/v1/users/list.md +0 -67
- data/examples/spec-app/docs/api/api/v1/users/show.md +0 -65
- data/examples/spec-app/docs/api/curl/api/v1/customers/create.sh +0 -17
- data/examples/spec-app/docs/api/curl/api/v1/customers/list.sh +0 -9
- data/examples/spec-app/docs/api/curl/api/v1/customers/show.sh +0 -9
- data/examples/spec-app/docs/api/curl/api/v1/tasks/complete.sh +0 -8
- data/examples/spec-app/docs/api/curl/api/v1/tasks/create.sh +0 -15
- data/examples/spec-app/docs/api/curl/api/v1/tasks/destroy.sh +0 -8
- data/examples/spec-app/docs/api/curl/api/v1/tasks/list.sh +0 -8
- data/examples/spec-app/docs/api/curl/api/v1/tasks/show.sh +0 -8
- data/examples/spec-app/docs/api/curl/api/v1/tasks/update.sh +0 -14
- data/examples/spec-app/docs/api/curl/api/v1/users/create.sh +0 -17
- data/examples/spec-app/docs/api/curl/api/v1/users/list.sh +0 -9
- data/examples/spec-app/docs/api/curl/api/v1/users/show.sh +0 -9
- data/examples/spec-app/docs/api/dataset.json +0 -2402
- data/examples/spec-app/docs/api/postman/collection.json +0 -1290
- data/examples/spec-app/generate.rb +0 -14
- data/examples/spec-app/reqcord.yml +0 -27
- data/examples/spec-app/spec/requests/customers_spec.rb +0 -71
- data/examples/spec-app/spec/requests/tasks_spec.rb +0 -78
- data/examples/spec-app/spec/requests/users_spec.rb +0 -68
- data/examples/spec-app/spec/spec_helper.rb +0 -17
- data/examples/test-app/README.md +0 -57
- data/examples/test-app/app.rb +0 -212
- data/examples/test-app/docs/api/README.md +0 -45
- data/examples/test-app/docs/api/api/v1/customers/create.md +0 -95
- data/examples/test-app/docs/api/api/v1/customers/index.md +0 -11
- data/examples/test-app/docs/api/api/v1/customers/list.md +0 -67
- data/examples/test-app/docs/api/api/v1/customers/show.md +0 -65
- data/examples/test-app/docs/api/api/v1/tasks/complete.md +0 -51
- data/examples/test-app/docs/api/api/v1/tasks/create.md +0 -90
- data/examples/test-app/docs/api/api/v1/tasks/destroy.md +0 -35
- data/examples/test-app/docs/api/api/v1/tasks/index.md +0 -14
- data/examples/test-app/docs/api/api/v1/tasks/list.md +0 -65
- data/examples/test-app/docs/api/api/v1/tasks/show.md +0 -65
- data/examples/test-app/docs/api/api/v1/tasks/update.md +0 -74
- data/examples/test-app/docs/api/api/v1/users/create.md +0 -95
- data/examples/test-app/docs/api/api/v1/users/index.md +0 -11
- data/examples/test-app/docs/api/api/v1/users/list.md +0 -67
- data/examples/test-app/docs/api/api/v1/users/show.md +0 -65
- data/examples/test-app/docs/api/curl/api/v1/customers/create.sh +0 -17
- data/examples/test-app/docs/api/curl/api/v1/customers/list.sh +0 -9
- data/examples/test-app/docs/api/curl/api/v1/customers/show.sh +0 -9
- data/examples/test-app/docs/api/curl/api/v1/tasks/complete.sh +0 -8
- data/examples/test-app/docs/api/curl/api/v1/tasks/create.sh +0 -15
- data/examples/test-app/docs/api/curl/api/v1/tasks/destroy.sh +0 -8
- data/examples/test-app/docs/api/curl/api/v1/tasks/list.sh +0 -8
- data/examples/test-app/docs/api/curl/api/v1/tasks/show.sh +0 -8
- data/examples/test-app/docs/api/curl/api/v1/tasks/update.sh +0 -14
- data/examples/test-app/docs/api/curl/api/v1/users/create.sh +0 -17
- data/examples/test-app/docs/api/curl/api/v1/users/list.sh +0 -9
- data/examples/test-app/docs/api/curl/api/v1/users/show.sh +0 -9
- data/examples/test-app/docs/api/dataset.json +0 -2402
- data/examples/test-app/docs/api/postman/collection.json +0 -1290
- data/examples/test-app/generate.rb +0 -14
- data/examples/test-app/reqcord.yml +0 -28
- data/examples/test-app/test/integration/customers_test.rb +0 -72
- data/examples/test-app/test/integration/tasks_test.rb +0 -80
- data/examples/test-app/test/integration/users_test.rb +0 -72
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
# Get Product
|
|
2
|
-
|
|
3
|
-
`GET /api/v1/products/:id`
|
|
4
|
-
|
|
5
|
-
Namespace: `api/v1`
|
|
6
|
-
|
|
7
|
-
## Headers
|
|
8
|
-
|
|
9
|
-
| Header | Value |
|
|
10
|
-
| --- | --- |
|
|
11
|
-
| Accept | `application/json` |
|
|
12
|
-
|
|
13
|
-
## Path Parameters
|
|
14
|
-
|
|
15
|
-
| Field | Type | Required | Values |
|
|
16
|
-
| --- | --- | --- | --- |
|
|
17
|
-
| `id` | string | yes | `"3"` |
|
|
18
|
-
|
|
19
|
-
## cURL
|
|
20
|
-
|
|
21
|
-
```bash
|
|
22
|
-
curl --request GET \
|
|
23
|
-
--url "http://localhost:3000/api/v1/products/3" \
|
|
24
|
-
--header "Accept: application/json"
|
|
25
|
-
```
|
|
26
|
-
|
|
27
|
-
## Responses
|
|
28
|
-
|
|
29
|
-
### 200 OK
|
|
30
|
-
|
|
31
|
-
#### Fields
|
|
32
|
-
|
|
33
|
-
| Field | Type | Required | Values |
|
|
34
|
-
| --- | --- | --- | --- |
|
|
35
|
-
| `id` | integer | yes | `3` |
|
|
36
|
-
| `sku` | string | yes | `"MUG-001"` |
|
|
37
|
-
| `name` | string | yes | `"Stoneware Mug"` |
|
|
38
|
-
| `category` | string | yes | `"mugs"` |
|
|
39
|
-
| `price_cents` | integer | yes | `2400` |
|
|
40
|
-
| `tags[]` | string | yes | `"ceramic"` |
|
|
41
|
-
|
|
42
|
-
```json
|
|
43
|
-
{
|
|
44
|
-
"id": 3,
|
|
45
|
-
"sku": "MUG-001",
|
|
46
|
-
"name": "Stoneware Mug",
|
|
47
|
-
"category": "mugs",
|
|
48
|
-
"price_cents": 2400,
|
|
49
|
-
"tags": [
|
|
50
|
-
"ceramic"
|
|
51
|
-
]
|
|
52
|
-
}
|
|
53
|
-
```
|
|
54
|
-
|
|
55
|
-
### 404 Not Found
|
|
56
|
-
|
|
57
|
-
#### Fields
|
|
58
|
-
|
|
59
|
-
| Field | Type | Required | Values |
|
|
60
|
-
| --- | --- | --- | --- |
|
|
61
|
-
| `error` | string | yes | `"Not Found"` |
|
|
62
|
-
|
|
63
|
-
```json
|
|
64
|
-
{
|
|
65
|
-
"error": "Not Found"
|
|
66
|
-
}
|
|
67
|
-
```
|
|
68
|
-
|
|
69
|
-
---
|
|
70
|
-
|
|
71
|
-
Resource: [Products](index.md)
|
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
# Get Profile
|
|
2
|
-
|
|
3
|
-
`GET /api/v1/profile`
|
|
4
|
-
|
|
5
|
-
Namespace: `api/v1`
|
|
6
|
-
|
|
7
|
-
## Headers
|
|
8
|
-
|
|
9
|
-
| Header | Value |
|
|
10
|
-
| --- | --- |
|
|
11
|
-
| Authorization | `Bearer {{token}}` |
|
|
12
|
-
| Accept | `application/json` |
|
|
13
|
-
|
|
14
|
-
## cURL
|
|
15
|
-
|
|
16
|
-
```bash
|
|
17
|
-
curl --request GET \
|
|
18
|
-
--url "http://localhost:3000/api/v1/profile" \
|
|
19
|
-
--header "Authorization: Bearer {{token}}" \
|
|
20
|
-
--header "Accept: application/json"
|
|
21
|
-
```
|
|
22
|
-
|
|
23
|
-
## Responses
|
|
24
|
-
|
|
25
|
-
### 200 OK
|
|
26
|
-
|
|
27
|
-
#### Fields
|
|
28
|
-
|
|
29
|
-
| Field | Type | Required | Values |
|
|
30
|
-
| --- | --- | --- | --- |
|
|
31
|
-
| `id` | integer | yes | `1` |
|
|
32
|
-
| `name` | string | yes | `"Ada Lovelace"` |
|
|
33
|
-
| `email` | string | yes | `"ada@example.com"` |
|
|
34
|
-
| `locale` | string | yes | `"en"` |
|
|
35
|
-
|
|
36
|
-
```json
|
|
37
|
-
{
|
|
38
|
-
"id": 1,
|
|
39
|
-
"name": "Ada Lovelace",
|
|
40
|
-
"email": "ada@example.com",
|
|
41
|
-
"locale": "en"
|
|
42
|
-
}
|
|
43
|
-
```
|
|
44
|
-
|
|
45
|
-
### 401 Unauthorized
|
|
46
|
-
|
|
47
|
-
#### Fields
|
|
48
|
-
|
|
49
|
-
| Field | Type | Required | Values |
|
|
50
|
-
| --- | --- | --- | --- |
|
|
51
|
-
| `error` | string | yes | `"Unauthorized"` |
|
|
52
|
-
|
|
53
|
-
```json
|
|
54
|
-
{
|
|
55
|
-
"error": "Unauthorized"
|
|
56
|
-
}
|
|
57
|
-
```
|
|
58
|
-
|
|
59
|
-
---
|
|
60
|
-
|
|
61
|
-
Resource: [Profiles](index.md)
|
|
@@ -1,91 +0,0 @@
|
|
|
1
|
-
# Update Profile
|
|
2
|
-
|
|
3
|
-
`PATCH /api/v1/profile` (also `PUT`)
|
|
4
|
-
|
|
5
|
-
Namespace: `api/v1`
|
|
6
|
-
|
|
7
|
-
## Headers
|
|
8
|
-
|
|
9
|
-
| Header | Value |
|
|
10
|
-
| --- | --- |
|
|
11
|
-
| Authorization | `Bearer {{token}}` |
|
|
12
|
-
| Content-Type | `application/json` |
|
|
13
|
-
| Accept | `application/json` |
|
|
14
|
-
|
|
15
|
-
## Body Parameters
|
|
16
|
-
|
|
17
|
-
| Field | Type | Required | Values |
|
|
18
|
-
| --- | --- | --- | --- |
|
|
19
|
-
| `profile.name` | string | yes | `"Ada L."` |
|
|
20
|
-
| `profile.locale` | string | yes | `"tr"` |
|
|
21
|
-
|
|
22
|
-
## Example Request
|
|
23
|
-
|
|
24
|
-
```json
|
|
25
|
-
{
|
|
26
|
-
"profile": {
|
|
27
|
-
"name": "Ada L.",
|
|
28
|
-
"locale": "tr"
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
```
|
|
32
|
-
|
|
33
|
-
## cURL
|
|
34
|
-
|
|
35
|
-
```bash
|
|
36
|
-
curl --request PATCH \
|
|
37
|
-
--url "http://localhost:3000/api/v1/profile" \
|
|
38
|
-
--header "Authorization: Bearer {{token}}" \
|
|
39
|
-
--header "Content-Type: application/json" \
|
|
40
|
-
--header "Accept: application/json" \
|
|
41
|
-
--data '{
|
|
42
|
-
"profile": {
|
|
43
|
-
"name": "Ada L.",
|
|
44
|
-
"locale": "tr"
|
|
45
|
-
}
|
|
46
|
-
}'
|
|
47
|
-
```
|
|
48
|
-
|
|
49
|
-
## Responses
|
|
50
|
-
|
|
51
|
-
### 200 OK
|
|
52
|
-
|
|
53
|
-
#### Fields
|
|
54
|
-
|
|
55
|
-
| Field | Type | Required | Values |
|
|
56
|
-
| --- | --- | --- | --- |
|
|
57
|
-
| `id` | integer | yes | `1` |
|
|
58
|
-
| `name` | string | yes | `"Ada L."` |
|
|
59
|
-
| `email` | string | yes | `"ada@example.com"` |
|
|
60
|
-
| `locale` | string | yes | `"tr"` |
|
|
61
|
-
|
|
62
|
-
```json
|
|
63
|
-
{
|
|
64
|
-
"id": 1,
|
|
65
|
-
"name": "Ada L.",
|
|
66
|
-
"email": "ada@example.com",
|
|
67
|
-
"locale": "tr"
|
|
68
|
-
}
|
|
69
|
-
```
|
|
70
|
-
|
|
71
|
-
### 422 Unprocessable Content
|
|
72
|
-
|
|
73
|
-
#### Fields
|
|
74
|
-
|
|
75
|
-
| Field | Type | Required | Values |
|
|
76
|
-
| --- | --- | --- | --- |
|
|
77
|
-
| `errors.locale[]` | string | yes | `"is not included in the list"` |
|
|
78
|
-
|
|
79
|
-
```json
|
|
80
|
-
{
|
|
81
|
-
"errors": {
|
|
82
|
-
"locale": [
|
|
83
|
-
"is not included in the list"
|
|
84
|
-
]
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
```
|
|
88
|
-
|
|
89
|
-
---
|
|
90
|
-
|
|
91
|
-
Resource: [Profiles](index.md)
|
|
@@ -1,77 +0,0 @@
|
|
|
1
|
-
# List Products
|
|
2
|
-
|
|
3
|
-
`GET /api/v2/products`
|
|
4
|
-
|
|
5
|
-
Namespace: `api/v2`
|
|
6
|
-
|
|
7
|
-
## Headers
|
|
8
|
-
|
|
9
|
-
| Header | Value |
|
|
10
|
-
| --- | --- |
|
|
11
|
-
| Accept | `application/json` |
|
|
12
|
-
|
|
13
|
-
## Query Parameters
|
|
14
|
-
|
|
15
|
-
| Field | Type | Required | Values |
|
|
16
|
-
| --- | --- | --- | --- |
|
|
17
|
-
| `cursor` | string | no | `"eyJpZCI6Mn0"` |
|
|
18
|
-
|
|
19
|
-
## cURL
|
|
20
|
-
|
|
21
|
-
```bash
|
|
22
|
-
curl --request GET \
|
|
23
|
-
--url "http://localhost:3000/api/v2/products?cursor=eyJpZCI6Mn0" \
|
|
24
|
-
--header "Accept: application/json"
|
|
25
|
-
```
|
|
26
|
-
|
|
27
|
-
## Responses
|
|
28
|
-
|
|
29
|
-
### 200 OK
|
|
30
|
-
|
|
31
|
-
#### Fields
|
|
32
|
-
|
|
33
|
-
| Field | Type | Required | Values |
|
|
34
|
-
| --- | --- | --- | --- |
|
|
35
|
-
| `items[].id` | integer | yes | `4` |
|
|
36
|
-
| `items[].sku` | string | yes | `"MUG-002"` |
|
|
37
|
-
| `items[].name` | string | yes | `"Travel Mug"` |
|
|
38
|
-
| `items[].category` | string | yes | `"mugs"` \| `"tea"` |
|
|
39
|
-
| `items[].price_cents` | integer | yes | `3200` |
|
|
40
|
-
| `items[].tags[]` | string | yes | `"green"` \| `"insulated"` |
|
|
41
|
-
| `items[].price` | string | yes | `"32.00"` |
|
|
42
|
-
| `next_cursor` | null | string | yes | `"eyJpZCI6Mn0"` |
|
|
43
|
-
|
|
44
|
-
```json
|
|
45
|
-
{
|
|
46
|
-
"items": [
|
|
47
|
-
{
|
|
48
|
-
"id": 3,
|
|
49
|
-
"sku": "MUG-001",
|
|
50
|
-
"name": "Stoneware Mug",
|
|
51
|
-
"category": "mugs",
|
|
52
|
-
"price_cents": 2400,
|
|
53
|
-
"tags": [
|
|
54
|
-
"ceramic"
|
|
55
|
-
],
|
|
56
|
-
"price": "24.00"
|
|
57
|
-
},
|
|
58
|
-
{
|
|
59
|
-
"id": 4,
|
|
60
|
-
"sku": "MUG-002",
|
|
61
|
-
"name": "Travel Mug",
|
|
62
|
-
"category": "mugs",
|
|
63
|
-
"price_cents": 3200,
|
|
64
|
-
"tags": [
|
|
65
|
-
"steel",
|
|
66
|
-
"insulated"
|
|
67
|
-
],
|
|
68
|
-
"price": "32.00"
|
|
69
|
-
}
|
|
70
|
-
],
|
|
71
|
-
"next_cursor": null
|
|
72
|
-
}
|
|
73
|
-
```
|
|
74
|
-
|
|
75
|
-
---
|
|
76
|
-
|
|
77
|
-
Resource: [Products](index.md)
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env bash
|
|
2
|
-
set -euo pipefail
|
|
3
|
-
|
|
4
|
-
# Create Product
|
|
5
|
-
# POST /api/v1/admin/products
|
|
6
|
-
curl --request POST \
|
|
7
|
-
--url "http://localhost:3000/api/v1/admin/products" \
|
|
8
|
-
--header "X-Api-Key: {{api_key}}" \
|
|
9
|
-
--header "Content-Type: application/json" \
|
|
10
|
-
--header "Accept: application/json" \
|
|
11
|
-
--data '{
|
|
12
|
-
"product": {
|
|
13
|
-
"sku": "TEA-003",
|
|
14
|
-
"name": "Jasmine",
|
|
15
|
-
"category": "tea",
|
|
16
|
-
"price_cents": 1400
|
|
17
|
-
}
|
|
18
|
-
}'
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env bash
|
|
2
|
-
set -euo pipefail
|
|
3
|
-
|
|
4
|
-
# Login
|
|
5
|
-
# POST /api/v1/auth/login
|
|
6
|
-
curl --request POST \
|
|
7
|
-
--url "http://localhost:3000/api/v1/auth/login" \
|
|
8
|
-
--header "Content-Type: application/x-www-form-urlencoded" \
|
|
9
|
-
--data 'email=ada%40example.com&password=%7B%7Bpassword%7D%7D'
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env bash
|
|
2
|
-
set -euo pipefail
|
|
3
|
-
|
|
4
|
-
# Create Cart Item
|
|
5
|
-
# POST /api/v1/cart/items
|
|
6
|
-
curl --request POST \
|
|
7
|
-
--url "http://localhost:3000/api/v1/cart/items" \
|
|
8
|
-
--header "Authorization: Bearer {{token}}" \
|
|
9
|
-
--header "Content-Type: application/json" \
|
|
10
|
-
--header "Accept: application/json" \
|
|
11
|
-
--data '{
|
|
12
|
-
"item": {
|
|
13
|
-
"sku": "TEA-002",
|
|
14
|
-
"quantity": 3
|
|
15
|
-
}
|
|
16
|
-
}'
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env bash
|
|
2
|
-
set -euo pipefail
|
|
3
|
-
|
|
4
|
-
# Delete Cart Item
|
|
5
|
-
# DELETE /api/v1/cart/items/:sku
|
|
6
|
-
curl --request DELETE \
|
|
7
|
-
--url "http://localhost:3000/api/v1/cart/items/TEA-001" \
|
|
8
|
-
--header "Authorization: Bearer {{token}}" \
|
|
9
|
-
--header "Accept: application/json"
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env bash
|
|
2
|
-
set -euo pipefail
|
|
3
|
-
|
|
4
|
-
# Checkout Cart
|
|
5
|
-
# POST /api/v1/cart/checkout
|
|
6
|
-
curl --request POST \
|
|
7
|
-
--url "http://localhost:3000/api/v1/cart/checkout" \
|
|
8
|
-
--header "Authorization: Bearer {{token}}" \
|
|
9
|
-
--header "Content-Type: application/json" \
|
|
10
|
-
--header "Accept: application/json" \
|
|
11
|
-
--data '{
|
|
12
|
-
"payment_method": "card"
|
|
13
|
-
}'
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env bash
|
|
2
|
-
set -euo pipefail
|
|
3
|
-
|
|
4
|
-
# Create Note
|
|
5
|
-
# POST /api/v1/orders/:order_id/notes
|
|
6
|
-
curl --request POST \
|
|
7
|
-
--url "http://localhost:3000/api/v1/orders/1/notes" \
|
|
8
|
-
--header "Authorization: Bearer {{token}}" \
|
|
9
|
-
--header "Content-Type: application/json" \
|
|
10
|
-
--header "Accept: application/json" \
|
|
11
|
-
--data '{
|
|
12
|
-
"note": {
|
|
13
|
-
"body": "Ring the bell twice"
|
|
14
|
-
}
|
|
15
|
-
}'
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env bash
|
|
2
|
-
set -euo pipefail
|
|
3
|
-
|
|
4
|
-
# Create Order
|
|
5
|
-
# POST /api/v1/orders
|
|
6
|
-
curl --request POST \
|
|
7
|
-
--url "http://localhost:3000/api/v1/orders" \
|
|
8
|
-
--header "Authorization: Bearer {{token}}" \
|
|
9
|
-
--header "Content-Type: application/json" \
|
|
10
|
-
--header "Accept: application/json" \
|
|
11
|
-
--data '{
|
|
12
|
-
"order": {
|
|
13
|
-
"line_items": [
|
|
14
|
-
{
|
|
15
|
-
"sku": "TEA-001",
|
|
16
|
-
"quantity": 2
|
|
17
|
-
},
|
|
18
|
-
{
|
|
19
|
-
"sku": "MUG-001",
|
|
20
|
-
"quantity": 1
|
|
21
|
-
}
|
|
22
|
-
],
|
|
23
|
-
"shipping_address": {
|
|
24
|
-
"line1": "1 Analytical Engine Way",
|
|
25
|
-
"city": "London",
|
|
26
|
-
"country": "GB"
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
}'
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env bash
|
|
2
|
-
set -euo pipefail
|
|
3
|
-
|
|
4
|
-
# Update Profile
|
|
5
|
-
# PATCH /api/v1/profile
|
|
6
|
-
curl --request PATCH \
|
|
7
|
-
--url "http://localhost:3000/api/v1/profile" \
|
|
8
|
-
--header "Authorization: Bearer {{token}}" \
|
|
9
|
-
--header "Content-Type: application/json" \
|
|
10
|
-
--header "Accept: application/json" \
|
|
11
|
-
--data '{
|
|
12
|
-
"profile": {
|
|
13
|
-
"name": "Ada L.",
|
|
14
|
-
"locale": "tr"
|
|
15
|
-
}
|
|
16
|
-
}'
|