You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Removes Dagger 1.x Dependency and support for javax.inject.Named
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
Copy file name to clipboardExpand all lines: CHANGELOG.md
+4
Original file line number
Diff line number
Diff line change
@@ -1,3 +1,7 @@
1
+
### Version 8.0
2
+
* Removes Dagger 1.x Dependency
3
+
* Removes support for parameters annotated with `javax.inject.@Named`. Use `feign.@Param` instead.
4
+
1
5
### Version 7.1
2
6
* Introduces feign.@Param to annotate template parameters. Users must migrate from `javax.inject.@Named` to `feign.@Param` before updating to Feign 8.0.
Bank bank =Feign.builder().decoder(accountDecoder).requestInterceptor(newForwardedForInterceptor()).target(Bank.class, "https://api.examplebank.com");
67
-
```
68
-
69
-
Another common example of an interceptor would be authentication, such as using the built-in `BasicAuthRequestInterceptor`.
70
-
71
-
```java
72
-
Bank bank =Feign.builder().decoder(accountDecoder).requestInterceptor(newBasicAuthRequestInterceptor(username, password)).target(Bank.class, "https://api.examplebank.com");
73
-
```
74
-
75
53
### Multiple Interfaces
76
54
Feign can produce multiple api interfaces. These are defined as `Target<T>` (default `HardCodedTarget<T>`), which allow for dynamic discovery and decoration of requests prior to execution.
77
55
78
56
For example, the following pattern might decorate each request with the current url and auth token from the identity service.
You can find [several examples](https://github.com/Netflix/feign/tree/master/core/src/test/java/feign/examples) in the test tree. Do take time to look at them, as seeing is believing!
@@ -87,7 +66,7 @@ You can find [several examples](https://github.com/Netflix/feign/tree/master/cor
87
66
Feign intends to work well within Netflix and other Open Source communities. Modules are welcome to integrate with your favorite projects!
88
67
89
68
### Gson
90
-
[GsonModule](https://github.com/Netflix/feign/tree/master/gson)adds default encoders and decoders so you get get started with a JSON api.
69
+
[Gson](https://github.com/Netflix/feign/tree/master/gson)includes an encoder and decoder you can use with a JSON API.
91
70
92
71
Add `GsonEncoder` and/or `GsonDecoder` to your `Feign.Builder` like so:
[JacksonModule](https://github.com/Netflix/feign/tree/master/jackson)adds an encoder and decoder you can use with a JSON API.
82
+
[Jackson](https://github.com/Netflix/feign/tree/master/jackson)includes an encoder and decoder you can use with a JSON API.
104
83
105
84
Add `JacksonEncoder` and/or `JacksonDecoder` to your `Feign.Builder` like so:
106
85
@@ -124,7 +103,7 @@ api = Feign.builder()
124
103
```
125
104
126
105
### JAXB
127
-
[JAXBModule](https://github.com/Netflix/feign/tree/master/jaxb)allows you to encode and decode XML using JAXB.
106
+
[JAXB](https://github.com/Netflix/feign/tree/master/jaxb)includes an encoder and decoder you can use with an XML API.
128
107
129
108
Add `JAXBEncoder` and/or `JAXBDecoder` to your `Feign.Builder` like so:
130
109
@@ -136,7 +115,7 @@ api = Feign.builder()
136
115
```
137
116
138
117
### JAX-RS
139
-
[JAXRSModule](https://github.com/Netflix/feign/tree/master/jaxrs) overrides annotation processing to instead use standard ones supplied by the JAX-RS specification. This is currently targeted at the 1.1 spec.
118
+
[JAXRSContract](https://github.com/Netflix/feign/tree/master/jaxrs) overrides annotation processing to instead use standard ones supplied by the JAX-RS specification. This is currently targeted at the 1.1 spec.
140
119
141
120
Here's the example above re-written to use JAX-RS:
Feign can be directly wired into Dagger which keeps things at compile time and Android friendly. As opposed to exposing builders for config, Feign intends users to embed their config in Dagger.
189
+
### Advanced usage
212
190
213
-
Where possible, Feign configuration uses normal Dagger conventions. For example, `RequestInterceptor` bindings are of `Provider.Type.SET`, meaning you can have multiple interceptors. Here's an example of multiple interceptor bindings.
191
+
#### Logging
192
+
You can log the http messages going to and from the target by setting up a `Logger`. Here's the easiest way to do that:
0 commit comments