axelrodvl / booking

Full-stack booking service with FE and BE on Kubernetes
0 stars 0 forks source link

Booking-9: Implemented validation for date constraints #11

Open Dolph111 opened 1 year ago

Dolph111 commented 1 year ago

@axelrodvl

axelrodvl commented 1 year ago

Your way is acceptable, but please, implement the validation using ConstraintValidator for custom logic, and @ControllerAdvice with ResponseEntityExceptionHandler as general exception handling.

If you need to add dozens of validations, your approach will become too bulky.

https://mkyong.com/spring-boot/spring-rest-validation-example/

Dolph111 commented 1 year ago

@axelrodvl done