Skip to content

Commit 3675c06

Browse files
authored
Merge pull request #133 from akeneo/split-swagger
Split swagger file in multiple files
2 parents 6698af4 + b876f71 commit 3675c06

File tree

58 files changed

+4864
-4801
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

58 files changed

+4864
-4801
lines changed

content/akeneo-web-api.yaml

Lines changed: 0 additions & 4797 deletions
This file was deleted.

content/swagger/akeneo-web-api.yaml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
swagger: '2.0'
2+
info:
3+
title: Akeneo PIM API
4+
version: "1.0.0"
5+
# the domain of the service
6+
host: demo.akeneo.com
7+
# array of all schemes that your API supports
8+
schemes:
9+
- http
10+
produces:
11+
- application/json
12+
paths:
13+
$ref: ./paths.yaml
14+
definitions:
15+
$ref: ./definitions.yaml
16+
responses:
17+
$ref: ./responses.yaml
18+
parameters:
19+
$ref: ./parameters.yaml

content/swagger/definitions.yaml

Lines changed: 210 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,210 @@
1+
Product:
2+
$ref: ./resources/products/definitions/product.yaml
3+
ProductList:
4+
type: object
5+
allOf:
6+
- $ref: '#/definitions/ItemList'
7+
- $ref: '#/definitions/Product'
8+
9+
ProductModel:
10+
$ref: ./resources/product_models/definitions/product_model.yaml
11+
ProductModelList:
12+
type: object
13+
allOf:
14+
- $ref: '#/definitions/ItemList'
15+
- $ref: '#/definitions/ProductModel'
16+
17+
PublishedProduct:
18+
$ref: ./resources/published_products/definitions/published_product.yaml
19+
PublishedProductList:
20+
type: object
21+
allOf:
22+
- $ref: '#/definitions/ItemList'
23+
- $ref: '#/definitions/PublishedProduct'
24+
25+
Category:
26+
$ref: ./resources/categories/definitions/category.yaml
27+
CategoryList:
28+
type: object
29+
allOf:
30+
- $ref: '#/definitions/ItemList'
31+
- $ref: '#/definitions/Category'
32+
33+
MeasureFamily:
34+
$ref: ./resources/measure_families/definitions/measure_family.yaml
35+
MeasureFamilyList:
36+
type: object
37+
allOf:
38+
- $ref: '#/definitions/ItemList'
39+
- $ref: '#/definitions/MeasureFamily'
40+
41+
Family:
42+
$ref: ./resources/families/definitions/family.yaml
43+
FamilyList:
44+
type: object
45+
allOf:
46+
- $ref: '#/definitions/ItemList'
47+
- $ref: '#/definitions/Family'
48+
49+
FamilyVariant:
50+
$ref: ./resources/families/definitions/family_variant.yaml
51+
FamilyVariantList:
52+
type: object
53+
allOf:
54+
- $ref: '#/definitions/ItemList'
55+
- $ref: '#/definitions/FamilyVariant'
56+
57+
Attribute:
58+
$ref: ./resources/attributes/definitions/attribute.yaml
59+
AttributeList:
60+
type: object
61+
allOf:
62+
- $ref: '#/definitions/ItemList'
63+
- $ref: '#/definitions/Attribute'
64+
65+
AttributeOption:
66+
$ref: ./resources/attributes/definitions/attribute_option.yaml
67+
AttributeOptionList:
68+
type: object
69+
allOf:
70+
- $ref: '#/definitions/ItemList'
71+
- $ref: '#/definitions/AttributeOption'
72+
73+
AttributeGroup:
74+
$ref: ./resources/attribute_groups/definitions/attribute_group.yaml
75+
AttributeGroupList:
76+
type: object
77+
allOf:
78+
- $ref: '#/definitions/ItemList'
79+
- $ref: '#/definitions/AttributeGroup'
80+
81+
MediaFile:
82+
$ref: ./resources/media_files/definitions/media_file.yaml
83+
MediaFileList:
84+
type: object
85+
allOf:
86+
- $ref: '#/definitions/MediaFileItemList'
87+
- $ref: '#/definitions/MediaFile'
88+
89+
Locale:
90+
$ref: ./resources/locales/definitions/locale.yaml
91+
LocaleList:
92+
type: object
93+
allOf:
94+
- $ref: '#/definitions/ItemList'
95+
- $ref: '#/definitions/Locale'
96+
97+
Channel:
98+
$ref: ./resources/channels/definitions/channel.yaml
99+
ChannelList:
100+
type: object
101+
allOf:
102+
- $ref: '#/definitions/ItemList'
103+
- $ref: '#/definitions/Channel'
104+
105+
AssociationType:
106+
$ref: ./resources/association_types/definitions/association_type.yaml
107+
AssociationTypeList:
108+
type: object
109+
allOf:
110+
- $ref: '#/definitions/ItemList'
111+
- $ref: '#/definitions/AssociationType'
112+
113+
Currency:
114+
$ref: ./resources/currencies/definitions/currency.yaml
115+
CurrencyList:
116+
type: object
117+
allOf:
118+
- $ref: '#/definitions/ItemList'
119+
- $ref: '#/definitions/Currency'
120+
121+
Error:
122+
type: object
123+
properties:
124+
code:
125+
type: integer
126+
description: HTTP status code
127+
message:
128+
type: string
129+
description: Message explaining the error
130+
ErrorByLine:
131+
type: object
132+
properties:
133+
line:
134+
type: integer
135+
description: Line number
136+
identifier:
137+
type: string
138+
description: Resource identifier, only filled when the resource is a product
139+
code:
140+
type: string
141+
description: Resource code, only filled when the resource is a category, a family or an attribute
142+
status_code:
143+
type: integer
144+
description: HTTP status code, see <a href="/documentation/responses.html#client-errors">Client errors</a> to understand the meaning of each code
145+
message:
146+
type: string
147+
description: Message explaining the error
148+
Pagination:
149+
type: object
150+
properties:
151+
_links:
152+
type: object
153+
properties:
154+
self:
155+
type: object
156+
properties:
157+
href:
158+
type: string
159+
description: URI of the current page of resources
160+
first:
161+
type: object
162+
properties:
163+
href:
164+
type: string
165+
description: URI of the first page of resources
166+
previous:
167+
type: object
168+
properties:
169+
href:
170+
type: string
171+
description: URI of the previous page of resources
172+
next:
173+
type: object
174+
properties:
175+
href:
176+
type: string
177+
description: URI of the next page of resources
178+
current_page:
179+
type: integer
180+
description: Current page number
181+
ItemList:
182+
type: object
183+
properties:
184+
_links:
185+
type: object
186+
properties:
187+
self:
188+
type: object
189+
properties:
190+
href:
191+
type: string
192+
description: URI of the resource
193+
MediaFileItemList:
194+
type: object
195+
properties:
196+
_links:
197+
type: object
198+
properties:
199+
self:
200+
type: object
201+
properties:
202+
href:
203+
type: string
204+
description: URI to get the metadata of the media file
205+
download:
206+
type: object
207+
properties:
208+
href:
209+
type: string
210+
description: URI to download the binaries of the media file

content/swagger/parameters.yaml

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
pagination_type:
2+
name: pagination_type
3+
in: query
4+
description: Pagination method type, see <a href="/documentation/pagination.html">Pagination</a> section
5+
required: false
6+
type: string
7+
default: "page"
8+
x-validation-rules: One of the following values
9+
enum: ["page", "search_after"]
10+
page:
11+
name: page
12+
in: query
13+
description: Number of the page to retrieve when using the `page` pagination method type. <strong>Should never be set manually</strong>, see <a href="/documentation/pagination.html#pagination">Pagination</a> section
14+
required: false
15+
type: integer
16+
default: 1
17+
search_after:
18+
name: search_after
19+
in: query
20+
description: Cursor when using the `search_after` pagination method type. <strong>Should never be set manually</strong>, see <a href="/documentation/pagination.html">Pagination</a> section
21+
required: false
22+
type: string
23+
default: "cursor to the first page"
24+
limit:
25+
name: limit
26+
in: query
27+
description: Number of results by page, see <a href="/documentation/pagination.html">Pagination</a> section
28+
required: false
29+
type: integer
30+
minimum: 1
31+
maximum: 100
32+
default: 10
33+
code:
34+
name: code
35+
in: path
36+
description: Code of the resource
37+
required: true
38+
type: string
39+
attribute_code:
40+
name: attribute_code
41+
in: path
42+
description: Code of the attribute
43+
required: true
44+
type: string
45+
family_code:
46+
name: family_code
47+
in: path
48+
description: Code of the family
49+
required: true
50+
type: string
51+
with_count:
52+
name: with_count
53+
in: query
54+
description: Return the count of products in the response. Be carefull with that, on a big catalog, it can decrease performance in a significative way
55+
default: false
56+
type: boolean
57+
required: false

content/swagger/paths.yaml

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
/api/rest/v1:
2+
$ref: ./resources/list_endpoints.yaml
3+
4+
/api/oauth/v1/token:
5+
$ref: ./resources/token.yaml
6+
7+
/api/rest/v1/products:
8+
$ref: ./resources/products/routes/products.yaml
9+
/api/rest/v1/products/{code}:
10+
$ref: ./resources/products/routes/products_code.yaml
11+
/api/rest/v1/products/{code}/proposal:
12+
$ref: ./resources/products/routes/products_code_proposal.yaml
13+
/api/rest/v1/products/{code}/draft:
14+
$ref: ./resources/products/routes/products_code_draft.yaml
15+
16+
/api/rest/v1/product-models:
17+
$ref: ./resources/product_models/routes/product_models.yaml
18+
/api/rest/v1/product-models/{code}:
19+
$ref: ./resources/product_models/routes/product_models_code.yaml
20+
21+
/api/rest/v1/published-products:
22+
$ref: ./resources/published_products/routes/published_products.yaml
23+
/api/rest/v1/published-products/{code}:
24+
$ref: ./resources/published_products/routes/published_products_code.yaml
25+
26+
/api/rest/v1/categories:
27+
$ref: ./resources/categories/routes/categories.yaml
28+
/api/rest/v1/categories/{code}:
29+
$ref: ./resources/categories/routes/categories_code.yaml
30+
31+
/api/rest/v1/families:
32+
$ref: ./resources/families/routes/families.yaml
33+
/api/rest/v1/families/{code}:
34+
$ref: ./resources/families/routes/families_code.yaml
35+
/api/rest/v1/families/{family_code}/variants:
36+
$ref: ./resources/families/routes/families_code_variants.yaml
37+
/api/rest/v1/families/{family_code}/variants/{code}:
38+
$ref: ./resources/families/routes/families_code_variants_code.yaml
39+
40+
/api/rest/v1/attributes:
41+
$ref: ./resources/attributes/routes/attributes.yaml
42+
/api/rest/v1/attributes/{code}:
43+
$ref: ./resources/attributes/routes/attributes_code.yaml
44+
/api/rest/v1/attributes/{attribute_code}/options:
45+
$ref: ./resources/attributes/routes/attributes_code_options.yaml
46+
/api/rest/v1/attributes/{attribute_code}/options/{code}:
47+
$ref: ./resources/attributes/routes/attributes_code_options_code.yaml
48+
49+
/api/rest/v1/attribute-groups:
50+
$ref: ./resources/attribute_groups/routes/attribute_groups.yaml
51+
/api/rest/v1/attribute-groups/{code}:
52+
$ref: ./resources/attribute_groups/routes/attribute_groups_code.yaml
53+
/api/rest/v1/media-files:
54+
$ref: ./resources/media_files/routes/media_files.yaml
55+
/api/rest/v1/media-files/{code}:
56+
$ref: ./resources/media_files/routes/media_files_code.yaml
57+
/api/rest/v1/media-files/{code}/download:
58+
$ref: ./resources/media_files/routes/media_files_code_download.yaml
59+
60+
/api/rest/v1/locales:
61+
$ref: ./resources/locales/routes/locales.yaml
62+
/api/rest/v1/locales/{code}:
63+
$ref: ./resources/locales/routes/locales_code.yaml
64+
65+
/api/rest/v1/channels:
66+
$ref: ./resources/channels/routes/channels.yaml
67+
/api/rest/v1/channels/{code}:
68+
$ref: ./resources/channels/routes/channels_code.yaml
69+
70+
/api/rest/v1/currencies:
71+
$ref: ./resources/currencies/routes/currencies.yaml
72+
/api/rest/v1/currencies/{code}:
73+
$ref: ./resources/currencies/routes/currencies_code.yaml
74+
75+
/api/rest/v1/measure-families:
76+
$ref: ./resources/measure_families/routes/measure_families.yaml
77+
/api/rest/v1/measure-families/{code}:
78+
$ref: ./resources/measure_families/routes/measure_families_code.yaml
79+
80+
/api/rest/v1/association-types:
81+
$ref: ./resources/association_types/routes/association_types.yaml
82+
/api/rest/v1/association-types/{code}:
83+
$ref: ./resources/association_types/routes/association_types_code.yaml
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
type: object
2+
required: ["code"]
3+
properties:
4+
code:
5+
type: string
6+
description: Association type code
7+
x-immutable: true
8+
labels:
9+
type: object
10+
description: Association type labels for each locale
11+
x-validation-rules: The `localeCode` is the code of an existing and activated locale
12+
default: {}
13+
properties:
14+
localeCode:
15+
type: string
16+
description: Association type label for the locale `localeCode`
17+
example: {
18+
"code": "upsell",
19+
"labels": {
20+
"en_US": "Upsell",
21+
"fr_FR": "Vente incitative"
22+
}
23+
}

0 commit comments

Comments
 (0)