-
Notifications
You must be signed in to change notification settings - Fork 40.7k
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
Provide a callback mechanism for customizing LocalValidatorFactoryBean's configuration #29429
Conversation
Thanks for the proposal, @dangzhicairang. Do you think it's likely that you will want to inject dependencies into a custom |
Thank you @wilkinsona , it is a really nice suggestion, and i provide a callback class Customizer for the Configuration. And i retained the ability to automatically add the ValueExtractor(s) bean, so user can choose whether these ValueExtractor(s) are bean or not. The ValueExtractor which is bean will automatically add but added by Customizer or AddValueExtractorCustomizer if it not. |
Thanks for the updates, @dangzhicairang. Our feeling is that the general-purpose callback mechanism possibly belongs in Spring Framework rather than in Spring Boot, particularly as Framework already has its own |
Thank you for your reply @wilkinsona . It is right. |
spring-projects/spring-framework#27956 has been addressed. |
Thanks very much for making your first contribution to Spring Boot, @dangzhicairang. I have updated your proposal a little in 0e00faf to make use of the changes to Framework's |
Thanks a lot for your update @wilkinsona |
Add a AddValueExtractorsLocalValidatorFactoryBean that expand LocalValidatorFactoryBean which based SpringFramework, it can support user add custom ValueExtractor(s). For example, user can define ValueExtractor like this in their application:
And modify the class ValidationAutoConfiguration, auto-configure an instance of type AddValueExtractorsLocalValidatorFactoryBean instead of type LocalValidatorFactoryBean