Skip to content
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

Add support for additional strongly-typed validation context #85

Open
craigfowler opened this issue Oct 6, 2023 · 0 comments
Open

Add support for additional strongly-typed validation context #85

craigfowler opened this issue Oct 6, 2023 · 0 comments
Labels
enhancement A new feature or capability

Comments

@craigfowler
Copy link
Member

I'd like to add the capability for validators and validation rules to receive a strongly-typed object which contains validation context. This is a per-validation-run object which is specified by the consumer. It would be used to provide arbitrary data to the validation process.

For example, this context object could be used to supply some pre-fetched data from a database, which will be used/reused in order to run many rules. This could mean that rules do not need to repeatedly get this data for themselves.

This is not logically part of the object being validated, but it is supplementary data related to the validation process.

@craigfowler craigfowler added the enhancement A new feature or capability label Oct 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement A new feature or capability
Projects
None yet
Development

No branches or pull requests

1 participant