Skip to content

Conversation

@ya7010
Copy link
Owner

@ya7010 ya7010 commented Jan 6, 2026

No description provided.

@ya7010 ya7010 requested a review from Copilot January 6, 2026 09:01
Copy link

Copilot AI left a comment

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 introduces a new r#enum validation attribute as a replacement for the deprecated enumerate attribute, aligning the API more closely with JSON Schema's "enum" keyword. The change maintains backward compatibility by keeping enumerate functional but deprecated.

Key changes:

  • Added new r#enum validation attribute alongside the existing enumerate attribute
  • Renamed internal functions and traits from *enumerate* to *enum* variants
  • Added deprecation warnings for the old enumerate attribute
  • Updated test files to use the new r#enum syntax

Reviewed changes

Copilot reviewed 18 out of 18 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
crates/serde_valid_derive/src/attribute.rs Added Enum = "r#enum" variant to the validation enum with PartialEq, Eq derives
crates/serde_valid_derive/src/attribute/field_validate/meta/meta_name_value.rs Added warning system integration and deprecation notice for enumerate
crates/serde_valid_derive/src/attribute/field_validate/generic/enum.rs Renamed functions from *enumerate* to *enum* variants
crates/serde_valid_derive/src/attribute/field_validate/generic.rs Updated module import from enumerate to r#enum
crates/serde_valid_derive/src/error.rs Renamed error function and filtered Enumerate from suggestions
crates/serde_valid_derive/src/warning.rs Simplified function naming in warning generation
crates/serde_valid/src/validation/generic/enum.rs Renamed trait from ValidateEnumerate to ValidateEnum with deprecated backward-compatible method
crates/serde_valid/src/validation/generic.rs Re-exported both new and old trait names for compatibility
crates/serde_valid/tests/*.rs Updated test files to use r#enum syntax
crates/serde_valid/README.md Updated documentation to reference new r#enum attribute

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

@ya7010 ya7010 merged commit c245a7e into main Jan 6, 2026
3 checks passed
@ya7010 ya7010 deleted the use_enum_instead_of_enumerate branch January 6, 2026 09:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants