Skip to content

Add struct-level custom rule #144

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

lasantosr
Copy link
Contributor

This PR would close #61

It's backwards compatible so a minor release would be enough

@lasantosr
Copy link
Contributor Author

@jprochazk This is implemented following your guidelines from #61 (comment), can you have a look and generate a new version?

The main use case are mutually exclusive options like you mentioned, but there are other custom validations that could be performed.

Manually implementing the Validate trait would require a lot of boilerplate for structs that contains lots of fields with lots of validations the derive macro is already capable of managing, because you would have to manually call all of those validations and manage errors and paths.

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.

Struct-level custom rule
1 participant