Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: Fix HATEOAS pagination example #1518

Merged
merged 1 commit into from
Mar 21, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions docs/guides/pagination-classes.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ The new pagination classes are designed to be more flexible, easier to understan

### Example: HATEOAS pagination, a.k.a. "next" links

Acommon pattern in REST APIs is to use a `next` field in the response to indicate the
A common pattern in REST APIs is to use a `next` field in the response to indicate the
URL of the next page of results. The [`BaseHATEOASPaginator`](../../classes/singer_sdk.pagination.BaseHATEOASPaginator)
class can be used to handle this pattern.

Expand Down Expand Up @@ -59,8 +59,8 @@ class MyPaginator(BaseHATEOASPaginator):


class MyStream(RESTStream):
def get_new_paginator(self) -> RESTPaginator:
return BaseHATEOASPaginator()
def get_new_paginator(self):
return MyPaginator()

def get_url_params(self, context, next_page_token):
params = {}
Expand Down Expand Up @@ -90,7 +90,7 @@ class MyPaginator(BaseOffsetPaginator):


class MyStream(RESTStream):
def get_new_paginator(self) -> RESTPaginator:
def get_new_paginator(self):
return BaseOffsetPaginator(start_value=0, page_size=250)

def get_url_params(self, context, next_page_token):
Expand Down