Feign makes writing java http clients easier
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
Marvin Froeder e2615a9817 [ci skip] updating versions to next development iteration 12.2-SNAPSHOT 2 years ago
..
src
README.md
pom.xml

README.md

Jackson Jr Codec

This module adds support for encoding and decoding JSON via Jackson Jr. This is a significantly smaller and faster version of Jackson, which may be of benefit in smaller runtime containers.

Add JacksonJrEncoder and/or JacksonJrDecoder to your Feign.Builder like so:

GitHub github = Feign.builder()
                     .encoder(new JacksonJrEncoder())
                     .decoder(new JacksonJrDecoder())
                     .target(GitHub.class, "https://api.github.com");

If you want to customize the JSON object that is used, provide it to the JacksonJrEncoder and JacksonJrDecoder:

JSON json = Json.builder()
                .register(JacksonAnnotationExtension.builder()
                    .withVisibility(JsonAutoDetect.Value.defaultVisibility())
                    .build())
                .build();

GitHub github = Feign.builder()
                     .encoder(new JacksonJrEncoder(json))
                     .decoder(new JacksonJrDecoder(json))
                     .target(GitHub.class, "https://api.github.com");

Customisation is also possible by passing JacksonJrExtension objects into the constructor of the JacksonJrEncoder or JacksonJrDecoder:

List<JacksonJrExtension> extensions = singletonList(JacksonAnnotationExtension.builder()
        .withVisibility(JsonAutoDetect.Value.defaultVisibility())
        .build());
GitHub github = Feign.builder()
                     .encoder(new JacksonJrEncoder(extensions))
                     .decoder(new JacksonJrDecoder(extensions))
                     .target(GitHub.class, "https://api.github.com");