From 083346f95b57bd12b708dbcee36ea2f24a0b5f03 Mon Sep 17 00:00:00 2001 From: OBakalash <162008938+OBakalash@users.noreply.github.com> Date: Wed, 3 Apr 2024 17:49:01 +0300 Subject: [PATCH] Add support for next_page_token_path for Simple Header Paginator (#46) * Update README.md * Update streams.py * Update README.md * Update streams.py change according to review --- README.md | 2 +- tap_rest_api_msdk/streams.py | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 2ef3f28..3ca73af 100644 --- a/README.md +++ b/README.md @@ -630,4 +630,4 @@ meltano elt tap-rest-api-msdk target-jsonl ### SDK Dev Guide See the [dev guide](https://sdk.meltano.com/en/latest/dev_guide.html) for more instructions on how to use the SDK to -develop your own taps and targets. \ No newline at end of file +develop your own taps and targets. diff --git a/tap_rest_api_msdk/streams.py b/tap_rest_api_msdk/streams.py index 8c3494f..60dc2c6 100644 --- a/tap_rest_api_msdk/streams.py +++ b/tap_rest_api_msdk/streams.py @@ -291,6 +291,9 @@ def get_new_paginator(self): elif ( self.pagination_request_style == "simple_header_paginator" ): # Example Gitlab.com + if self.next_page_token_jsonpath: + return JSONPathPaginator(self.next_page_token_jsonpath) + return SimpleHeaderPaginator("X-Next-Page") elif self.pagination_request_style == "header_link_paginator": return HeaderLinkPaginator()