Skip to content

fix(specs): wrong body parameter name #896

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 4, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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