Skip to content

Commit da9386a

Browse files
clean catalog endpoints doc
1 parent c7b825b commit da9386a

File tree

6 files changed

+237
-57
lines changed

6 files changed

+237
-57
lines changed

content/swagger/resources/app_catalogs/routes/app_catalogs.yaml

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ get:
6666
401:
6767
$ref: "#/responses/401Error"
6868
403:
69-
$ref: "#/responses/403Error"
69+
$ref: "#/responses/403CatalogError"
7070
post:
7171
summary: Create a new catalog
7272
operationId: "post_app_catalog"
@@ -90,8 +90,27 @@ post:
9090
401:
9191
$ref: "#/responses/401Error"
9292
403:
93-
$ref: "#/responses/403Error"
93+
$ref: "#/responses/403CatalogError"
9494
415:
9595
$ref: "#/responses/415Error"
9696
422:
97-
$ref: "#/responses/422Error"
97+
description: Unprocessable entity
98+
x-details: The validation of the entity given in the body of the request failed
99+
schema:
100+
$ref: "#/definitions/Error"
101+
x-examples-per-version:
102+
- x-version: 'SaaS'
103+
x-example: {
104+
"code": 422,
105+
"message": "Validation failed.",
106+
"errors": [
107+
{
108+
"property": "name",
109+
"message": "This value should not be blank."
110+
},
111+
{
112+
"property": "name",
113+
"message": "This value is too short. It should have 1 character or more."
114+
}
115+
]
116+
}

content/swagger/resources/app_catalogs/routes/app_catalogs_id.yaml

Lines changed: 27 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@ get:
2222
401:
2323
$ref: "#/responses/401Error"
2424
403:
25-
$ref: "#/responses/403Error"
25+
$ref: "#/responses/403CatalogError"
2626
404:
27-
$ref: "#/responses/404Error"
27+
$ref: "#/responses/404CatalogError"
2828
patch:
2929
summary: Update a catalog
3030
operationId: "patch_app_catalog"
@@ -53,18 +53,37 @@ patch:
5353
401:
5454
$ref: "#/responses/401Error"
5555
403:
56-
$ref: "#/responses/403Error"
56+
$ref: "#/responses/403CatalogError"
5757
404:
58-
$ref: "#/responses/404Error"
58+
$ref: "#/responses/404CatalogError"
5959
415:
6060
$ref: "#/responses/415Error"
6161
422:
62-
$ref: "#/responses/422Error"
62+
description: Unprocessable entity
63+
x-details: The validation of the entity given in the body of the request failed
64+
schema:
65+
$ref: "#/definitions/Error"
66+
x-examples-per-version:
67+
- x-version: 'SaaS'
68+
x-example: {
69+
"code": 422,
70+
"message": "Validation failed.",
71+
"errors": [
72+
{
73+
"property": "name",
74+
"message": "This value should not be blank."
75+
},
76+
{
77+
"property": "name",
78+
"message": "This value is too short. It should have 1 character or more."
79+
}
80+
]
81+
}
6382
delete:
6483
summary: Delete a catalog
6584
operationId: "delete_app_catalog"
6685
tags:
67-
- Catalog
86+
- Catalogs
6887
x-versions:
6988
- "SaaS"
7089
x-app-token: true
@@ -82,6 +101,6 @@ delete:
82101
401:
83102
$ref: "#/responses/401Error"
84103
403:
85-
$ref: "#/responses/403Error"
104+
$ref: "#/responses/403CatalogError"
86105
404:
87-
$ref: "#/responses/404Error"
106+
$ref: "#/responses/404CatalogError"

content/swagger/resources/app_catalogs/routes/app_catalogs_id_product_uuids.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,6 @@ get:
6565
401:
6666
$ref: "#/responses/401Error"
6767
403:
68-
$ref: "#/responses/403Error"
68+
$ref: "#/responses/403CatalogError"
6969
404:
70-
$ref: "#/responses/404Error"
70+
$ref: "#/responses/404CatalogError"

content/swagger/resources/app_catalogs/routes/app_catalogs_id_products.yaml

