[GH-ISSUE #1912] No pagination / listing objects with maxResults does not return nextPageToken #228

Closed
opened 2026-03-03 12:09:18 +03:00 by kerem · 0 comments
Owner

Originally created by @jonathanbrem-dt on GitHub (Feb 24, 2025).
Original GitHub issue: https://github.com/fsouza/fake-gcs-server/issues/1912

Setup:

dir/
 |-- data
       |-- sample-bucket
             |-- some_file_0.txt
             |-- some_file_1.txt
             |-- some_file_2.txt
             |-- some_file_3.txt
             |-- some_file_4.txt
             |-- some_file_5.txt
             |-- some_file_6.txt
             |-- some_file_7.txt

then in "dir":
docker run -d --name fake-gcs-server -p 4443:4443 -v ${PWD}/data:/data fsouza/fake-gcs-server

and to list the objects, using maxResults:
curl --insecure https://0.0.0.0:4443/storage/v1/b/sample-bucket/o?maxResults=5

The response does not contain a nextPageToken, which is mentioned in https://cloud.google.com/storage/docs/json_api/v1/objects/list:

Property name Value Description
nextPageToken string The continuation token. Provide this value as the pageToken of a subsequent request in order to return the next page of results. Note that the next page may be empty. If this is the last page of results, then no continuation token is returned. The presence of this parameter in the response should always be checked to ensure a complete listing of all the results.

Are you planning to add support for this?
Love the project, by the way, very helpful for testing GCS up front; which is why this became an issue for us, usually the behavior is the same, so we assumed this would work and we are doing something wrong on the client side.

Originally created by @jonathanbrem-dt on GitHub (Feb 24, 2025). Original GitHub issue: https://github.com/fsouza/fake-gcs-server/issues/1912 Setup: ``` dir/ |-- data |-- sample-bucket |-- some_file_0.txt |-- some_file_1.txt |-- some_file_2.txt |-- some_file_3.txt |-- some_file_4.txt |-- some_file_5.txt |-- some_file_6.txt |-- some_file_7.txt ``` then in "dir": `docker run -d --name fake-gcs-server -p 4443:4443 -v ${PWD}/data:/data fsouza/fake-gcs-server` and to list the objects, using maxResults: `curl --insecure https://0.0.0.0:4443/storage/v1/b/sample-bucket/o?maxResults=5` The response does not contain a `nextPageToken`, which is mentioned in https://cloud.google.com/storage/docs/json_api/v1/objects/list: | Property name | Value | Description | |---------------|--------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | nextPageToken | string | The continuation token. Provide this value as the `pageToken` of a subsequent request in order to return the next page of results. Note that the next page may be empty. If this is the last page of results, then no continuation token is returned. The presence of this parameter in the response should always be checked to ensure a complete listing of all the results. | Are you planning to add support for this? Love the project, by the way, very helpful for testing GCS up front; which is why this became an issue for us, usually the behavior is the same, so we assumed this would work and we are doing something wrong on the client side.
kerem closed this issue 2026-03-03 12:09:18 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/fake-gcs-server#228
No description provided.