Skip to content

Commit

Permalink
chore: black
Browse files Browse the repository at this point in the history
  • Loading branch information
nathan-roys committed Aug 30, 2023
1 parent 3d459f4 commit f2a680c
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions snyk/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -217,14 +217,18 @@ def get_rest_pages(self, path: str, params: dict = {}) -> List:
return_data = page_data["data"]

while page_data.get("links", {}).get("next"):
logger.debug(f"GET_REST_PAGES: Another link exists: {page_data['links']['next']}")
logger.debug(
f"GET_REST_PAGES: Another link exists: {page_data['links']['next']}"
)
next_url = page_data.get("links", {}).get("next")

# The next url comes back fully formed (i.e. with all the params already set, so no need to do it here)
next_page_response = self.get(next_url, {}, exclude_version=True)
page_data = next_page_response.json()
return_data.extend(page_data["data"])
logger.debug(f"GET_REST_PAGES: Added another {len(page_data['data'])} items to the response")
logger.debug(
f"GET_REST_PAGES: Added another {len(page_data['data'])} items to the response"
)
return return_data

# alias for backwards compatibility where V3 was the old name
Expand Down

0 comments on commit f2a680c

Please sign in to comment.