This repository provides a collection of custom validation annotations for use with Spring Boot applications. These annotations help you enforce specific validation rules in your application by adding meaningful constraints (even though some of them are just for fun) to your data models.
Learn how to create these custom validation annotations and integrate them into your Spring Boot applications. Watch the tutorial on YouTube for step-by-step guidance and examples:
The @Age
annotation ensures that a LocalDate
field represents an age within a specified range.
The @AtLeastOneNotBlank
annotation validates whether at least one of the specified fields is not blank (non-empty).
The @ConditionalMandatory
annotation validates whether required fields are present if specified field has the given
value or values.
The @DivisibleBy
annotation ensures that a Integer
field is divisible by the given divider
The @ExcludedNumbers
annotation checks that a field's value is not one of the specified excluded numbers.
The @Fibonacci
annotation validates whether a field's value is a number within the Fibonacci series.
The @IntegerValues
annotation ensures that a field's value is one of the specified integer values.
The @ISO3166CountryCode
annotation checks whether a field's value represents a valid ISO 3166-1 country code (either
alpha-2 or alpha-3).