Skip to content

Commit 614c818

Browse files
committed
Adding relative URL pagination to recipe
1 parent 6b2f854 commit 614c818

File tree

2 files changed

+17
-0
lines changed

2 files changed

+17
-0
lines changed

custom-recipes/api-connect/recipe.json

+16
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,22 @@
193193
"defaultValue": null,
194194
"visibilityCondition": "model.pagination_type=='next_page'"
195195
},
196+
{
197+
"name": "is_next_page_url_relative",
198+
"label": " ",
199+
"description": "Next page URL is relative",
200+
"type": "BOOLEAN",
201+
"defaultValue": false,
202+
"visibilityCondition": "model.pagination_type=='next_page'"
203+
},
204+
{
205+
"name": "next_page_url_base",
206+
"label": "Base URL to next page",
207+
"description": "https://mysite.com/bla/",
208+
"type": "STRING",
209+
"defaultValue": null,
210+
"visibilityCondition": "model.pagination_type=='next_page' && (model.is_next_page_url_relative==true)"
211+
},
196212
{
197213
"name": "top_key",
198214
"label": "Key limiting elements per page",

python-lib/rest_api_client.py

+1
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ def __init__(self, credential, endpoint, custom_key_values={}):
6363
next_page_url_key = endpoint.get("next_page_url_key", "")
6464
is_next_page_url_relative = endpoint.get("is_next_page_url_relative", False)
6565
next_page_url_base = endpoint.get("next_page_url_base", None) if is_next_page_url_relative else None
66+
next_page_url_base = format_template(next_page_url_base, **self.presets_variables)
6667
top_key = endpoint.get("top_key")
6768
skip_key = endpoint.get("skip_key")
6869
pagination_type = endpoint.get("pagination_type", "na")

0 commit comments

Comments
 (0)