Skip to content

Commit 2624f34

Browse files
committed
fix CTS
1 parent df7a3cf commit 2624f34

File tree

13 files changed

+70
-25
lines changed

13 files changed

+70
-25
lines changed

clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/search/SearchApi.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3537,7 +3537,7 @@ private Call listIndicesCall(Integer page, final ApiCallback _callback)
35373537
Map<String, String> headers = new HashMap<String, String>();
35383538

35393539
if (page != null) {
3540-
queryParams.addAll(this.parameterToPair("Page", page));
3540+
queryParams.addAll(this.parameterToPair("page", page));
35413541
}
35423542

35433543
headers.put("Accept", "application/json");
@@ -3623,7 +3623,7 @@ private Call listUserIdsCall(
36233623
Map<String, String> headers = new HashMap<String, String>();
36243624

36253625
if (page != null) {
3626-
queryParams.addAll(this.parameterToPair("Page", page));
3626+
queryParams.addAll(this.parameterToPair("page", page));
36273627
}
36283628

36293629
if (hitsPerPage != null) {
@@ -5455,7 +5455,7 @@ private Call searchSynonymsCall(
54555455
}
54565456

54575457
if (page != null) {
5458-
queryParams.addAll(this.parameterToPair("Page", page));
5458+
queryParams.addAll(this.parameterToPair("page", page));
54595459
}
54605460

54615461
if (hitsPerPage != null) {

clients/algoliasearch-client-javascript/client-search/src/searchApi.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1490,7 +1490,7 @@ export class SearchApi {
14901490
const queryParameters: Record<string, string> = {};
14911491

14921492
if (page !== undefined) {
1493-
queryParameters.Page = page.toString();
1493+
queryParameters.page = page.toString();
14941494
}
14951495

14961496
const request: Request = {
@@ -1522,7 +1522,7 @@ export class SearchApi {
15221522
const queryParameters: Record<string, string> = {};
15231523

15241524
if (page !== undefined) {
1525-
queryParameters.Page = page.toString();
1525+
queryParameters.page = page.toString();
15261526
}
15271527

15281528
if (hitsPerPage !== undefined) {
@@ -2294,7 +2294,7 @@ export class SearchApi {
22942294
}
22952295

22962296
if (page !== undefined) {
2297-
queryParameters.Page = page.toString();
2297+
queryParameters.page = page.toString();
22982298
}
22992299

23002300
if (hitsPerPage !== undefined) {

specs/common/parameters.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ ForwardToReplicas:
5353

5454
Page:
5555
in: query
56-
name: Page
56+
name: page
5757
description: Requested page (zero-based). When specified, will retrieve a specific page; the page size is implicitly set to 100. When null, will retrieve all indices (no pagination).
5858
schema:
5959
type: integer
@@ -62,7 +62,7 @@ Page:
6262

6363
PageDefault0:
6464
in: query
65-
name: Page
65+
name: page
6666
description: Requested page (zero-based). When specified, will retrieve a specific page; the page size is implicitly set to 100. When null, will retrieve all indices (no pagination).
6767
schema:
6868
type: integer

tests/CTS/clients/search/assignUserId.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
{
33
"method": "assignUserId",
44
"parameters": {
5-
"xAlgoliaUserID": "indexName",
5+
"xAlgoliaUserID": "userID",
66
"assignUserIdObject": {
77
"cluster": "theCluster"
88
}
@@ -12,6 +12,9 @@
1212
"method": "POST",
1313
"data": {
1414
"cluster": "theCluster"
15+
},
16+
"searchParams": {
17+
"X-Algolia-User-ID": "userID"
1518
}
1619
}
1720
}

tests/CTS/clients/search/batchAssignUserIds.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@
2020
"user1",
2121
"user2"
2222
]
23+
},
24+
"searchParams": {
25+
"X-Algolia-User-ID": "userID"
2326
}
2427
}
2528
}

tests/CTS/clients/search/getLogs.json

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,13 @@
99
},
1010
"request": {
1111
"path": "/1/logs",
12-
"method": "GET"
12+
"method": "GET",
13+
"searchParams": {
14+
"offset": "5",
15+
"length": "10",
16+
"indexName": "theIndexName",
17+
"type": "all"
18+
}
1319
}
1420
}
1521
]

tests/CTS/clients/search/getObject.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,10 @@
1111
},
1212
"request": {
1313
"path": "/1/indexes/theIndexName/uniqueID",
14-
"method": "GET"
14+
"method": "GET",
15+
"searchParams": {
16+
"attributesToRetrieve": "attr1,attr2"
17+
}
1518
}
1619
}
1720
]

tests/CTS/clients/search/hasPendingMappings.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,10 @@
66
},
77
"request": {
88
"path": "/1/clusters/mapping/pending",
9-
"method": "GET"
9+
"method": "GET",
10+
"searchParams": {
11+
"getClusters": "true"
12+
}
1013
}
1114
}
1215
]

tests/CTS/clients/search/listIndices.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,10 @@
66
},
77
"request": {
88
"path": "/1/indexes",
9-
"method": "GET"
9+
"method": "GET",
10+
"searchParams": {
11+
"page": "8"
12+
}
1013
}
1114
}
1215
]

