Skip to content

Commit b328269

Browse files
Merge pull request #694 from akeneo/new-catalog-endpoint
Catalog documentation cleanup
2 parents c5b6f5e + 9dc6b8c commit b328269

File tree

9 files changed

+378
-19
lines changed

9 files changed

+378
-19
lines changed

content/apps/catalogs.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,20 @@ To ensure Akeneo PXM Studio remains stable, we added some limits to catalogs:
2929
- Each app can create up to **15 catalogs**.
3030
- A product selection can have up to **25 selection criteria**.
3131

32+
### Troubleshooting
33+
34+
#### Automatic deactivation on catalogs
35+
36+
When a product selection becomes invalid, e.g. a selected category no longer exists, the PIM automatically disables the catalog.
37+
38+
In that case, your app receives an HTTP 200 response containing the following payload.
39+
40+
```json
41+
{
42+
"error": "No products to synchronize. The catalog \"65f5a521-e65c-4d7b-8be8-1f267fa2729c\" has been disabled on the PIM side. Note that you can get catalogs status with the GET /api/rest/v1/catalogs endpoint."
43+
}
44+
```
45+
3246

3347
### Next steps
3448

content/swagger/parameters.yaml

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,18 +121,35 @@ with_quality_scores__product_models:
121121
description: Return product model quality scores in the response. <strong>(Only available on SaaS platforms)</strong>
122122
type: boolean
123123
required: false
124-
x-from-version: "SaaS"
124+
x-from-version: "6.0"
125125
with_completenesses:
126126
name: with_completenesses
127127
in: query
128128
description: Return product completenesses in the response. (Only available on SaaS platforms)
129129
default: false
130130
type: boolean
131131
required: false
132-
x-from-version: "SaaS"
132+
x-from-version: "6.0"
133133
with_position:
134134
name: with_position
135135
in: query
136136
description: Return information about category position into its category tree (only available on SaaS platforms)
137137
required: false
138138
type: boolean
139+
x-from-version: "SaaS"
140+
updated_before:
141+
name: updated_before
142+
in: query
143+
description: Filter products that have been updated BEFORE the provided date (Only available on Catalogs endpoints)
144+
type: string
145+
format: date
146+
required: false
147+
x-from-version: "SaaS"
148+
updated_after:
149+
name: updated_after
150+
in: query
151+
description: Filter products that have been updated AFTER the provided date (Only available on Catalogs endpoints)
152+
type: string
153+
format: date
154+
required: false
155+
x-from-version: "SaaS"

content/swagger/paths.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,10 @@
167167
$ref: ./resources/app_catalogs/routes/app_catalogs_id.yaml
168168
/api/rest/v1/catalogs/{id}/product-uuids:
169169
$ref: ./resources/app_catalogs/routes/app_catalogs_id_product_uuids.yaml
170+
/api/rest/v1/catalogs/{id}/products:
171+
$ref: ./resources/app_catalogs/routes/app_catalogs_id_products.yaml
172+
/api/rest/v1/catalogs/{id}/products/{uuid}:
173+
$ref: ./resources/app_catalogs/routes/app_catalogs_id_products_uuid.yaml
170174

171175
/api/rest/v1:
172176
$ref: ./resources/list_endpoints.yaml

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: 30 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ get:
1010
parameters:
1111
- name: id
1212
in: path
13-
description: Id of the catalog
13+
description: Catalog ID
1414
required: true
1515
type: string
1616
format: uuid
@@ -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"
@@ -37,7 +37,7 @@ patch:
3737
parameters:
3838
- name: id
3939
in: path
40-
description: Id of the catalog
40+
description: Catalog ID
4141
required: true
4242
type: string
4343
format: uuid
@@ -53,26 +53,45 @@ 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
7190
description: This endpoint allows you to delete a catalog.
7291
parameters:
7392
- name: id
7493
in: path
75-
description: Id of the catalog
94+
description: Catalog ID
7695
required: true
7796
type: string
7897
format: uuid
@@ -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: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
get:
22
summary: Get the list of product uuids
33
operationId: "get_app_catalog_product_uuids"
4-
description: Coming soon. This endpoint allows you to get the list of uuids of products contained in a catalog.
4+
description: This endpoint allows you to get the list of uuids of products contained in a catalog. Please, note that a disabled catalog can return an HTTP 200 with a payload containing an error message,
5+
for more details see the <a href="apps/catalogs.html#troubleshooting">App Catalog</a> section.
56
tags:
67
- Catalog products
78
x-versions:
@@ -23,6 +24,8 @@ get:
2324
minimum: 1
2425
maximum: 1000
2526
default: 100
27+
- $ref: '#/parameters/updated_before'
28+
- $ref: '#/parameters/updated_after'
2629
responses:
2730
200:
2831
description: Return the paginated product uuids
@@ -63,6 +66,6 @@ get:
6366
401:
6467
$ref: "#/responses/401Error"
6568
403:
66-
$ref: "#/responses/403Error"
69+
$ref: "#/responses/403CatalogError"
6770
404:
68-
$ref: "#/responses/404Error"
71+
$ref: "#/responses/404CatalogError"

0 commit comments

Comments
 (0)