Repository navigation
Decoder.decode() is no longer called for Response or void types. - #72
Conversation
|
@davidmc24 heads-up! |
|
feign-pull-requests #97 SUCCESS |
Decoder.decode() is no longer called for Response or void types.
|
I had actually added handling of those cases to decoder on purpose, with the goal of maximizing flexibility. Maybe doing it for void was just a mistake, as there aren't any other valid return values. For Response, I was thinking that there might be some cases where you'd want to return a slightly different response than the original one. I can't come up with a single example, so that may not be valid. So, 👍 on this change. I think that for non-void, non-response signatures, we should continue calling decoders even if the body is null, as there may be cases where it's useful to decode solely based on response headers. |
|
thanks for the post-commit review, david! |
|
Is there still a need for both Decoder.Default and StringDecoder? I think they do effectively the same thing now. |
|
fyi 5.0.1 is out w/this change now. netflix systems are passing now! |
|
wrt Decoder.Default vs StringDecoder.. we could make default extend StringDecoder w/o any changes I suppose! |
|
I like that approach. It preserves consistency for defaults, doesn't imply that default will always be just String, but still provides String as something that can be used standalone. |
|
okie.. feel free to send PR for this and any other cleanups. I know you mentioned something about gson, which currently isn't so nice from the pov of Builder. I'll be shaking out internal code for a while, but will plan on at least another patch or minor this week. |
Decoder.decode() is no longer called for Response or void types.
Pulled out logic that handles non-decode cases (ex. void and Response return types). This was exposed in testing where the gson parser was incorrectly trying to decode a
Response.