Skip to content

Commit 8cf5fbc

Browse files
committed
API-401: add documentation on the update of a list of family variants
1 parent 3398be1 commit 8cf5fbc

File tree

2 files changed

+46
-2
lines changed

2 files changed

+46
-2
lines changed

content/swagger/resources/families/routes/families.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ patch:
138138
x-example-1:
139139
'{"code":"tshirt","attributes":["description","size"]}'
140140
x-example-2:
141-
'{"code":"cap","attribute_as_label":"descripion"}'
141+
'{"code":"cap","attribute_as_label":"description"}'
142142
x-example-3:
143143
'{"code":"mug","attributes":["description","short_description"]}'
144144
responses:
@@ -152,7 +152,7 @@ patch:
152152
x-example-1:
153153
'{"line":1,"code":"tshirt","status_code":201}'
154154
x-example-2:
155-
'{"line":2,"code":"cap","status_code":422,"message":"Attribute "descripion" does not exist."}'
155+
'{"line":2,"code":"cap","status_code":422,"message":"Attribute "description" does not exist."}'
156156
x-example-3:
157157
'{"line":3,"code":"mug","status_code":204}'
158158
401:

content/swagger/resources/families/routes/families_code_variants.yaml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,3 +79,47 @@ post:
7979
$ref: "#/responses/415Error"
8080
422:
8181
$ref: "#/responses/422Error"
82+
patch:
83+
summary: Update/create several family variants
84+
operationId: "patch_families__family_code__variants"
85+
tags:
86+
- Families
87+
x-versions:
88+
- 2.0
89+
description: This endpoint allows you to update and/or create several family variants at once, for a given family.
90+
x-body-by-line: Contains several lines, each line is a family in JSON standard format
91+
parameters:
92+
- $ref: '#/parameters/family_code'
93+
- name: body
94+
in: body
95+
schema:
96+
$ref: "#/definitions/FamilyVariant"
97+
x-examples:
98+
x-example-1:
99+
'{"code": "shoes_by_size", "variant_attribute_sets": [{"level": 1, "axes": ["size"], "attributes": ["color"]}]}'
100+
x-example-2:
101+
'{"code": "shoes_by_color","labels": {"en_US": "Shoes by color"}}'
102+
x-example-3:
103+
'{"code": "shoes_without_axes", "variant_attribute_sets": [{"level": 1, "axes": [], "attributes": ["color"]}]}'
104+
responses:
105+
200:
106+
description: OK
107+
x-details: Returns a plain text response whose lines are JSON containing the status of each update or creation
108+
x-no-entity: true
109+
schema:
110+
$ref: "#/definitions/ErrorByLine"
111+
examples:
112+
x-example-1:
113+
'{"line":1,"code":"shoes_by_size","status_code":201}'
114+
x-example-2:
115+
'{"line":2,"code":"shoes_by_color","status_code":204}'
116+
x-example-3:
117+
'{"line":3,"code":"mug","status_code":422, "message":"There should be at least one attribute defined as axis for the attribute set for level "1""}'
118+
401:
119+
$ref: "#/responses/401Error"
120+
403:
121+
$ref: "#/responses/403Error"
122+
413:
123+
$ref: "#/responses/413Error"
124+
415:
125+
$ref: "#/responses/415ErrorStream"

0 commit comments

Comments
 (0)