https://github.com/dogrulabs/jackson3-json-validation
A lightweight Jackson 3 + Jakarta Bean Validation library for Java.
https://github.com/dogrulabs/jackson3-json-validation
bean-validation jackson java json library validation
Last synced: 5 months ago
JSON representation
A lightweight Jackson 3 + Jakarta Bean Validation library for Java.
- Host: GitHub
- URL: https://github.com/dogrulabs/jackson3-json-validation
- Owner: dogrulabs
- License: apache-2.0
- Created: 2025-12-06T13:17:27.000Z (7 months ago)
- Default Branch: main
- Last Pushed: 2025-12-06T14:52:56.000Z (7 months ago)
- Last Synced: 2026-01-11T19:13:55.488Z (5 months ago)
- Topics: bean-validation, jackson, java, json, library, validation
- Language: Java
- Homepage:
- Size: 32.2 KB
- Stars: 1
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
- Codeowners: .github/CODEOWNERS
Awesome Lists containing this project
README
# Jackson 3 JSON Validation
[](https://central.sonatype.com/artifact/io.github.dogrulabs/jackson3-json-validation)
[](https://github.com/dogrulabs/jackson3-json-validation/actions)
[](LICENSE)
A lightweight Java library for validating JSON against Java DTOs using **Jackson 3** and **Jakarta Bean Validation**.
It avoids JSON Schema complexity by treating your Java classes (DTOs) as the schema definition.
## 📚 Documentation
Detailed documentation is available in the `docs` folder:
- [**Getting Started**](docs/getting-started.md): Installation and basic "Hello World" example.
- [**Advanced Usage**](docs/advanced-usage.md): Nested validation, collections, and custom constraints.
- [**Configuration**](docs/configuration.md): Customizing the Jackson Mapper and Validator.
- [**Error Handling**](docs/error-handling.md): Understanding and using `ValidationResult`.
## 🚀 Quick Start
### 1. Install
```xml
io.github.dogrulabs
jackson3-json-validation
1.0.0
```
### 2. Validate
```java
// 1. Define DTO
public class UserDto {
@NotNull
public String username;
}
// 2. Validate
JsonValidator validator = JsonValidators.defaultValidator();
ValidationResult result = validator.validate("{\"username\": null}", UserDto.class);
if (!result.valid()) {
System.out.println(result.errors()); // [ValidationError(path=username, message=must not be null)]
}
```
## Features
- **Java 17** baseline.
- **Jackson 3** (`tools.jackson.*`) for JSON parsing and binding.
- **Jakarta Bean Validation 3.0+** for constraints.
- **Zero Boilerplate**: No manual schema definition required.
- **Simple API**: Functional API returning a clear `ValidationResult`.
## Contributing
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
## License
[Apache License 2.0](LICENSE)