/jackson-proxy-module

A Jackson Module that enables deserializing to an interface using a proxy

Primary LanguageJavaMIT LicenseMIT

Build Status Coverage Status Quality Gate Maintainability Rating

Jackson Proxy Module

A Jackson Module that enables deserializing to an interface using a proxy.

Usage

Given you have some DTO interface, maybe already used for Spring Data projections:

public interface DtoInterface {
    String getFoo();
}

Then just register this module with your object mapper and you will be able to deserialize JSON to an interface type.

new ObjectMapper()
    .registerModule(new ProxyModule())
    .readValue("{\"foo\":\"bar\"}", DtoInterface.class);

Development

Coverage

mvn test jacoco:report can be used to analyze test coverage locally. Results can be found in target/site/jacoco.