Skip to content

dogrulabs/jackson3-json-validation

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Jackson 3 JSON Validation

Maven Central Build Status 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:

🚀 Quick Start

1. Install

<dependency>
    <groupId>io.github.dogrulabs</groupId>
    <artifactId>jackson3-json-validation</artifactId>
    <version>1.0.0</version>
</dependency>

2. Validate

// 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

About

A lightweight Jackson 3 + Jakarta Bean Validation library for Java.

Topics

Resources

License

Code of conduct

Contributing

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages