Open sshevlyagin opened 4 years ago
@sshevlyagin
The example you provided is something that I think is a little too specific for our general documentation. We may want to consider it part of our Wiki instead. Thoughts?
I agree, this should be a part of Wiki, code snippet was very useful for me
@kdavisk6 - happy to make it a wiki article. Can I have permission to edit or would you like to do it? I tried pushing up the attached file but I don't have the rights. wiki gist
@sshevlyagin lemme check how to do that, one sec
@sshevlyagin seems it's a all or nothing situation regarding to the wiki... either is public to anyone to edit or not...
@kdavisk6 what do you think about giving @sshevlyagin write access?
@sshevlyagin what if we added a new #decoder(MediaType,Decoder)
to Feign.Builder
Invoking decoder(Decoder)
would overwrite the decoder as is today.
Invoking decoder(MediaType,Decoder)
would replace decoder
with a TypedDecoder
, and would assign the existing decoder
to media-type */*
Subsequent invocations of decoder(MediaType,Decoder)
would append a new Decoder
to the TypedDecoder
.
If MediaType
already registered on TypedDecoder
log warning and replace.
TypedDecoder
would be a implementation of Decoder
that checks the MediaType
first and then delegate the decoding process to Decoder
That sounds way better @velo. My scenario was the API returns image/jpeg
or application/json
depending on which endpoint you hit.
re: wiki, no need to give me write access you can just copy/paste that gist if you want
In my implementation I need to use the default decoder for
byte[]
and GsonDecoder to map to objects and I'm doing the following in Java 11:Is this worth having an example in the documentation? I was inspired by this discussion https://github.com/spring-cloud/spring-cloud-netflix/issues/2246