Skip to content

Commit ccba388

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
and
ci.datadog-api-spec
authored
Fix ListCatalogEntity pagination endpoint to use correct offset value (#2082)
Co-authored-by: ci.datadog-api-spec <packages@datadoghq.com>
1 parent e6921af commit ccba388

File tree

3 files changed

+10
-7
lines changed

3 files changed

+10
-7
lines changed

.apigentools-info

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@
44
"spec_versions": {
55
"v1": {
66
"apigentools_version": "1.6.6",
7-
"regenerated": "2025-03-03 19:12:25.353192",
8-
"spec_repo_commit": "35df584d"
7+
"regenerated": "2025-03-05 14:38:20.899139",
8+
"spec_repo_commit": "0c376cca"
99
},
1010
"v2": {
1111
"apigentools_version": "1.6.6",
12-
"regenerated": "2025-03-03 19:12:25.369052",
13-
"spec_repo_commit": "35df584d"
12+
"regenerated": "2025-03-05 14:38:20.914305",
13+
"spec_repo_commit": "0c376cca"
1414
}
1515
}
1616
}

.generator/schemas/v2/openapi.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35328,7 +35328,7 @@ paths:
3532835328
- Software Catalog
3532935329
x-pagination:
3533035330
limitParam: page[limit]
35331-
pageParam: page[offset]
35331+
pageOffsetParam: page[offset]
3533235332
resultsPath: data
3533335333
post:
3533435334
description: Create or update entities in Software Catalog.

packages/datadog-api-client-v2/apis/SoftwareCatalogApi.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -537,7 +537,6 @@ export class SoftwareCatalogApi {
537537
pageSize = param.pageLimit;
538538
}
539539
param.pageLimit = pageSize;
540-
param.pageOffset = 0;
541540
while (true) {
542541
const requestContext = await this.requestFactory.listCatalogEntity(
543542
param.pageOffset,
@@ -570,7 +569,11 @@ export class SoftwareCatalogApi {
570569
if (results.length < pageSize) {
571570
break;
572571
}
573-
param.pageOffset = param.pageOffset + 1;
572+
if (param.pageOffset === undefined) {
573+
param.pageOffset = pageSize;
574+
} else {
575+
param.pageOffset = param.pageOffset + pageSize;
576+
}
574577
}
575578
}
576579

0 commit comments

Comments
 (0)