Triggering Bean Validation programmatically


Validation in Spring Boot applications can be done in many different ways.

Why validation?

Validating incoming request data is good to reject nonsense as early as possible. Persistence layer validation should only be used as additional layer of safety.

I prefere validation programmatically even if triggering Bean Validation programmatically takes a bit more effort. I think it is usually the most flexible way.

Validation is done by using the Bean Validation API. The reference implementation for the Bean Validation API is Hibernate Validator.

Triggering Bean Validation programmatically


Validating extends SelfValidating class


Go to source code

Comments

Popular posts from this blog

Debug Java Stream in Intellij Idea

Creating Efficient Docker Images with Spring Boot 2.3

CRUD Goes Even Easier With JPABuddy