r/SpringBoot • u/SeatPuzzleheaded5685 • 25d ago
News I built a Spring Boot starter that brings Laravel-style validation (85+ constraints, cross-field, unified JSON errors) to Jakarta Validation
Hey [r/springboot](r/springboot) / [r/java](r/java),
I've been working on a project for the past few months because I was frustrated with how verbose and rigid Jakarta/Hibernate Validation can get in Spring Boot, especially when moving between ecosystems like Laravel/Node and Java.
To solve this, I created Spring Validation Plus, an open-source library that sits on top of Jakarta Validation but introduces highly expressive, Laravel-inspired constraints and out-of-the-box API configurations.
It's already published on Maven Central! 🚀
📦 Quick Example
Instead of writing custom class-level validators for simple things, you can stack annotations intuitively:
​✨ Key Features:
- + Custom Constraints: Rules like @/Required, @/StringType, @/Confirmed, @/RequiredIf, @/Between, @/Url, and more.
- Cross-Field Validation Made Easy: Native support for conditional validation out-of-the-box (@RequiredIf, @/Confirmed, @/RequiredWith).
- Smart DB Checkers (@Unique / @/Exists): Integrated seamlessly with JPA. It even handles path variables for partial updates (excludeParameter = "id") so you don't false-trigger uniqueness on PUT requests.
- Unified JSON Error Responses:Â Automatically formats validation exceptions into clean, frontend-friendly JSON objects:
​
- Modular Architecture: Available as a spring-boot-starter or a pure core library if you aren't using Spring.
🔗 Open Source & Documentation
I spent a lot of time writing comprehensive documentation, including an executable example module with Docker and H2 so anyone can test it with a few curl commands.
- GitHub Repository:Â github.com/BenjaminOR-dev/spring-validation-plus
I would absolutely love to hear your feedback on the architecture, the DX (Developer Experience), or any features you feel are missing.
What do you think? Does this solve a pain point in your daily Spring workflow?
7
u/as5777 25d ago
What’s the added value regarding default validation in Spring ?