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

@Min validation a String #194

Open
dstepanov opened this issue Jan 18, 2024 · 0 comments
Open

@Min validation a String #194

dstepanov opened this issue Jan 18, 2024 · 0 comments

Comments

@dstepanov
Copy link

Looking at this test
org.hibernate.beanvalidation.tck.tests.constraints.validatorresolution.ValidatorResolutionTest#testResolutionOfMinMaxForDifferentTypes

I don't understand why would @Min work on a String type; it's JavaDoc doesn't say anything about validating a String.

public class MinMax {
	@Min(10l)
	@Max(20l)
	Number number;

	@Min(10l)
	@Max(20l)
	String numberAsString;

	public MinMax(String stringNumber, Number number) {
		this.numberAsString = stringNumber;
		this.number = number;
	}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant