public class JsonDecoder extends Object implements feign.codec.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"));
Constructor and Description |
---|
JsonDecoder() |
public Object decode(feign.Response response, Type type) throws IOException, feign.codec.DecodeException
decode
in interface feign.codec.Decoder
IOException
feign.codec.DecodeException
Copyright © 2012–2025 OpenFeign. All rights reserved.