Files had various formatting differences, as did pull requests. Rather than
create our own style, this inherits and requires the well documented Google
Java Style.
Feign has `MethodMetadata.bodyType()`, but never passed it to encoders.
Encoders that register type adapters need to do so based on the
interface desired as opposed to the implementation class. This change
breaks api compatibility for < 8.x, by requiring an additional arg
on `Encoder.encode`.
see https://github.com/square/retrofit/issues/713
Dagger 1.x and 2.x are incompatible. Rather than choose one over the
other, this change removes Dagger completely. Users can now choose any
injector, constructing Feign via its Builder.
This change also drops support for javax.inject.Named, which has
been replaced by feign.Param.
see #120
Feign 8.x will no longer support Dagger, nor interfaces annotated with `javax.inject.@Named`. Users must migrate from `javax.inject.@Named` to `feign.@Param` via Feign v7.1+ before attempting to update to Feign 8.0.
For example, the following uses `@Param` as opposed to `@Named` to annotate template parameters.
```java
interface GitHub {
@RequestLine("GET /repos/{owner}/{repo}/contributors")
List<Contributor> contributors(@Param("owner") String owner, @Param("repo") String repo);
}
```
AssertJ has more powerful test assertions and does not run the risk of
interfering with the classpath of main code, such as guava does. This
removes guava from test and example code and adjusts using AssertJ in
some cases.
JUnit Rules, such as MockWebServerRule, reduce boilerplate setup present
in our tests. By migrating off TestNG, and onto rules, our tests become
more maintainable as JUnit is well understood.
Request/Response/RequestTemplate are now fundamentally based on a byte[] body field.
For Request/RequestTemplate, if a charset is provided, it can be treated as text.
For many users of the library, the change should barely be noticeable, as the methods that
were changed were mostly used internally.
There were some non-backwards-compatible signature changes that require a
major version bump, however.
commit 34eb5751c760cf1f11cdbab920d6a3a1c6f06640
Author: Matt Hurne <matt@thehurnes.com>
Date: Tue Oct 15 15:54:20 2013 -0400
Remove unnecessary defensive close of Reader
commit 38e51606750517d4a52571c408190e614a4a4834
Author: Matt Hurne <matt@thehurnes.com>
Date: Tue Oct 8 13:59:35 2013 -0400
Replace wildcard import with individual imports
commit cc845814ea677ba5920caf5a7a914010623caf1e
Author: Matt Hurne <matt@thehurnes.com>
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 8b9638261afe2549c3a43238ee1b66d044f969f4
Author: Matt Hurne <matt@thehurnes.com>
Date: Tue Oct 8 13:52:45 2013 -0400
Configure default ObjectMapper used by JacksonEncoder and JacksonDecoder with sensible overrides of default behaviors
commit 0f275bf7574b66c20a0e6aefe0140f599638992f
Author: Matt Hurne <matt@thehurnes.com>
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 1b6995260a5727796e388bbb0b6c88b65e182415
Author: Matt Hurne <matt@thehurnes.com>
Date: Tue Oct 8 13:09:44 2013 -0400
Update Jackson integration README
commit add4007a59559e7b4e2accfa0b0a0215bab62cef
Author: Matt Hurne <matt@thehurnes.com>
Date: Tue Oct 8 13:07:35 2013 -0400
Update CHANGES and README to reflect addition of Jackson integration
commit 86c0fcfc704b1b8d03e5eaf69c608fc2761d617b
Author: Matt Hurne <matt@thehurnes.com>
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 1552b3f8239636da0f27ace3c7b42038536e5caf
Author: Matt Hurne <matt@thehurnes.com>
Date: Tue Oct 8 12:05:56 2013 -0400
Replace wildcard import with individual imports
commit 0b7cfd08516dfbf66f1a69263ed456f2c0671c76
Author: Matt Hurne <matt@thehurnes.com>
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 94027ec3319f5145c0e18ef472d8e928e97a9527
Author: Matt Hurne <matt@thehurnes.com>
Date: Tue Oct 8 08:31:14 2013 -0400
Improve EncodeException and DecodeException Javadoc comments