Closed IanYoung-BO closed 8 months ago
I do want to note that I am using version 2023-12-21~beta
of the REST API. This is primarily due to the lack of issues reporting in the release versions. I realize that this issue could be on the API side, as the endpoint has not been fully released yet. It may not be handling the pagination properly when responding to requests. However, adding in some simple error handling will improve the resiliency of this client, and enable more users to work with beta endpoints.
Fixed in Thanks, I've fixed up a formatting issue and merged in https://github.com/snyk-labs/pysnyk/commit/47ce10a784d01477f95435c9c30a4127ed61c292. Much appreciated.
Is there an existing issue for this?
Description of the bug
When looping through my orgs to retrieve issues, it appears that the client gets to the end and keeps looping, adding nothing each time.
Steps To Reproduce
This block of Python code caused an endless loop.
Setting the logger to DEBUG reveals the
get_rest_pages
function running repeatedly.Additional Information
Before I started testing the
pysnyk
client, I was making requests directly using therequests
library. I ran across this issue and was able to resolve it by adding a condition in my pagination loop.Now, I'm converting everything to Pandas DataFrames before returning, but the same idea applies. I'm checking for the following
This has rectified the issue for me, and one or more of these checks should fix the
get_rest_pages
function here.