Skip to content

Commit e721dc2

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

File tree

3 files changed

+6
-7
lines changed

3 files changed

+6
-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:20.089333",
8-
"spec_repo_commit": "35df584d"
7+
"regenerated": "2025-03-05 14:38:28.313596",
8+
"spec_repo_commit": "0c376cca"
99
},
1010
"v2": {
1111
"apigentools_version": "1.6.6",
12-
"regenerated": "2025-03-03 19:12:20.104738",
13-
"spec_repo_commit": "35df584d"
12+
"regenerated": "2025-03-05 14:38:28.329295",
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.

lib/datadog_api_client/v2/api/software_catalog_api.rb

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -187,14 +187,13 @@ def list_catalog_entity_with_pagination(opts = {})
187187
api_version = "V2"
188188
page_size = @api_client.get_attribute_from_path(opts, "page_limit", 100)
189189
@api_client.set_attribute_from_path(api_version, opts, "page_limit", Integer, page_size)
190-
@api_client.set_attribute_from_path(api_version, opts, "page_offset", Integer, 0)
191190
while true do
192191
response = list_catalog_entity(opts)
193192
@api_client.get_attribute_from_path(response, "data").each { |item| yield(item) }
194193
if @api_client.get_attribute_from_path(response, "data").length < page_size
195194
break
196195
end
197-
@api_client.set_attribute_from_path(api_version, opts, "page_offset", Integer, @api_client.get_attribute_from_path(opts, "page_offset", 0) + 1)
196+
@api_client.set_attribute_from_path(api_version, opts, "page_offset", Integer, @api_client.get_attribute_from_path(opts, "page_offset", 0) + page_size)
198197
end
199198
end
200199

0 commit comments

Comments
 (0)