Skip to content

Jackson Codec#82

Closed
matthurne wants to merge 1 commit intoOpenFeign:masterfrom
matthurne:jackson
Closed

Jackson Codec#82
matthurne wants to merge 1 commit intoOpenFeign:masterfrom
matthurne:jackson

Conversation

@matthurne
Copy link
Copy Markdown
Contributor

This pull request includes an initial implementation of a Jackson codec, which may be used as an alternative to the Gson codec. It also includes minor improvements to the Javadocs of the EncodeException and DecodeException classes.

@cloudbees-pull-request-builder
Copy link
Copy Markdown

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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should probably clarify decoder javadoc that you dont need defensive finally close blocks.

@codefromthecrypt
Copy link
Copy Markdown
Contributor

Good work. Outside the few comments, make sure you update CHANGES (for next minor version) and the toplevel README

@cloudbees-pull-request-builder
Copy link
Copy Markdown

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

@davidmc24
Copy link
Copy Markdown
Contributor

It doesn't look to me like 5.4.0 has been released yet, so I think the CHANGES entry that's already in place is likely appropriate. (though I now realize that wasn't there when the comment was made)

Comment thread build.gradle
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@adriancole
Not really a criticism of the pull request (since it appropriately follows the pattern used in the rest of the file), but is there a reason we apply the java plugin in each separate project block rather than in an allprojects or subprojects block?

http://www.gradle.org/docs/current/userguide/multi_project_builds.html

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Android isnt compatible with the java plugin. That said, we don't have an
android module :)

@cloudbees-pull-request-builder
Copy link
Copy Markdown

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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are these default ObjectMapper tweaks also appropriate for the default ObjectMapper used by the encoder and decoder outside of Dagger?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably so; I'll modify the default constructors of the Encoder and Decoder as such.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've modified the JacksonEncoder and JacksonDecoder to apply the same default ObjectMapper tweaks that are used in the JacksonModule.

@cloudbees-pull-request-builder
Copy link
Copy Markdown

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

@cloudbees-pull-request-builder
Copy link
Copy Markdown

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

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Quick question: is there a way to get InputStream? That would be more efficient input source since Jackson combines UTF-8 decoding and parsing into a single step with raw byte-based input. It will also auto-detect encoding, as per JSON specification recommentation (... if anyone, ever, didn't use UTF-8 anyway :) ).

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As far as I know, currently there is no way to get an InputStream.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#83 is for binary bodies, but not until 6.0. Probably best to leave this as reader and then add another PR to revise after issue #83

@codefromthecrypt
Copy link
Copy Markdown
Contributor

after last tweak, squash then merge!

light plug for https://github.com/JakeWharton/rebaseandsqua.sh

commit 34eb575
Author: Matt Hurne <[email protected]>
Date:   Tue Oct 15 15:54:20 2013 -0400

    Remove unnecessary defensive close of Reader

commit 38e5160
Author: Matt Hurne <[email protected]>
Date:   Tue Oct 8 13:59:35 2013 -0400

    Replace wildcard import with individual imports

commit cc84581
Author: Matt Hurne <[email protected]>
Date:   Tue Oct 8 13:55:37 2013 -0400

    Revert GitHub example to use JacksonDecoder rather than JacksonModule now that JacksonDecoder behaves sensibly with its default ObjectMapper

commit 8b96382
Author: Matt Hurne <[email protected]>
Date:   Tue Oct 8 13:52:45 2013 -0400

    Configure default ObjectMapper used by JacksonEncoder and JacksonDecoder with sensible overrides of default behaviors

commit 0f275bf
Author: Matt Hurne <[email protected]>
Date:   Tue Oct 8 13:18:26 2013 -0400

    Unwrap RuntimeJsonMappingExceptions caught in JacksonDecoder, since they are only ever used to wrap JsonMappingExceptions, which are IOExceptions.

commit 1b69952
Author: Matt Hurne <[email protected]>
Date:   Tue Oct 8 13:09:44 2013 -0400

    Update Jackson integration README

commit add4007
Author: Matt Hurne <[email protected]>
Date:   Tue Oct 8 13:07:35 2013 -0400

    Update CHANGES and README to reflect addition of Jackson integration

commit 86c0fcf
Author: Matt Hurne <[email protected]>
Date:   Tue Oct 8 12:11:56 2013 -0400

    Update Jackson GitHub example to make use of JacksonModule, and to avoid the need for Jackson annotations

commit 1552b3f
Author: Matt Hurne <[email protected]>
Date:   Tue Oct 8 12:05:56 2013 -0400

    Replace wildcard import with individual imports

commit 0b7cfd0
Author: Matt Hurne <[email protected]>
Date:   Tue Oct 8 11:01:11 2013 -0400

    Initial implementation of Jackson codec

    This new codec may be used as an alternative to Gson.

commit 94027ec
Author: Matt Hurne <[email protected]>
Date:   Tue Oct 8 08:31:14 2013 -0400

    Improve EncodeException and DecodeException Javadoc comments
@matthurne
Copy link
Copy Markdown
Contributor Author

Are you recommending pushing a non-fast-forward to this branch to replace the individual commits with the squashed commit?

@cloudbees-pull-request-builder
Copy link
Copy Markdown

feign-pull-requests #114 ABORTED

@codefromthecrypt
Copy link
Copy Markdown
Contributor

Yep force push.

@matthurne
Copy link
Copy Markdown
Contributor Author

Got it, thanks - squashed and pushed.

@cloudbees-pull-request-builder
Copy link
Copy Markdown

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

@codefromthecrypt
Copy link
Copy Markdown
Contributor

cherry-picked into master and 5.x branches.

good job!

@matthurne
Copy link
Copy Markdown
Contributor Author

Thanks!

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.

5 participants