Skip to content

Forward serdevalid collection bounds through Nullable - #202

Open
EricLiu2000 wants to merge 1 commit into
Metaswitch:masterfrom
EricLiu2000:codex/validate-nullable-collection-size
Open

EricLiu2000 wants to merge 1 commit into
Metaswitch:masterfrom
EricLiu2000:codex/validate-nullable-collection-size

Conversation

@EricLiu2000

@EricLiu2000 EricLiu2000 commented Oct 15, 2026 •

Copy link
Copy Markdown

Fixes #201.

Forward ValidateMinItems and ValidateMaxItems through Nullable<T>. Null passes these bounds; Present(value) returns the inner value's validation result. This also supports Option<Nullable<T>> through serde_valid's existing Option implementation.

Validation: cargo fmt -- --check, cargo test, cargo test --all-features, cargo clippy --all-targets -- -D warnings, and cargo clippy --all-targets --all-features -- -D warnings pass. The new test fails to compile before the fix and covers null, absent, valid, and out-of-bound values.

Signed-off-by: Eric Liu <ericxliu@gmail.com>
@EricLiu2000
EricLiu2000 force-pushed the codex/validate-nullable-collection-size branch from 0b299fd to bfcc824 Compare October 15, 2026 04:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

serdevalid Nullable does not forward collection-size validation

1 participant