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

Provide a configuration property for MethodValidationPostProcessor's adaptConstraintViolations #43881

Open
Romster opened this issue Jan 19, 2025 · 0 comments · May be fixed by #43886
Open

Provide a configuration property for MethodValidationPostProcessor's adaptConstraintViolations #43881

Romster opened this issue Jan 19, 2025 · 0 comments · May be fixed by #43886
Labels
status: waiting-for-triage An issue we've not yet triaged

Comments

@Romster
Copy link

Romster commented Jan 19, 2025

Spring documentation describes the way how to make an application raise MethodValidationException instead of ConstraintViolationException by declaring a bean

         @Bean
	public static MethodValidationPostProcessor validationPostProcessor() {
		MethodValidationPostProcessor processor = new MethodValidationPostProcessor();
		processor.setAdaptConstraintViolations(true);
		return processor;
	}

It would be great to have a dedicated property used in org.springframework.boot.autoconfigure.validation.ValidationAutoConfiguration#methodValidationPostProcessor to change this behaviour.

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Jan 19, 2025
@snicoll snicoll changed the title Enhancement: ValidationAutoConfiguration - make "adaptConstraintViolations" configurable ValidationAutoConfiguration - make "adaptConstraintViolations" configurable Jan 19, 2025
quaff added a commit to quaff/spring-boot that referenced this issue Jan 21, 2025
quaff added a commit to quaff/spring-boot that referenced this issue Jan 21, 2025
@wilkinsona wilkinsona changed the title ValidationAutoConfiguration - make "adaptConstraintViolations" configurable Provide a configuration property for MethodValidationPostProcessor's adaptConstraintViolations Jan 21, 2025
quaff added a commit to quaff/spring-boot that referenced this issue Jan 22, 2025
quaff added a commit to quaff/spring-boot that referenced this issue Jan 22, 2025
quaff added a commit to quaff/spring-boot that referenced this issue Jan 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: waiting-for-triage An issue we've not yet triaged
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants