Skip to content

Commit

Permalink
Fixes records detection for header links paginator
Browse files Browse the repository at this point in the history
  • Loading branch information
burnash committed Feb 29, 2024
1 parent f3ea829 commit 16cb89a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion sources/rest_api/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
UnspecifiedPaginator,
SinglePagePaginator,
JSONResponsePaginator,
HeaderLinkPaginator,
)
from .detector import create_paginator, find_records_key

Expand Down Expand Up @@ -140,7 +141,7 @@ def paginate(
# If extract_records is None, try to detect records key
# based on the paginator type
if extract_records is None:
if isinstance(paginator, SinglePagePaginator):
if isinstance(paginator, (SinglePagePaginator, HeaderLinkPaginator)):
extract_records = lambda response: response.json() # noqa
elif isinstance(paginator, JSONResponsePaginator):
_records_path = find_records_key(response.json())
Expand Down

0 comments on commit 16cb89a

Please sign in to comment.