feat: add MaxKeys typed parameter with validation and ergonomic API - #212
Merged
harshavardhana merged 1 commit intoMay 27, 2026
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Adds a typed MaxKeys parameter (1–1000) for ListObjects APIs, updates the list-objects builder/client docs accordingly, and introduces tests/docs to validate pagination behavior.
Changes:
- Introduce
MaxKeystyped parameter with range validation and conversions (parsing/display). - Update
ListObjectsbuilder internals to accept ergonomic.max_keys(…)input and send validatedmax-keysquery params. - Add integration/unit tests plus a documentation note for testing
max_keyspagination behavior.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 9 comments.
Show a summary per file
| File | Description |
|---|---|
src/s3/types/typed_parameters.rs |
Adds the validated MaxKeys type and related conversions. |
src/s3/error.rs |
Adds ValidationErr::InvalidMaxKeys for client-side validation failures. |
src/s3/types/mod.rs |
Re-exports MaxKeys from types. |
src/s3/builders/list_objects.rs |
Switches list-objects query building to use MaxKeys; adds an ergonomic wrapper type and unit tests. |
src/s3/client/list_objects.rs |
Expands API docs explaining max_keys paging semantics/limits. |
tests/s3/list_objects.rs |
Adds integration tests covering pagination with max_keys and the max_keys=1 edge case. |
docs/MAX_KEYS_TESTING.md |
New doc describing how to test and reason about max_keys paging behavior. |
HJLebbink
force-pushed
the
feat/issue-211-max-keys-validation
branch
from
April 28, 2026 20:30
d77c019 to
1b80eb0
Compare
HJLebbink
force-pushed
the
feat/issue-211-max-keys-validation
branch
3 times, most recently
from
April 28, 2026 20:48
01f1787 to
07c91f7
Compare
HJLebbink
force-pushed
the
feat/issue-211-max-keys-validation
branch
from
April 28, 2026 20:54
07c91f7 to
0f15234
Compare
HJLebbink
force-pushed
the
feat/issue-211-max-keys-validation
branch
from
April 29, 2026 09:12
0f15234 to
7b46669
Compare
Implements client-side validation for the max_keys parameter used in
ListObjects API calls, replacing implicit panics with explicit ValidationErr
handling. This ensures invalid user input is caught early with clear error
messages rather than causing runtime panics.
Key improvements:
- Adds MaxKeys typed parameter with validation (range: 1-1000) that matches
MinIO EOS hard limits
- Provides ergonomic builder API: .max_keys(500) instead of requiring
.max_keys(MaxKeys::new(500)?)
- Defers validation to request building time via to_s3request(), allowing
graceful error propagation instead of panicking in From<u16>
- Updates client documentation to reflect client-side validation behavior
- Adds 17 comprehensive unit tests covering boundary conditions, parsing,
and conversions
- Fixes error message redundancy to match project patterns
- Relaxes integration test assertions to respect max_keys as an upper bound,
preventing flakiness across S3 implementations
- Removes dead code (unused MAX_KEYS_TESTING.md, new_unchecked())
The builder now accepts max_keys values via multiple ergonomic paths:
- .max_keys(500) - accepts u16 directly
- .max_keys(MaxKeys::new(500)?) - explicit pre-validation
- .max_keys(None) - use server default (1000)
Validation ensures compliance with MinIO/S3 constraints while maintaining
clean error handling throughout the request lifecycle.
HJLebbink
force-pushed
the
feat/issue-211-max-keys-validation
branch
from
May 9, 2026 15:05
7b46669 to
d7472f2
Compare
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
feat: add MaxKeys typed parameter with validation and ergonomic API
Implements client-side validation for the max_keys parameter used in
ListObjects API calls, replacing implicit panics with explicit ValidationErr
handling. This ensures invalid user input is caught early with clear error
messages rather than causing runtime panics.
Key improvements:
MinIO EOS hard limits
.max_keys(MaxKeys::new(500)?)
graceful error propagation instead of panicking in From
and conversions
preventing flakiness across S3 implementations
The builder now accepts max_keys values via multiple ergonomic paths:
Validation ensures compliance with MinIO/S3 constraints while maintaining
clean error handling throughout the request lifecycle.