Skip to content

Commit 1c4fee6

Browse files
committed
chore(discovery): hand edit to convert arrays to strings when required by the service
1 parent 43b75fd commit 1c4fee6

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

discovery/v1-generated.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1366,6 +1366,13 @@ class DiscoveryV1 extends BaseService {
13661366
if (missingParams) {
13671367
return _callback(missingParams);
13681368
}
1369+
// these params were arrays but now need to be strings, the following code is for compatibility
1370+
const nonArrayParams = ['return_fields', 'sort', 'passages_fields', 'collection_ids', 'similar_document_ids', 'similar_fields'];
1371+
nonArrayParams.forEach(paramName => {
1372+
if (Array.isArray(_params[paramName])) {
1373+
_params[paramName] = _params[paramName].join(',');
1374+
}
1375+
});
13691376
const body = {
13701377
'filter': _params.filter,
13711378
'query': _params.query,
@@ -1574,6 +1581,13 @@ class DiscoveryV1 extends BaseService {
15741581
if (missingParams) {
15751582
return _callback(missingParams);
15761583
}
1584+
// these params were arrays but now need to be strings, the following code is for compatibility
1585+
const nonArrayParams = ['return_fields', 'sort', 'passages_fields', 'collection_ids', 'similar_document_ids'];
1586+
nonArrayParams.forEach(paramName => {
1587+
if (Array.isArray(_params[paramName])) {
1588+
_params[paramName] = _params[paramName].join(',');
1589+
}
1590+
});
15771591
const body = {
15781592
'filter': _params.filter,
15791593
'query': _params.query,

0 commit comments

Comments
 (0)