Skip to content

Commit 005f9ed

Browse files
authored
fix(specs): wrong body parameter name (#896)
1 parent 07c302b commit 005f9ed

File tree

5 files changed

+25
-32
lines changed

5 files changed

+25
-32
lines changed

specs/search/paths/objects/partialUpdate.yml

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ post:
33
- Records
44
operationId: partialUpdateObject
55
summary: Partially update an object.
6+
x-codegen-request-body-name: attributesToUpdate
67
description: >
78
Update one or more attributes of an existing object.
89
@@ -22,16 +23,14 @@ post:
2223
default: true
2324
requestBody:
2425
required: true
25-
description: List of attributes to update.
26+
description: Map of attribute(s) to update.
2627
content:
2728
application/json:
2829
schema:
29-
type: array
30-
items:
31-
type: object
32-
description: Attribute to update.
33-
additionalProperties:
34-
$ref: 'common/schemas.yml#/attributeToUpdate'
30+
type: object
31+
description: Attribute(s) to update.
32+
additionalProperties:
33+
$ref: 'common/schemas.yml#/attributeToUpdate'
3534
responses:
3635
'200':
3736
$ref: '../../../common/responses/UpdatedAtWithObjectId.yml'

specs/search/paths/rules/common/schemas.yml

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,3 @@
1-
rules:
2-
type: array
3-
description: Rules to add.
4-
items:
5-
$ref: '#/rule'
6-
71
rule:
82
type: object
93
description: Rule object.

specs/search/paths/rules/saveRules.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ post:
44
operationId: saveRules
55
summary: Save a batch of rules.
66
description: Create/update multiple rules objects at once.
7+
x-codegen-request-body-name: rules
78
parameters:
89
- $ref: '../../../common/parameters.yml#/IndexName'
910
- $ref: '../../../common/parameters.yml#/ForwardToReplicas'
@@ -13,7 +14,10 @@ post:
1314
content:
1415
application/json:
1516
schema:
16-
$ref: 'common/schemas.yml#/rules'
17+
type: array
18+
description: Rules to add.
19+
items:
20+
$ref: 'common/schemas.yml#/rule'
1721
responses:
1822
'200':
1923
$ref: '../../../common/responses/UpdatedAt.yml'

tests/CTS/methods/requests/search/partialUpdateObject.json

Lines changed: 12 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -3,29 +3,25 @@
33
"parameters": {
44
"indexName": "theIndexName",
55
"objectID": "uniqueID",
6-
"attributeToUpdate": [
7-
{
8-
"id1": "test",
9-
"id2": {
10-
"_operation": "AddUnique",
11-
"value": "test2"
12-
}
6+
"attributesToUpdate": {
7+
"id1": "test",
8+
"id2": {
9+
"_operation": "AddUnique",
10+
"value": "test2"
1311
}
14-
],
12+
},
1513
"createIfNotExists": true
1614
},
1715
"request": {
1816
"path": "/1/indexes/theIndexName/uniqueID/partial",
1917
"method": "POST",
20-
"body": [
21-
{
22-
"id1": "test",
23-
"id2": {
24-
"_operation": "AddUnique",
25-
"value": "test2"
26-
}
18+
"body": {
19+
"id1": "test",
20+
"id2": {
21+
"_operation": "AddUnique",
22+
"value": "test2"
2723
}
28-
],
24+
},
2925
"queryParameters": {
3026
"createIfNotExists": "true"
3127
}

tests/CTS/methods/requests/search/saveRules.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"testName": "saveRules with minimal parameters",
44
"parameters": {
55
"indexName": "indexName",
6-
"rule": [
6+
"rules": [
77
{
88
"objectID": "a-rule-id",
99
"conditions": [
@@ -53,7 +53,7 @@
5353
"testName": "saveRules with all parameters",
5454
"parameters": {
5555
"indexName": "indexName",
56-
"rule": [
56+
"rules": [
5757
{
5858
"objectID": "id1",
5959
"conditions": [

0 commit comments

Comments
 (0)