Skip to content

Decoder.decode() is no longer called for Response or void types. - #72

Merged
codefromthecrypt merged 2 commits into
masterfrom
decoders-only-decode
Sep 18, 2013
Merged

codefromthecrypt merged 2 commits into
masterfrom
decoders-only-decode

Conversation

@codefromthecrypt

Copy link
Copy Markdown

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.

@codefromthecrypt

Copy link
Copy Markdown
Author

@davidmc24 heads-up!

@cloudbees-pull-request-builder

Copy link
Copy Markdown

feign-pull-requests #97 SUCCESS
This pull request looks good

codefromthecrypt pushed a commit that referenced this pull request Sep 18, 2013
Decoder.decode() is no longer called for Response or void types.
@codefromthecrypt
codefromthecrypt merged commit de9bb49 into master Sep 18, 2013
@codefromthecrypt
codefromthecrypt deleted the decoders-only-decode branch September 18, 2013 00:02
@davidmc24

Copy link
Copy Markdown
Contributor

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.

@codefromthecrypt

Copy link
Copy Markdown
Author

thanks for the post-commit review, david!

@davidmc24

Copy link
Copy Markdown
Contributor

Is there still a need for both Decoder.Default and StringDecoder? I think they do effectively the same thing now.

@codefromthecrypt

Copy link
Copy Markdown
Author

fyi 5.0.1 is out w/this change now.

netflix systems are passing now!

@codefromthecrypt

Copy link
Copy Markdown
Author

wrt Decoder.Default vs StringDecoder.. we could make default extend StringDecoder w/o any changes I suppose!

@davidmc24

Copy link
Copy Markdown
Contributor

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.

@codefromthecrypt

Copy link
Copy Markdown
Author

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.

velo pushed a commit that referenced this pull request Oct 8, 2024
Decoder.decode() is no longer called for Response or void types.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants