Skip to content

Commit 91261e1

Browse files
committed
Update search examples
1 parent 5e8daec commit 91261e1

File tree

3 files changed

+13
-27
lines changed

3 files changed

+13
-27
lines changed

infrastructure/swagger/05_paths.yaml

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ paths:
171171
- $ref: "#/components/parameters/ProductTeamId"
172172
responses:
173173
"400":
174-
$ref: "#/components/responses/BadRequest"
174+
$ref: "#/components/responses/CreateProductBadRequest"
175175
"200":
176176
description: "200 response"
177177
headers:
@@ -243,7 +243,7 @@ paths:
243243
- Options
244244
responses:
245245
"400":
246-
$ref: "#/components/responses/BadRequest"
246+
$ref: "#/components/responses/SearchProductBadRequest"
247247
"200":
248248
description: "200 response"
249249
headers:
@@ -307,8 +307,6 @@ paths:
307307
tags:
308308
- Options
309309
responses:
310-
"400":
311-
$ref: "#/components/responses/BadRequest"
312310
"200":
313311
description: "200 response"
314312
headers:
@@ -374,8 +372,6 @@ paths:
374372
tags:
375373
- Options
376374
responses:
377-
"400":
378-
$ref: "#/components/responses/BadRequest"
379375
"200":
380376
description: "200 response"
381377
headers:

infrastructure/swagger/07_components--schemas--domain.yaml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,10 +153,12 @@ components:
153153
properties:
154154
id:
155155
type: string
156-
name:
156+
cpm_product_team_id:
157157
type: string
158158
product_team_id:
159159
type: string
160+
name:
161+
type: string
160162
ods_code:
161163
type: string
162164
status:
@@ -186,6 +188,7 @@ components:
186188
cpm_product_team_id: "a9a9694d-001b-45ce-9f2a-6c9bf80ae0d0"
187189
products:
188190
- id: "P.1X3-XYZ"
191+
cpm_product_team_id: "a9a9694d-001b-45ce-9f2a-6c9bf80ae0d0"
189192
product_team_id: "55e86121-3826-468c-a6f0-dd0f1fbc0259"
190193
name: "My Great Product 1"
191194
ods_code: "F5H1R"
@@ -198,6 +201,7 @@ components:
198201
cpm_product_team_id: "152705aa-0342-487f-a654-64bba814a847"
199202
products:
200203
- id: "P.4Y6-ABC"
204+
cpm_product_team_id: "152705aa-0342-487f-a654-64bba814a847"
201205
product_team_id: "24ac1857-f718-4905-813f-52da930c3ea1"
202206
name: "My Great Product 3"
203207
ods_code: "F5H1R"

infrastructure/swagger/12_components--responses.yaml

Lines changed: 6 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -67,37 +67,23 @@ components:
6767
errors:
6868
- code: "CONFLICT"
6969
message: "Product Team cannot be deleted as it still has associated Product Ids ['P.1X3-XYZ', 'P.4Y6-ABC']"
70-
BadRequest:
71-
description: Bad request (multiple error types)
72-
content:
73-
application/json:
74-
schema:
75-
$ref: "#/components/schemas/ErrorResponse"
76-
examples:
77-
MissingValue:
78-
value:
79-
errors:
80-
- code: "MISSING_VALUE"
81-
message: "<MISSING_FIELD>: field required"
82-
- code: "MISSING_VALUE"
83-
message: "Failed to validate data against '<QUESTIONNAIRE>': '<MISSING_FIELD>' is a required property"
84-
ValidationError:
85-
value:
86-
errors:
87-
- code: "VALIDATION_ERROR"
88-
message: "Item already exists"
8970
SearchProductBadRequest:
9071
description: searchProduct Bad request
9172
content:
9273
application/json:
9374
schema:
9475
$ref: "#/components/schemas/ErrorResponse"
9576
examples:
96-
ValidationError:
77+
MissingParamValidationError:
9778
value:
9879
errors:
9980
- code: "VALIDATION_ERROR"
10081
message: "SearchProductQueryParams.__root__: Please provide exactly one valid query parameter: {'product_team_id', 'organisation_code'}."
82+
UnknownParamValidationError:
83+
value:
84+
errors:
85+
- code: "VALIDATION_ERROR"
86+
message: "SearchProductQueryParams.foo: extra fields not permitted"
10187
CreateProductTeamBadRequest:
10288
description: createProductTeam Bad request
10389
content:

0 commit comments

Comments
 (0)