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

Short circuit validation in bind handler if previous exception is present #19599

Closed
mbhave opened this issue Jan 10, 2020 · 0 comments
Closed
Labels
type: task A general task
Milestone

Comments

@mbhave
Copy link
Contributor

mbhave commented Jan 10, 2020

For a class that looks like this

@Validated
static class ExampleCamelCase {

	@Valid
	private InnerProperties inner = new InnerProperties();

	InnerProperties getInner() {
		return this.inner;
	}

	static class InnerProperties {

	        @Min(5)
		private int personAge;

		int getPersonAge() {
			return this.personAge;
		}

		void setPersonAge(int personAge) {
			this.personAge = personAge;
		}

	}

}

personAge is validated twice. Since we only throw one validation exception, we can skip validation if a previous validation exception is present.

@mbhave mbhave added the type: task A general task label Jan 10, 2020
@mbhave mbhave added this to the 2.2.x milestone Jan 10, 2020
@mbhave mbhave closed this as completed in 1399954 Jan 10, 2020
@mbhave mbhave modified the milestones: 2.2.x, 2.2.3 Jan 10, 2020
mbhave added a commit that referenced this issue Jan 10, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: task A general task
Projects
None yet
Development

No branches or pull requests

1 participant