Skip to content

Commit 4fa3250

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
Fix ListCatalogEntity pagination endpoint to use correct offset value (#543)
Co-authored-by: ci.datadog-api-spec <[email protected]>
1 parent b5ab44e commit 4fa3250

File tree

3 files changed

+10
-9
lines changed

3 files changed

+10
-9
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:27.323894",
8-
"spec_repo_commit": "35df584d"
7+
"regenerated": "2025-03-05 14:38:20.340456",
8+
"spec_repo_commit": "0c376cca"
99
},
1010
"v2": {
1111
"apigentools_version": "1.6.6",
12-
"regenerated": "2025-03-03 19:12:27.340073",
13-
"spec_repo_commit": "35df584d"
12+
"regenerated": "2025-03-05 14:38:20.356470",
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.

src/datadogV2/api/api_software_catalog.rs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -303,9 +303,6 @@ impl SoftwareCatalogAPI {
303303
} else {
304304
page_size = params.page_limit.unwrap().clone();
305305
}
306-
if params.page_offset.is_none() {
307-
params.page_offset = Some(0);
308-
}
309306
loop {
310307
let resp = self.list_catalog_entity(params.clone()).await?;
311308
let Some(data) = resp.data else { break };
@@ -319,7 +316,11 @@ impl SoftwareCatalogAPI {
319316
if count < page_size as usize {
320317
break;
321318
}
322-
params.page_offset = Some(params.page_offset.unwrap() + 1);
319+
if params.page_offset.is_none() {
320+
params.page_offset = Some(page_size.clone());
321+
} else {
322+
params.page_offset = Some(params.page_offset.unwrap() + page_size.clone());
323+
}
323324
}
324325
}
325326
}

0 commit comments

Comments
 (0)