This library provides several custom validation annotations:
- ASCII-only strings
- Alphanumeric strings
- Null or non-blank strings
- OWASP-compliant emails
- Custom password requirements
- BCrypt and SHA hash values
- GitHub Personal Access Tokens (PATs)
- Semantic version strings
Requires a minimum of Java 8.
To use the most recent version, simply include the library with the latest version of the Jakarta Validation API, for example:
<dependencies>
<dependency>
<groupId>jakarta.validation</groupId>
<artifactId>jakarta.validation-api</artifactId>
<version>3.0.2</version>
</dependency>
<dependency>
<groupId>ch.usi.si.seart</groupId>
<artifactId>jakarta-validation-utils</artifactId>
<version>0.4.0</version>
</dependency>
</dependencies>
If you are still using the previous major release of Jakarta Validation API (i.e. you are using Spring Boot 2), then you will need to include the alternative dependency:
<dependencies>
<dependency>
<groupId>jakarta.validation</groupId>
<artifactId>jakarta.validation-api</artifactId>
<version>2.0.2</version>
</dependency>
<dependency>
<groupId>ch.usi.si.seart</groupId>
<artifactId>jakarta-validation-utils-legacy</artifactId>
<version>0.4.0</version>
</dependency>
</dependencies>
Aside from upgrading your Jakarta Validation API (or its dependents),
you will only need to change the artifactId
from jakarta-validation-utils-legacy
to jakarta-validation-utils
.
No other code changes required.