Skip to content

Showcase Spring Boot project for custom conditional validation.

Notifications You must be signed in to change notification settings

ppratakk/ConditionalValidator

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 

Repository files navigation

ConditionalValidator

Showcase Spring Boot project for custom conditional validation.

A tutorial linked to this repository:

https://medium.com/@crb3/spring-boot-conditional-validation-example-2dd23af22539

The main purpose of this repository is provide a solution for a conditional validation example in spring boot. The object to validate is the ExportLocationDTO POJO class , depending on it's field locationOption's value different additional fields are validated.

case EMAIL :

  • emailAddress field cannot be null or empty and any other non annotated fields are optional

case FTP or SFTP :

  • host, port, user and password fields cannot be null or empty and any other non annotated fields are optional.

Take a look at the test folder as well to have a working proof of the concept.

About

Showcase Spring Boot project for custom conditional validation.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Java 100.0%