Skip to content

Commit be9f747

Browse files
committed
fix(specs): rules and objects parameters
1 parent 2a43aba commit be9f747

File tree

10 files changed

+71
-15
lines changed

10 files changed

+71
-15
lines changed

specs/common/schemas/IndexSettings.yml

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -321,13 +321,7 @@ indexSettingsAsSearchParams:
321321
x-categories:
322322
- Query strategy
323323
distinct:
324-
type: integer
325-
minimum: 0
326-
maximum: 4
327-
description: Enables de-duplication or grouping of results.
328-
default: 0
329-
x-categories:
330-
- Advanced
324+
$ref: '#/distinct'
331325
synonyms:
332326
type: boolean
333327
description: Whether to take into account an index's synonyms for a particular search.
@@ -425,6 +419,17 @@ advancedSyntaxFeatures:
425419
x-categories:
426420
- Query strategy
427421

422+
distinct:
423+
description: Enables de-duplication or grouping of results.
424+
oneOf:
425+
- type: boolean
426+
- type: integer
427+
minimum: 0
428+
maximum: 4
429+
default: 0
430+
x-categories:
431+
- Advanced
432+
428433
typoTolerance:
429434
description: Controls whether typo tolerance is enabled and how it is applied.
430435
oneOf:

specs/search/common/schemas/listIndicesResponse.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ listIndicesResponse:
1111
type: integer
1212
description: Number of pages.
1313
example: 100
14+
required:
15+
- items
1416

1517
fetchedIndex:
1618
type: object

specs/search/paths/objects/batch.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ post:
1919
requests:
2020
type: array
2121
items:
22-
title: batchOperation
22+
title: batchRequest
2323
type: object
2424
additionalProperties: false
2525
properties:

specs/search/paths/objects/multipleGetObjects.yml renamed to specs/search/paths/objects/getObjects.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ post:
2121
type: array
2222
items:
2323
description: getObjects operation on an index.
24-
title: multipleGetObjectsParams
24+
title: getObjectsRequest
2525
type: object
2626
additionalProperties: false
2727
required:
@@ -55,6 +55,9 @@ post:
5555
items:
5656
type: object
5757
description: Fetched object.
58+
x-is-generic: true
59+
required:
60+
- results
5861
'400':
5962
$ref: '../../../common/responses/BadRequest.yml'
6063
'402':

specs/search/paths/objects/multipleBatch.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ post:
1717
requests:
1818
type: array
1919
items:
20-
title: multipleBatchOperation
20+
title: multipleBatchRequest
2121
type: object
2222
additionalProperties: false
2323
properties:

specs/search/paths/objects/objects.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,9 @@ post:
2929
$ref: '../../../common/responses/common.yml#/taskID'
3030
objectID:
3131
$ref: '../../../common/parameters.yml#/objectID'
32+
required:
33+
- taskID
34+
- createdAt
3235
'400':
3336
$ref: '../../../common/responses/BadRequest.yml'
3437
'402':

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

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

specs/search/paths/rules/saveRules.yml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,7 @@ post:
1313
content:
1414
application/json:
1515
schema:
16-
type: array
17-
description: Rules to add.
18-
items:
19-
$ref: 'common/schemas.yml#/rule'
16+
$ref: 'common/schemas.yml#/rules'
2017
responses:
2118
'200':
2219
$ref: '../../../common/responses/UpdatedAt.yml'

specs/search/spec.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ paths:
115115
/1/indexes/*/batch:
116116
$ref: 'paths/objects/multipleBatch.yml'
117117
/1/indexes/*/objects:
118-
$ref: 'paths/objects/multipleGetObjects.yml'
118+
$ref: 'paths/objects/getObjects.yml'
119119

120120
# ##########################
121121
# ### Settings Endpoints ###

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

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,46 @@
147147
}
148148
}
149149
},
150+
{
151+
"testName": "setSettings allow boolean `distinct`",
152+
"parameters": {
153+
"indexName": "theIndexName",
154+
"indexSettings": {
155+
"distinct": true
156+
},
157+
"forwardToReplicas": true
158+
},
159+
"request": {
160+
"path": "/1/indexes/theIndexName/settings",
161+
"method": "PUT",
162+
"body": {
163+
"distinct": true
164+
},
165+
"queryParameters": {
166+
"forwardToReplicas": "true"
167+
}
168+
}
169+
},
170+
{
171+
"testName": "setSettings allow integers for `distinct`",
172+
"parameters": {
173+
"indexName": "theIndexName",
174+
"indexSettings": {
175+
"distinct": 1
176+
},
177+
"forwardToReplicas": true
178+
},
179+
"request": {
180+
"path": "/1/indexes/theIndexName/settings",
181+
"method": "PUT",
182+
"body": {
183+
"distinct": 1
184+
},
185+
"queryParameters": {
186+
"forwardToReplicas": "true"
187+
}
188+
}
189+
},
150190
{
151191
"testName": "setSettings allow all `indexSettings`",
152192
"parameters": {

0 commit comments

Comments
 (0)