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 a bean validation context to control property validation #317

Merged
merged 2 commits into from
Mar 4, 2024

Conversation

graemerocher
Copy link
Contributor

@graemerocher graemerocher commented Mar 2, 2024

Sometimes you need to control what properties are validated and there is no current API to do that.

The use case if partial updates. So you want to send a request that partially updates an object in the database so you need to validate only a subset of the properties. Currently you can kind of do this with groups but it is awkward and requires static declaration.

The PR adds a BeanValidationContext which can be used to control property inclusions and perhaps for other purposes in the future. The code that passed around the groups has been refactored to so with the context instead.

@graemerocher graemerocher added the type: enhancement New feature or request label Mar 2, 2024
Copy link

sonarcloud bot commented Mar 2, 2024

@graemerocher graemerocher added type: improvement A minor improvement to an existing feature and removed type: enhancement New feature or request labels Mar 4, 2024
@graemerocher graemerocher merged commit 49ebed6 into master Mar 4, 2024
11 checks passed
@graemerocher graemerocher deleted the add-bean-validation-context branch March 4, 2024 11:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: improvement A minor improvement to an existing feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants