Skip to content

Commit

Permalink
fix(specs): wrong body parameter name (#896)
Browse files Browse the repository at this point in the history
  • Loading branch information
shortcuts authored Aug 4, 2022
1 parent 07c302b commit 005f9ed
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 32 deletions.
13 changes: 6 additions & 7 deletions specs/search/paths/objects/partialUpdate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ post:
- Records
operationId: partialUpdateObject
summary: Partially update an object.
x-codegen-request-body-name: attributesToUpdate
description: >
Update one or more attributes of an existing object.
Expand All @@ -22,16 +23,14 @@ post:
default: true
requestBody:
required: true
description: List of attributes to update.
description: Map of attribute(s) to update.
content:
application/json:
schema:
type: array
items:
type: object
description: Attribute to update.
additionalProperties:
$ref: 'common/schemas.yml#/attributeToUpdate'
type: object
description: Attribute(s) to update.
additionalProperties:
$ref: 'common/schemas.yml#/attributeToUpdate'
responses:
'200':
$ref: '../../../common/responses/UpdatedAtWithObjectId.yml'
Expand Down
6 changes: 0 additions & 6 deletions specs/search/paths/rules/common/schemas.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,3 @@
rules:
type: array
description: Rules to add.
items:
$ref: '#/rule'

rule:
type: object
description: Rule object.
Expand Down
6 changes: 5 additions & 1 deletion specs/search/paths/rules/saveRules.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ post:
operationId: saveRules
summary: Save a batch of rules.
description: Create/update multiple rules objects at once.
x-codegen-request-body-name: rules
parameters:
- $ref: '../../../common/parameters.yml#/IndexName'
- $ref: '../../../common/parameters.yml#/ForwardToReplicas'
Expand All @@ -13,7 +14,10 @@ post:
content:
application/json:
schema:
$ref: 'common/schemas.yml#/rules'
type: array
description: Rules to add.
items:
$ref: 'common/schemas.yml#/rule'
responses:
'200':
$ref: '../../../common/responses/UpdatedAt.yml'
Expand Down
28 changes: 12 additions & 16 deletions tests/CTS/methods/requests/search/partialUpdateObject.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,29 +3,25 @@
"parameters": {
"indexName": "theIndexName",
"objectID": "uniqueID",
"attributeToUpdate": [
{
"id1": "test",
"id2": {
"_operation": "AddUnique",
"value": "test2"
}
"attributesToUpdate": {
"id1": "test",
"id2": {
"_operation": "AddUnique",
"value": "test2"
}
],
},
"createIfNotExists": true
},
"request": {
"path": "/1/indexes/theIndexName/uniqueID/partial",
"method": "POST",
"body": [
{
"id1": "test",
"id2": {
"_operation": "AddUnique",
"value": "test2"
}
"body": {
"id1": "test",
"id2": {
"_operation": "AddUnique",
"value": "test2"
}
],
},
"queryParameters": {
"createIfNotExists": "true"
}
Expand Down
4 changes: 2 additions & 2 deletions tests/CTS/methods/requests/search/saveRules.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"testName": "saveRules with minimal parameters",
"parameters": {
"indexName": "indexName",
"rule": [
"rules": [
{
"objectID": "a-rule-id",
"conditions": [
Expand Down Expand Up @@ -53,7 +53,7 @@
"testName": "saveRules with all parameters",
"parameters": {
"indexName": "indexName",
"rule": [
"rules": [
{
"objectID": "id1",
"conditions": [
Expand Down

0 comments on commit 005f9ed

Please sign in to comment.