Lines changed: 165 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -44,29 +44,171 @@ get:
4444
x-examples-per-version:
4545
- x-version: 'SaaS'
4646
x-example: {
47-
"TODO"
48-
}
47+
"_links": {
48+
"self": {
49+
"href": "https://demo.akeneo.com/api/rest/v1/catalogs/65f5a521-e65c-4d7b-8be8-1f267fa2729c/products?limit=3"
50+
},
51+
"first": {
52+
"href": "https://demo.akeneo.com/api/rest/v1/catalogs/65f5a521-e65c-4d7b-8be8-1f267fa2729c/products?limit=3"
53+
},
54+
"next": {
55+
"href": "https://demo.akeneo.com/api/rest/v1/catalogs/65f5a521-e65c-4d7b-8be8-1f267fa2729c/products?search_after=0059d30f-6874-4277-81ed-3b3657c83f5e&limit=3"
56+
}
57+
},
58+
"_embedded": {
59+
"items": [
60+
{
61+
"uuid": "00073089-1310-4340-bcf0-9e33e4019b79",
62+
"enabled": true,
63+
"family": "mens_clothing",
64+
"categories": [
65+
"Cloths"
66+
],
67+
"groups": [],
68+
"parent": null,
69+
"values": {
70+
"Default_Price": [
71+
{
72+
"locale": null,
73+
"scope": null,
74+
"data": [
75+
{
76+
"amount": "10.00",
77+
"currency": "USD"
78+
}
79+
]
80+
}
81+
],
82+
"sku": [
83+
{
84+
"locale": null,
85+
"scope": null,
86+
"data": "product_416"
87+
}
88+
],
89+
"Name": [
90+
{
91+
"locale": null,
92+
"scope": null,
93+
"data": "Product 416"
94+
}
95+
],
96+
"Weight": [
97+
{
98+
"locale": null,
99+
"scope": null,
100+
"data": {
101+
"amount": 10,
102+
"unit": "KILOGRAM"
103+
}
104+
}
105+
]
106+
},
107+
"created": "2022-03-14T15:25:45+00:00",
108+
"updated": "2022-06-24T12:54:58+00:00",
109+
"associations": {
110+
"PACK": {
111+
"products": [],
112+
"product_models": [],
113+
"groups": []
114+
},
115+
"UPSELL": {
116+
"products": [],
117+
"product_models": [],
118+
"groups": []
119+
},
120+
"X_SELL": {
121+
"products": [],
122+
"product_models": [],
123+
"groups": []
124+
},
125+
"SUBSTITUTION": {
126+
"products": [],
127+
"product_models": [],
128+
"groups": []
129+
}
130+
},
131+
"quantified_associations": {}
132+
},
133+
{
134+
"uuid": "00248acf-f1f7-45cb-b409-c8c4b9a17a86",
135+
"enabled": true,
136+
"family": "mens_clothing",
137+
"categories": [
138+
"Cloths"
139+
],
140+
"groups": [],
141+
"parent": null,
142+
"values": {
143+
"Default_Price": [
144+
{
145+
"locale": null,
146+
"scope": null,
147+
"data": [
148+
{
149+
"amount": "10.00",
150+
"currency": "USD"
151+
}
152+
]
153+
}
154+
],
155+
"sku": [
156+
{
157+
"locale": null,
158+
"scope": null,
159+
"data": "product_470"
160+
}
161+
],
162+
"Name": [
163+
{
164+
"locale": null,
165+
"scope": null,
166+
"data": "Product 470"
167+
}
168+
],
169+
"Weight": [
170+
{
171+
"locale": null,
172+
"scope": null,
173+
"data": {
174+
"amount": 10,
175+
"unit": "KILOGRAM"
176+
}
177+
}
178+
]
179+
},
180+
"created": "2022-03-14T15:25:45+00:00",
181+
"updated": "2022-06-24T12:55:01+00:00",
182+
"associations": {
183+
"PACK": {
184+
"products": [],
185+
"product_models": [],
186+
"groups": []
187+
},
188+
"UPSELL": {
189+
"products": [],
190+
"product_models": [],
191+
"groups": []
192+
},
193+
"X_SELL": {
194+
"products": [],
195+
"product_models": [],
196+
"groups": []
197+
},
198+
"SUBSTITUTION": {
199+
"products": [],
200+
"product_models": [],
201+
"groups": []
202+
}
203+
},
204+
"quantified_associations": {}
205+
}
206+
]
207+
}
208+
}
49209
401:
50-
description: Unauthorized
51-
x-examples-per-version:
52-
- x-version: 'SaaS'
53-
x-example: {
54-
code: 403,
55-
message: "TODO"
56-
}
210+
$ref: "#/responses/401Error"
57211
403:
58-
description: Access forbidden
59-
x-examples-per-version:
60-
- x-version: 'SaaS'
61-
x-example: {
62-
code: 403,
63-
message: "TODO"
64-
}
212+
$ref: "#/responses/403CatalogError"
65213
404:
66-
description: Not found
67-
x-examples-per-version:
68-
- x-version: 'SaaS'
69-
x-example: {
70-
code: 403,
71-
message: "TODO"
72-
}
214+
$ref: "#/responses/404CatalogError"

content/swagger/resources/app_catalogs/routes/app_catalogs_id_products_uuid.yaml

Lines changed: 3 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -42,26 +42,8 @@ get:
4242
}
4343
}
4444
401:
45-
description: Unauthorized
46-
x-examples-per-version:
47-
- x-version: 'SaaS'
48-
x-example: {
49-
code: 403,
50-
message: "TODO"
51-
}
45+
$ref: "#/responses/401Error"
5246
403:
53-
description: Access forbidden
54-
x-examples-per-version:
55-
- x-version: 'SaaS'
56-
x-example: {
57-
code: 403,
58-
message: "TODO"
59-
}
47+
$ref: "#/responses/403CatalogError"
6048
404:
61-
description: Not found
62-
x-examples-per-version:
63-
- x-version: 'SaaS'
64-
x-example: {
65-
code: 403,
66-
message: "TODO"
67-
}
49+
$ref: "#/responses/404CatalogError"

content/swagger/responses.yaml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,3 +144,21 @@ DeprecatedAssetReferenceFileUploaded:
144144
x-no-entity: true
145145
schema:
146146
$ref: "#/definitions/DeprecatedAssetReferenceFileUploadWarning"
147+
403CatalogError:
148+
description: Access forbidden
149+
x-details: The app does not have the permission to execute this request
150+
schema:
151+
$ref: "#/definitions/Error"
152+
examples: {
153+
"code":403,
154+
"message":"Access forbidden. You are not allowed to list catalogs."
155+
}
156+
404CatalogError:
157+
description: Catalog not found
158+
x-details: The catalog id given in the URI does not exist
159+
schema:
160+
$ref: "#/definitions/Error"
161+
examples: {
162+
"code": 404,
163+
"message": "Catalog \"65f5a521-e65c-4d7b-8be8-1f267fa2729c\" does not exist or you can't access it."
164+
}

0 commit comments

Comments
 (0)