public class JsonDecoder extends Object implements Decoder
Basic example with Feign.Builder:
interface GitHub {
@RequestLine("GET /repos/{owner}/{repo}/contributors")
JSONArray contributors( @Param("owner") String owner, @Param("repo") String repo);
}
GitHub github = Feign.builder()
.decoder(new JsonDecoder())
.target(GitHub.class, "https://api.github.com");
JSONArray contributors = github.contributors("openfeign", "feign");
System.out.println(contributors.getJSONObject(0).getString("login"));
Decoder.Default| Constructor and Description |
|---|
JsonDecoder() |
public Object decode(Response response, Type type) throws IOException, DecodeException
decode in interface DecoderIOExceptionDecodeExceptionCopyright © 2012–2023 OpenFeign. All rights reserved.