This module overrides annotation processing to instead use standard ones supplied by the JAX-RS specification. This is currently targeted at the 1.1 spec.
While it may appear possible to reuse the same interface across client and server, bear in mind that JAX-RS resource annotations were not designed to be processed by clients. Moreover, JAX-RS 2.0 has a different package hierarchy for client invocation. Finally, JAX-RS is a large spec and attempts to implement it completely would be a project larger than feign itself. In other words, this implementation is best efforts and concedes far from 100% compatibility with server interface behavior.
Feign only supports processing java interfaces (not abstract or concrete classes).
Here are a list of behaviors currently supported.
Appends the value to Target.url()
. Can have tokens corresponding to @PathParam
annotations.
Sets the request method.
Appends the value to Target.url()
. Can have tokens corresponding to @PathParam
annotations.
Adds the first value as the Accept
header.
Adds the first value as the Content-Type
header.
Links the value of the corresponding parameter to a template variable declared in the path.
Links the value of the corresponding parameter to a query parameter. When invoked, null will skip the query param.
Links the value of the corresponding parameter to a header.
Links the value of the corresponding parameter to a key passed to Encoder.Text<Map<String, Object>>.encode()
.