Skip to content

Commit 828ab74

Browse files
masaccmeganelepalud-akeneo
authored andcommitted
CXP-1206: add App Catalog endpoints in Swagger
1 parent a732f00 commit 828ab74

File tree

10 files changed

+300
-2
lines changed

10 files changed

+300
-2
lines changed

content/swagger/akeneo-web-api.json

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

content/swagger/definitions.yaml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ ProductExamples:
55
ProductList:
66
type: object
77
allOf:
8-
- $ref: '#/definitions/ItemList'
8+
- $ref: '#/definitions/ItemList'
99
- $ref: '#/definitions/Product'
1010

1111
ProductModel:
@@ -235,6 +235,12 @@ AssetItemList:
235235
type: string
236236
description: URI of the resource
237237

238+
AppCatalogList:
239+
type: object
240+
allOf:
241+
- $ref: '#/definitions/ItemList'
242+
- $ref: ./resources/app_catalogs/definitions/app_catalog.yaml
243+
238244
Error:
239245
type: object
240246
properties:

content/swagger/paths.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,13 @@
152152
/api/rest/v1/asset-tags/{code}:
153153
$ref: ./resources/deprecated/asset_tags/routes/asset_tags_code.yaml
154154

155+
/api/rest/v1/catalogs:
156+
$ref: ./resources/app_catalogs/routes/app_catalogs.yaml
157+
/api/rest/v1/catalogs/{id}:
158+
$ref: ./resources/app_catalogs/routes/app_catalogs_id.yaml
159+
/api/rest/v1/catalogs/{id}/product-uuids:
160+
$ref: ./resources/app_catalogs/routes/app_catalogs_id_product_uuids.yaml
161+
155162
/api/rest/v1:
156163
$ref: ./resources/list_endpoints.yaml
157164

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
type: object
2+
properties:
3+
id:
4+
type: string
5+
description: App catalog id
6+
x-immutable: true
7+
name:
8+
type: string
9+
description: App catalog name
10+
enabled:
11+
type: boolean
12+
description: Whether the app catalog is enabled or not
13+
default: false
14+
example: {
15+
"id": "12351d98-200e-4bbc-aa19-7fdda1bd14f2",
16+
"name": "My app catalog",
17+
"enabled": false
18+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
type: object
2+
required: ["name"]
3+
properties:
4+
name:
5+
type: string
6+
description: App catalog name
7+
example: {
8+
"name": "My app catalog"
9+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
type: object
2+
required: ["name"]
3+
properties:
4+
name:
5+
type: string
6+
description: App catalog name
7+
example: {
8+
"name": "My app catalog"
9+
}
Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
get:
2+
summary: Get the list of owned catalogs
3+
operationId: "get_app_catalogs"
4+
description: This endpoint allows you to get the list of catalogs you owned.
5+
tags:
6+
- App catalog
7+
x-versions:
8+
- "SaaS"
9+
parameters:
10+
- $ref: '#/parameters/page'
11+
- name: limit
12+
in: query
13+
description: Number of results by page, see <a href="/documentation/pagination.html">Pagination</a> section
14+
required: false
15+
type: integer
16+
minimum: 1
17+
maximum: 100
18+
default: 100
19+
responses:
20+
200:
21+
description: Return the paginated catalogs owned by the user making the request
22+
schema:
23+
title: Catalogs
24+
type: object
25+
allOf:
26+
- $ref: '#/definitions/Pagination'
27+
- properties:
28+
_embedded:
29+
type: object
30+
properties:
31+
items:
32+
type: array
33+
items:
34+
$ref: '#/definitions/AppCatalogList'
35+
x-examples: {
36+
_links: {
37+
self: {
38+
href: "https://demo.akeneo.com/api/rest/v1/catalogs?page=3&limit=2"
39+
},
40+
first: {
41+
href: "https://demo.akeneo.com/api/rest/v1/catalogs?page=1&limit=2"
42+
},
43+
previous: {
44+
href: "https://demo.akeneo.com/api/rest/v1/catalogs?page=2&limit=2"
45+
},
46+
next: {
47+
href: "https://demo.akeneo.com/api/rest/v1/catalogs?page=4&limit=2"
48+
}
49+
},
50+
current_page: 3,
51+
_embedded: {
52+
items: [
53+
{
54+
"id": "12351d98-200e-4bbc-aa19-7fdda1bd14f2",
55+
"name": "Store FR",
56+
"enabled": false
57+
},{
58+
"id": "092c5f22-ecd8-485f-97e9-3b78098e1386",
59+
"name": "Store US",
60+
"enabled": true
61+
}
62+
]
63+
}
64+
}
65+
401:
66+
$ref: "#/responses/401Error"
67+
403:
68+
$ref: "#/responses/403Error"
69+
post:
70+
summary: Create a new catalog
71+
operationId: "post_app_catalog"
72+
tags:
73+
- App catalog
74+
x-versions:
75+
- "SaaS"
76+
description: This endpoint allows you to create a new catalog.
77+
parameters:
78+
- name: body
79+
in: body
80+
schema:
81+
$ref: ../definitions/app_catalog_creation.yaml
82+
responses:
83+
201:
84+
description: Created
85+
x-details: Means that the creation was successful
86+
schema:
87+
$ref: ../definitions/app_catalog.yaml
88+
401:
89+
$ref: "#/responses/401Error"
90+
403:
91+
$ref: "#/responses/403Error"
92+
415:
93+
$ref: "#/responses/415Error"
94+
422:
95+
$ref: "#/responses/422Error"
Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
get:
2+
summary: Get a catalog
3+
operationId: "get_app_catalog"
4+
description: This endpoint allows you to get the information about a catalog.
5+
tags:
6+
- App catalog
7+
x-versions:
8+
- "SaaS"
9+
parameters:
10+
- name: id
11+
in: path
12+
description: Id of the catalog
13+
required: true
14+
type: string
15+
format: uuid
16+
responses:
17+
200:
18+
description: Return the catalog
19+
schema:
20+
$ref: ../definitions/app_catalog.yaml
21+
401:
22+
$ref: "#/responses/401Error"
23+
403:
24+
$ref: "#/responses/403Error"
25+
404:
26+
$ref: "#/responses/404Error"
27+
patch:
28+
summary: Update a catalog
29+
operationId: "patch_app_catalog"
30+
tags:
31+
- App catalog
32+
x-versions:
33+
- "SaaS"
34+
description: This endpoint allows you to update an app catalog.
35+
parameters:
36+
- name: id
37+
in: path
38+
description: Id of the catalog
39+
required: true
40+
type: string
41+
format: uuid
42+
- name: body
43+
in: body
44+
schema:
45+
$ref: ../definitions/app_catalog_update.yaml
46+
responses:
47+
200:
48+
description: Updated
49+
schema:
50+
$ref: ../definitions/app_catalog.yaml
51+
401:
52+
$ref: "#/responses/401Error"
53+
403:
54+
$ref: "#/responses/403Error"
55+
404:
56+
$ref: "#/responses/404Error"
57+
415:
58+
$ref: "#/responses/415Error"
59+
422:
60+
$ref: "#/responses/422Error"
61+
delete:
62+
summary: Delete a catalog
63+
operationId: "delete_app_catalog"
64+
tags:
65+
- App catalog
66+
x-versions:
67+
- "SaaS"
68+
description: This endpoint allows you to delete an app catalog.
69+
parameters:
70+
- name: id
71+
in: path
72+
description: Id of the catalog
73+
required: true
74+
type: string
75+
format: uuid
76+
responses:
77+
204:
78+
description: Deleted
79+
401:
80+
$ref: "#/responses/401Error"
81+
403:
82+
$ref: "#/responses/403Error"
83+
404:
84+
$ref: "#/responses/404Error"
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
get:
2+
summary: Get the list of product uuids
3+
operationId: "get_app_catalog_product_uuids"
4+
description: This endpoint allows you to get the list of uuids of products contained in a catalog.
5+
tags:
6+
- App catalog product
7+
x-versions:
8+
- "SaaS"
9+
parameters:
10+
- name: id
11+
in: path
12+
description: Id of the catalog
13+
required: true
14+
type: string
15+
format: uuid
16+
- $ref: '#/parameters/search_after'
17+
- name: limit
18+
in: query
19+
description: Number of results by page, see <a href="/documentation/pagination.html">Pagination</a> section
20+
required: false
21+
type: integer
22+
minimum: 1
23+
maximum: 1000
24+
default: 100
25+
responses:
26+
200:
27+
description: Return the paginated product uuids
28+
schema:
29+
title: Product uuids
30+
type: object
31+
allOf:
32+
- $ref: '#/definitions/SearchAfterPagination'
33+
- properties:
34+
_embedded:
35+
type: object
36+
properties:
37+
items:
38+
type: array
39+
items:
40+
type: string
41+
format: uuid
42+
x-examples: {
43+
"_links": {
44+
"self": {
45+
"href": "http://demo.akeneo.com/api/rest/v1/catalogs/12351d98-200e-4bbc-aa19-7fdda1bd14f2?pagination_type=search_after&limit=3&search_after=10de33fa-e026-4439-85d6-73a1105f52e7"
46+
},
47+
"first": {
48+
"href": "http://demo.akeneo.com/api/rest/v1/catalogs/12351d98-200e-4bbc-aa19-7fdda1bd14f2?pagination_type=search_after&limit=3"
49+
},
50+
"next": {
51+
"href": "http://demo.akeneo.com/api/rest/v1/catalogs/12351d98-200e-4bbc-aa19-7fdda1bd14f2?pagination_type=search_after&limit=3&search_after=eddfbd2a-abc7-488d-b9e3-41289c824f80"
52+
}
53+
},
54+
"_embedded": {
55+
"items": [
56+
"844c736b-a19b-48a6-a354-6056044729f0",
57+
"b2a683ef-4a91-4ed3-b3fa-76dab065a8d5",
58+
"eddfbd2a-abc7-488d-b9e3-41289c824f80"
59+
]
60+
}
61+
}
62+
401:
63+
$ref: "#/responses/401Error"
64+
403:
65+
$ref: "#/responses/403Error"
66+
404:
67+
$ref: "#/responses/404Error"

tasks/reference.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,9 @@ function determineCategory(tag){
7474
case 'Reference entity attribute':
7575
case 'Reference entity attribute option':
7676
return 'Reference entities';
77+
case 'App catalog':
78+
case 'App catalog product':
79+
return 'App catalogs';
7780
default:
7881
return 'Utilities';
7982
}

0 commit comments

Comments
 (0)