Skip to content

Commit 61343d5

Browse files
authored
fix(specs): correct type for typoTolerance (#722)
1 parent 9d40ed9 commit 61343d5

File tree

3 files changed

+53
-7
lines changed

3 files changed

+53
-7
lines changed

specs/common/schemas/IndexSettings.yml

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -288,12 +288,6 @@ userData:
288288
description: Lets you store custom data in your indices.
289289
default: {}
290290

291-
typoTolerance:
292-
type: string
293-
enum: [true, false, min, strict]
294-
description: Controls whether typo tolerance is enabled and how it is applied.
295-
default: true
296-
297291
queryType:
298292
type: string
299293
enum: [prefixLast, prefixAll, prefixNone]
@@ -320,6 +314,17 @@ advancedSyntaxFeatures:
320314
type: string
321315
enum: [exactPhrase, excludeWords]
322316

317+
typoTolerance:
318+
description: Controls whether typo tolerance is enabled and how it is applied.
319+
oneOf:
320+
- type: boolean
321+
default: true
322+
- $ref: '#/typoToleranceEnum'
323+
324+
typoToleranceEnum:
325+
type: string
326+
enum: [min, strict]
327+
323328
ignorePlurals:
324329
description: >
325330
Treats singular, plurals, and other forms of declensions as matching terms.

templates/javascript/tests/requests/requests.mustache

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ const client = {{client}}(appId, apiKey, {{#hasRegionalHost}}'{{{defaultRegion}}
1111
{{#blocksRequests}}
1212
describe('{{operationId}}', () => {
1313
{{#tests}}
14-
test('{{testName}}', async () => {
14+
test('{{{testName}}}', async () => {
1515
{{#hasRequestOptions}}const requestOptions: RequestOptions = {
1616
{{#requestOptions.queryParameters.parameters}}queryParameters: {{{.}}},{{/requestOptions.queryParameters.parameters}}
1717
{{#requestOptions.headers.parameters}}headers: {{{.}}}{{/requestOptions.headers.parameters}}

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

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
[
22
{
3+
"testName": "setSettings with minimal parameters",
34
"parameters": {
45
"indexName": "theIndexName",
56
"indexSettings": {
@@ -17,5 +18,45 @@
1718
"forwardToReplicas": "true"
1819
}
1920
}
21+
},
22+
{
23+
"testName": "setSettings allow boolean `typoTolerance`",
24+
"parameters": {
25+
"indexName": "theIndexName",
26+
"indexSettings": {
27+
"typoTolerance": true
28+
},
29+
"forwardToReplicas": true
30+
},
31+
"request": {
32+
"path": "/1/indexes/theIndexName/settings",
33+
"method": "PUT",
34+
"body": {
35+
"typoTolerance": true
36+
},
37+
"queryParameters": {
38+
"forwardToReplicas": "true"
39+
}
40+
}
41+
},
42+
{
43+
"testName": "setSettings allow enum `typoTolerance`",
44+
"parameters": {
45+
"indexName": "theIndexName",
46+
"indexSettings": {
47+
"typoTolerance": "min"
48+
},
49+
"forwardToReplicas": true
50+
},
51+
"request": {
52+
"path": "/1/indexes/theIndexName/settings",
53+
"method": "PUT",
54+
"body": {
55+
"typoTolerance": "min"
56+
},
57+
"queryParameters": {
58+
"forwardToReplicas": "true"
59+
}
60+
}
2061
}
2162
]

0 commit comments

Comments
 (0)