@Override
    public Object decode(Response response, Type type) throws IOException {
      if (void.class == type || response.body() == null) {
        return null;
      }
      Reader reader = response.body().asReader(UTF_8);
      try {
        return gson.fromJson(reader, type);
      } catch (JsonIOException e) {
        if (e.getCause() != null && e.getCause() instanceof IOException) {
          throw IOException.class.cast(e.getCause());
        }
        throw e;
      } finally {
        ensureClosed(reader);
      }
    }
Here's how it looks to write a decoder. Note: you can instead use {@code feign-gson}!
core/src/test/java/feign/examples/GitHubExample.java