Fixes#845
This change allows Feign Exceptions to be created with the original request as an optional parameter.
Changes include:
* Request field added to FeignException
* New constructors are defended from null in request argument
* Tests to check null instead of request, null message updated
* Refactoring RequestTemplate to RFC6570
This change refactors `RequestTemplate` in an attempt to
adhere to the [RFC-6570 - URI Template](https://tools.ietf.org/html/rfc6570)
specification more closely. The reason for this is to
reduce the amount of inconsistency between `@Param`, `@QueryMap`,
`@Header`, `@HeaderMap`, and `@Body` template expansion.
First, `RequestTemplate` now delegates uri, header, query, and
body template parsing to `UriTemplate`, `HeaderTemplate`,
`QueryTemplate`, and `BodyTemplate` respectively. These components
are all variations on a `Template`.
`UriTemplate` adheres to RFC 6570 explicitly and supports Level 1
(Simple String) variable expansion. Unresolved variables are ignored
and removed from the uri. This includes query parameter pairs. All
literal and expanded variables are pct-encoded according to the Charset
provided in the `RequestTemplate`.
`HeaderTemplate` supports Level 1 (Simple String) variable expansion.
Unresolved variables are ignored. Empty headers are removed. No
encoding is performed.
`QueryTemplate` is a subset of a `UriTemplate` and reacts in the same
way. Unresolved pairs are ignored and not present on the final
template. All literals and expanded variables are pct-encoded
according to the Charset provided.
`BodyTemplate` supports Level 1 (Simple String) variable expansion.
Unresolved variables produce empty strings. Values are not encoded.
All remaining customizations, including custom encoders, collection format
expansion and charset encoding are still supportted and made backward
compatible.
Finally, a number of inconsistent methods on `RequestTemplate` have
been deprecated for public use and all deprecated usage throughout
the library has been replaced.
Closes#719
This change adds the original Request Method to `RetryableException`,
allowing implementers to determine if a retry should occur based on
method and exception type.
To support this, `Response` objects now require that the original
`Request` be present. Test Cases, benchmarks, and documentation have
been added.
* Refactored Request Method Attribute on Requests
* Added `HttpMethod` enum that represents the supported HTTP methods
replacing String handling.
* Deprecated `Request#method()` in favor of `Request#httpMethod()`
* Support of Java 8 Stream Decoder and Jackson Iterator Decoder
Signed-off-by: phymbert <pierrick.hymbert@gmail.com>
* Removed class javadoc to make license plugin happy
Signed-off-by: phymbert <pierrick.hymbert@gmail.com>
* Fixed build failed cause of license missing
Signed-off-by: phymbert <pierrick.hymbert@gmail.com>
* - smaller highlighted changelog
- make decoder type implementation final
- change inner types and constructors visibility to package private
- fix non static inner class
- remove useless Factory inner class
- unit test JacksonIterator
Signed-off-by: phymbert <pierrick.hymbert@gmail.com>
* - Revert deleted groupId tag in benchmark
- Fix code style on StreamDecoder
- Add unit test to verify iterator is closed if stream is closed
- Remove any characteristics to the returned stream
Signed-off-by: phymbert <pierrick.hymbert@gmail.com>
* Benchmark:
- updated with latest factory methods
- do not duplicate groupId
Signed-off-by: phymbert <pierrick.hymbert@gmail.com>