-
Notifications
You must be signed in to change notification settings - Fork 5
PLATB-38: Cursor Pagination on Photos Endpoint #34
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
VikiAnn
wants to merge
8
commits into
main
Choose a base branch
from
platb-38/cursor-pagination-photos-endpoint
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
1535a69
Add cursor pagination info to /photos endpoint documentation
VikiAnn 78bf93c
Add missing documentation for project_id query param and photo schema…
VikiAnn 140223f
Fix wording issues & return type for photo coordinates
VikiAnn 5c666e2
Clarify page param description
VikiAnn 4f138ff
Nest Coordinate ref inside allOf property so that description renders
VikiAnn 7523024
Make relationship between cursor headers and params more explicit
VikiAnn 86bd72a
Remove pagination-specific language from bad request description
VikiAnn 6f0df01
Add cursor pagination to /projects/:project_id/photos endpoint docs
VikiAnn File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -827,22 +827,36 @@ paths: | |
| format: id | ||
| - name: page | ||
| in: query | ||
| description: "Page number for offset-based pagination. Cannot be used with cursor pagination (after/before params)" | ||
| schema: | ||
| type: integer | ||
| format: int32 | ||
| - name: per_page | ||
| in: query | ||
| description: "Number of results per page. Default 50, maximum 100" | ||
| schema: | ||
| type: integer | ||
| format: int32 | ||
| default: 50 | ||
| maximum: 100 | ||
| - name: after | ||
| in: query | ||
| description: "Cursor for forward pagination. Comes from X-Next-Cursor header value. Returns results after this cursor position. Cannot be used with 'before' or 'page'" | ||
| schema: | ||
| type: string | ||
| - name: before | ||
| in: query | ||
| description: "Cursor for backward pagination. Comes from X-Prev-Cursor header value. Returns results before this cursor position. Cannot be used with 'after' or 'page'" | ||
| schema: | ||
| type: string | ||
| - name: start_date | ||
| in: query | ||
| description: "A unix timestamp to return photos modified on or after the provided value" | ||
| description: "A unix timestamp to return photos captured on or after the provided value" | ||
| schema: | ||
| type: string | ||
| - name: end_date | ||
| in: query | ||
| description: "A unix timestamp to return photos modified on or before the provided value" | ||
| description: "A unix timestamp to return photos captured on or before the provided value" | ||
| schema: | ||
| type: string | ||
| - name: user_ids | ||
|
|
@@ -855,23 +869,42 @@ paths: | |
| format: int64 | ||
| - name: group_ids | ||
| in: query | ||
| description: "Filter results to include photos captured by one of these group IDs" | ||
| description: "Filter results to include photos captured by users in one of these group IDs" | ||
| schema: | ||
| type: array | ||
| items: | ||
| type: integer | ||
| format: int64 | ||
| - name: tag_ids | ||
| in: query | ||
| description: "Filter results to include photos captured by one of these tag IDs" | ||
| description: "Filter results to include photos with one of these tag IDs" | ||
| schema: | ||
| type: array | ||
| items: | ||
| type: integer | ||
| format: int64 | ||
| responses: | ||
| "200": | ||
| description: "List of projects sorted by most recent activity first" | ||
| description: "List of photos sorted by captured date descending" | ||
| headers: | ||
| X-Next-Cursor: | ||
| description: "Cursor that can be used as an 'after' param to fetch the next page of results. Empty if no more results" | ||
| schema: | ||
| type: string | ||
| X-Prev-Cursor: | ||
| description: "Cursor that can be used as a 'before' param to fetch the previous page of results. Empty if no previous results" | ||
| schema: | ||
| type: string | ||
| X-Has-Next: | ||
| description: "Indicates whether more results exist after the current page" | ||
| schema: | ||
| type: string | ||
| enum: ["true", "false"] | ||
| X-Has-Prev: | ||
| description: "Indicates whether results exist before the current page" | ||
| schema: | ||
| type: string | ||
| enum: ["true", "false"] | ||
| content: | ||
| application/json: | ||
| schema: | ||
|
|
@@ -1941,24 +1974,46 @@ paths: | |
| parameters: | ||
| - name: page | ||
| in: query | ||
| description: "Page number for offset-based pagination. Cannot be used with cursor pagination (after/before params)" | ||
| schema: | ||
| type: integer | ||
| format: int32 | ||
| - name: per_page | ||
| in: query | ||
| description: "Number of results per page. Default 50, maximum 100" | ||
| schema: | ||
| type: integer | ||
| format: int32 | ||
| default: 50 | ||
| maximum: 100 | ||
| - name: after | ||
| in: query | ||
| description: "Cursor for forward pagination. Comes from X-Next-Cursor header value. Returns results after this cursor position. Cannot be used with 'before' or 'page'" | ||
| schema: | ||
| type: string | ||
| - name: before | ||
| in: query | ||
| description: "Cursor for backward pagination. Comes from X-Prev-Cursor header value. Returns results before this cursor position. Cannot be used with 'after' or 'page'" | ||
| schema: | ||
| type: string | ||
| - name: start_date | ||
| in: query | ||
| description: "A unix timestamp to return photos modified on or after the provided value" | ||
| description: "A unix timestamp to return photos captured on or after the provided value" | ||
| schema: | ||
| type: string | ||
| - name: end_date | ||
| in: query | ||
| description: "A unix timestamp to return photos modified on or before the provided value" | ||
| description: "A unix timestamp to return photos captured on or before the provided value" | ||
| schema: | ||
| type: string | ||
| - name: project_ids | ||
| in: query | ||
| description: "Filter results to include photos from one of these project IDs" | ||
| schema: | ||
| type: array | ||
| items: | ||
| type: integer | ||
| format: int64 | ||
| - name: user_ids | ||
| in: query | ||
| description: "Filter results to include photos captured by one of these user IDs" | ||
|
|
@@ -1969,23 +2024,42 @@ paths: | |
| format: int64 | ||
| - name: group_ids | ||
| in: query | ||
| description: "Filter results to include photos captured by one of these group IDs" | ||
| description: "Filter results to include photos captured by users in one of these group IDs" | ||
| schema: | ||
| type: array | ||
| items: | ||
| type: integer | ||
| format: int64 | ||
| - name: tag_ids | ||
| in: query | ||
| description: "Filter results to include photos captured by one of these tag IDs" | ||
| description: "Filter results to include photos with one of these tag IDs" | ||
| schema: | ||
| type: array | ||
| items: | ||
| type: integer | ||
| format: int64 | ||
| responses: | ||
| "200": | ||
| description: "List of projects sorted by most recent activity first" | ||
| description: "List of photos sorted by captured date descending" | ||
| headers: | ||
| X-Next-Cursor: | ||
| description: "Cursor that can be used as an 'after' param to fetch the next page of results. Empty if no more results" | ||
| schema: | ||
| type: string | ||
| X-Prev-Cursor: | ||
| description: "Cursor that can be used as a 'before' param to fetch the previous page of results. Empty if no previous results" | ||
| schema: | ||
| type: string | ||
| X-Has-Next: | ||
| description: "Indicates whether more results exist after the current page" | ||
| schema: | ||
| type: string | ||
| enum: ["true", "false"] | ||
| X-Has-Prev: | ||
| description: "Indicates whether results exist before the current page" | ||
| schema: | ||
| type: string | ||
| enum: ["true", "false"] | ||
| content: | ||
| application/json: | ||
| schema: | ||
|
|
@@ -1998,8 +2072,15 @@ paths: | |
| application/json: | ||
| schema: | ||
| $ref: "#/components/schemas/Error" | ||
| example: | ||
| errors: ["Bad Request"] | ||
| examples: | ||
| both_cursors: | ||
| summary: Both cursors provided | ||
| value: | ||
| errors: ["Cannot use both 'after' and 'before' parameters"] | ||
| mixed_pagination: | ||
| summary: Mixed pagination types | ||
| value: | ||
| errors: ["Cannot use cursor pagination with offset pagination"] | ||
| "404": | ||
| description: "Not found" | ||
| content: | ||
|
|
@@ -3434,11 +3515,15 @@ components: | |
| "duplicate", | ||
| ] | ||
| example: "processed" | ||
| status: | ||
| type: string | ||
| description: "The status of the Photo" | ||
| enum: ["active", "deleted"] | ||
| example: "active" | ||
| coordinates: | ||
| type: array | ||
| description: "The coordinates where the Photo was captured" | ||
| items: | ||
| $ref: "#/components/schemas/Coordinate" | ||
| allOf: | ||
| - $ref: "#/components/schemas/Coordinate" | ||
|
Comment on lines
+3518
to
+3526
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Also just small corrections unrelated to the new cursor pagination behavior. |
||
| uris: | ||
| type: array | ||
| description: "A list of URIs for the different size variants of the photo." | ||
|
|
||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changes from here to L1980/L2002 are small corrections unrelated to the new cursor pagination behavior