Skip to content

Restore deprecated enumerate validation API#119

Merged
ya7010 merged 2 commits into
mainfrom
ya7010/fix-issue-118
Jun 16, 2026
Merged

Restore deprecated enumerate validation API#119
ya7010 merged 2 commits into
mainfrom
ya7010/fix-issue-118

Conversation

@ya7010

@ya7010 ya7010 commented Jun 16, 2026

Copy link
Copy Markdown
Owner

Restores the removed Enumerate-named public API as deprecated compatibility shims for downstream crates that still reference the 2.0.1 names.

EnumerateError is now a deprecated alias of EnumError, while ValidateEnumerate and ValidateCompositedEnumerate forward to the current enum validation error type and point users to the Enum replacements.

This fixes the patch-release compatibility break reported in #118 without changing the current ValidateEnum API.

Validated with cargo check --manifest-path .context/issue-118-compat/Cargo.toml, cargo test -p serde_valid validation::generic:: --lib, cargo build --all-features, and cargo test --all-features.

@ya7010
ya7010 marked this pull request as ready for review June 16, 2026 09:21
@ya7010
ya7010 requested a review from Copilot June 16, 2026 09:21

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR restores the previously removed Enumerate-named public API surface as deprecated compatibility shims, so downstream crates targeting the 2.0.1 names can compile again without changing the current ValidateEnum / EnumError API.

Changes:

  • Reintroduces ValidateEnumerate (deprecated) in validation::generic by adding a new enumerate module mirroring the enum implementation.
  • Reintroduces ValidateCompositedEnumerate (deprecated) as a composited validation trait that forwards to EnumError.
  • Reintroduces EnumerateError (deprecated) as a type alias for EnumError, and re-exports the compatibility items from lib, validation, and validation::error.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
crates/serde_valid/src/validation/generic/enumerate.rs Adds deprecated ValidateEnumerate shim and corresponding impls/tests.
crates/serde_valid/src/validation/generic.rs Registers enumerate module and re-exports ValidateEnumerate (deprecated).
crates/serde_valid/src/validation/error.rs Re-exports EnumerateError (deprecated) from the validation error module.
crates/serde_valid/src/validation.rs Re-exports ValidateEnumerate and adds deprecated ValidateCompositedEnumerate; updates composited-trait macro to accept trait metadata.
crates/serde_valid/src/lib.rs Re-exports deprecated compatibility symbols (EnumerateError, ValidateEnumerate) at crate root.
crates/serde_valid/src/error.rs Adds deprecated EnumerateError type alias to EnumError.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread crates/serde_valid/src/validation.rs Outdated
@ya7010
ya7010 merged commit 68eef2e into main Jun 16, 2026
3 checks passed
@ya7010
ya7010 deleted the ya7010/fix-issue-118 branch June 16, 2026 09:36
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.

2 participants