Skip to content

Commit

Permalink
source-zendesk-support-native: handle cursor paginated responses with…
Browse files Browse the repository at this point in the history
… no results

When there are no results at all in a cursor paginated response, the
after and before cursor fields are not present. Although that shouldn't
affect the code flow (the `has_more` field would stop any attempted
pagination) a default value is needed to avoid validation errors.
  • Loading branch information
Alex-Bair committed Feb 25, 2025
1 parent a848ceb commit 3f99591
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -208,8 +208,9 @@ class SlaPoliciesResponse(FullRefreshOffsetPaginatedResponse):
class FullRefreshCursorPaginatedResponse(FullRefreshResponse):
class Meta(BaseModel, extra="forbid"):
has_more: bool
after_cursor: str | None
before_cursor: str | None
# after_cursor and before_cursor are not present in the response if there are no results.
after_cursor: str | None = None
before_cursor: str | None = None

meta: Meta
resources: list[FullRefreshResource]
Expand Down

0 comments on commit 3f99591

Please sign in to comment.