tests/CTS/clients/search/listUserIds.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,11 @@
77
},
88
"request": {
99
"path": "/1/clusters/mapping",
10-
"method": "GET"
10+
"method": "GET",
11+
"searchParams": {
12+
"page": "8",
13+
"hitsPerPage": "100"
14+
}
1115
}
1216
}
1317
]

tests/CTS/clients/search/partialUpdateObject.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,10 @@
2626
"value": "test2"
2727
}
2828
}
29-
]
29+
],
30+
"searchParams": {
31+
"createIfNotExists": "true"
32+
}
3033
}
3134
}
3235
]

tests/CTS/clients/search/setSettings.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@
1313
"method": "PUT",
1414
"data": {
1515
"paginationLimitedTo": 10
16+
},
17+
"searchParams": {
18+
"forwardToReplicas": "true"
1619
}
1720
}
1821
}

tests/output/javascript/search.test.ts

Lines changed: 24 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -64,14 +64,16 @@ describe('appendSource', () => {
6464
describe('assignUserId', () => {
6565
test('assignUserId', async () => {
6666
const req = await client.assignUserId({
67-
xAlgoliaUserID: 'indexName',
67+
xAlgoliaUserID: 'userID',
6868
assignUserIdObject: { cluster: 'theCluster' },
6969
});
7070

7171
expect((req as any).path).toEqual('/1/clusters/mapping');
7272
expect((req as any).method).toEqual('POST');
7373
expect((req as any).data).toEqual({ cluster: 'theCluster' });
74-
expect((req as any).searchParams).toEqual(undefined);
74+
expect((req as any).searchParams).toEqual({
75+
'X-Algolia-User-ID': 'userID',
76+
});
7577
});
7678
});
7779

@@ -121,7 +123,9 @@ describe('batchAssignUserIds', () => {
121123
cluster: 'theCluster',
122124
users: ['user1', 'user2'],
123125
});
124-
expect((req as any).searchParams).toEqual(undefined);
126+
expect((req as any).searchParams).toEqual({
127+
'X-Algolia-User-ID': 'userID',
128+
});
125129
});
126130
});
127131

@@ -450,7 +454,12 @@ describe('getLogs', () => {
450454
expect((req as any).path).toEqual('/1/logs');
451455
expect((req as any).method).toEqual('GET');
452456
expect((req as any).data).toEqual(undefined);
453-
expect((req as any).searchParams).toEqual(undefined);
457+
expect((req as any).searchParams).toEqual({
458+
offset: '5',
459+
length: '10',
460+
indexName: 'theIndexName',
461+
type: 'all',
462+
});
454463
});
455464
});
456465

@@ -465,7 +474,9 @@ describe('getObject', () => {
465474
expect((req as any).path).toEqual('/1/indexes/theIndexName/uniqueID');
466475
expect((req as any).method).toEqual('GET');
467476
expect((req as any).data).toEqual(undefined);
468-
expect((req as any).searchParams).toEqual(undefined);
477+
expect((req as any).searchParams).toEqual({
478+
attributesToRetrieve: 'attr1,attr2',
479+
});
469480
});
470481
});
471482

@@ -591,7 +602,7 @@ describe('hasPendingMappings', () => {
591602
expect((req as any).path).toEqual('/1/clusters/mapping/pending');
592603
expect((req as any).method).toEqual('GET');
593604
expect((req as any).data).toEqual(undefined);
594-
expect((req as any).searchParams).toEqual(undefined);
605+
expect((req as any).searchParams).toEqual({ getClusters: 'true' });
595606
});
596607
});
597608

@@ -624,7 +635,7 @@ describe('listIndices', () => {
624635
expect((req as any).path).toEqual('/1/indexes');
625636
expect((req as any).method).toEqual('GET');
626637
expect((req as any).data).toEqual(undefined);
627-
expect((req as any).searchParams).toEqual(undefined);
638+
expect((req as any).searchParams).toEqual({ page: '8' });
628639
});
629640
});
630641

@@ -635,7 +646,10 @@ describe('listUserIds', () => {
635646
expect((req as any).path).toEqual('/1/clusters/mapping');
636647
expect((req as any).method).toEqual('GET');
637648
expect((req as any).data).toEqual(undefined);
638-
expect((req as any).searchParams).toEqual(undefined);
649+
expect((req as any).searchParams).toEqual({
650+
page: '8',
651+
hitsPerPage: '100',
652+
});
639653
});
640654
});
641655

@@ -743,7 +757,7 @@ describe('partialUpdateObject', () => {
743757
expect((req as any).data).toEqual([
744758
{ id1: 'test', id2: { _operation: 'AddUnique', value: 'test2' } },
745759
]);
746-
expect((req as any).searchParams).toEqual(undefined);
760+
expect((req as any).searchParams).toEqual({ createIfNotExists: 'true' });
747761
});
748762
});
749763

@@ -1084,7 +1098,7 @@ describe('setSettings', () => {
10841098
expect((req as any).path).toEqual('/1/indexes/theIndexName/settings');
10851099
expect((req as any).method).toEqual('PUT');
10861100
expect((req as any).data).toEqual({ paginationLimitedTo: 10 });
1087-
expect((req as any).searchParams).toEqual(undefined);
1101+
expect((req as any).searchParams).toEqual({ forwardToReplicas: 'true' });
10881102
});
10891103
});
10901104

0 commit comments

Comments
 (0)