Restore deprecated enumerate validation API#119
Merged
Conversation
There was a problem hiding this comment.
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) invalidation::genericby adding a newenumeratemodule mirroring theenumimplementation. - Reintroduces
ValidateCompositedEnumerate(deprecated) as a composited validation trait that forwards toEnumError. - Reintroduces
EnumerateError(deprecated) as a type alias forEnumError, and re-exports the compatibility items fromlib,validation, andvalidation::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.
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.
Restores the removed Enumerate-named public API as deprecated compatibility shims for downstream crates that still reference the 2.0.1 names.
EnumerateErroris now a deprecated alias ofEnumError, whileValidateEnumerateandValidateCompositedEnumerateforward to the current enum validation error type and point users to theEnumreplacements.This fixes the patch-release compatibility break reported in #118 without changing the current
ValidateEnumAPI.Validated with
cargo check --manifest-path .context/issue-118-compat/Cargo.toml,cargo test -p serde_valid validation::generic:: --lib,cargo build --all-features, andcargo test --all-features.