Skip to content

Commit

Permalink
docs: Fix HATEOAS pagination example (#1518)
Browse files Browse the repository at this point in the history
* Get rid of confusing type annotations
* Use the right classes
  • Loading branch information
edgarrmondragon authored Mar 21, 2023
1 parent 1b5ed2b commit 3c31d32
Showing 1 changed file with 4 additions and 4 deletions.
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

0 comments on commit 3c31d32

Please sign in to comment.