Hi , when trying to work with an API (Bluesnap Rep...
# singer-taps
o
Hi , when trying to work with an API (Bluesnap Reporting) that uses SimpleHeaderPaginator in
tap-rest-api-mdsk
, I couldn't work out why fetching the next page didn't work. Only when i changed the source code (streams.py) to:
Copy code
def get_new_paginator(self):
        """Return the requested paginator required to retrieve all data from the API.

        Returns:
            Paginator Class.

        """
        <http://self.logger.info|self.logger.info>(
            f"the next_page_token_jsonpath = {self.next_page_token_jsonpath}."
        )

        if (
            self.pagination_request_style == "jsonpath_paginator"
            or self.pagination_request_style == "default"
        ):
            return JSONPathPaginator(self.next_page_token_jsonpath)
        elif (
            self.pagination_request_style == "simple_header_paginator"
        ):  # Example <http://Gitlab.com|Gitlab.com>
            return SimpleHeaderPaginator(self.next_page_token_jsonpath)
Instead of
Copy code
def get_new_paginator(self):
....
        elif (
            self.pagination_request_style == "simple_header_paginator"
        ):  # Example <http://Gitlab.com|Gitlab.com>
            return SimpleHeaderPaginator("X-Next-Page")
do you guys think i should post a pr? do you have a different solution that doesn't require pr/forking?
r
So it's a different header than
X-Next-Page
to paginate?
o
Yes, this is why I changed to the next page token I set in meltano.yml
r
Then yeah, I would make a PR.
1