Skip to content

seart-group/jakarta-validation-utils

Repository files navigation

Jakarta Bean Validation Utilities · GitHub Workflow Status (with event) Maven Central javadoc MIT license

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

Requirements

Requires a minimum of Java 8.

Using the current version

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>

Using the legacy version

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>

Migrating from legacy

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.