It’s official: Sanitizer-Lib is now available on Maven Central! 🚀
A few months ago, I introduced Sanitizer-Lib, a Java library designed to kill the boilerplate of input sanitization. No more manual .trim() calls, no more scattered string manipulation logic. Just clean, declarative annotations.
Since then, the feedback has been amazing. But there was one friction point: you had to use JitPack or build it locally.
Not anymore.
As of today, you can pull Sanitizer-Lib directly from Maven Central. It’s production-ready, signed, and just a copy-paste away.
📦 How to Install
Maven
Add this to your pom.xml:
<dependency>
<groupId>io.github.rabinarayanpatra.sanitizer</groupId>
<artifactId>sanitizer-spring</artifactId>
<version>1.0.22</version>
</dependency>Gradle
Add this to your build.gradle:
implementation("io.github.rabinarayanpatra:sanitizer-spring:1.0.22")✨ Why You Should Use It
If you missed the original deep dive, here is the 30-second pitch:
Instead of writing this validation spaghetti:
public void createUser(UserDto user) {
if (user.getEmail() != null) {
user.setEmail(user.getEmail().trim().toLowerCase());
}
// ... repeat for 10 other fields
}You just do this:
public class UserDto {
@Sanitize(using = {TrimSanitizer.class, LowerCaseSanitizer.class})
private String email;
}That’s it. Incoming requests are automatically sanitized before they even hit your controller logic.
📚 Learn More
For a full walkthrough of features, custom sanitizers, and Spring Boot integration, check out my detailed guide:
👉 Read the Full Sanitizer-Lib Introduction
Or star the repo on GitHub: github.com/rabinarayanpatra/sanitizer-lib
Happy coding! ☕
