enable feign.autoconfiguration.jackson.enabled by default (#476)
This commit is contained in:
@@ -783,13 +783,16 @@ ObjectProvider<TestFeignClient> testFeignClient;
|
||||
|
||||
=== Spring Data Support
|
||||
|
||||
You may consider enabling Jackson Modules for the support `org.springframework.data.domain.Page` and `org.springframework.data.domain.Sort` decoding.
|
||||
If Jackson Databind and Spring Data Commons are on the classpath, converters for `org.springframework.data.domain.Page` and `org.springframework.data.domain.Sort` will be added automatically.
|
||||
|
||||
To disable this behaviour set
|
||||
[source,java]
|
||||
----
|
||||
spring.cloud.openfeign.autoconfiguration.jackson.enabled=true
|
||||
spring.cloud.openfeign.autoconfiguration.jackson.enabled=false
|
||||
----
|
||||
|
||||
See `org.springframework.cloud.openfeign.FeignAutoConfiguration.FeignJacksonConfiguration` for details.
|
||||
|
||||
=== Spring `@RefreshScope` Support
|
||||
If Feign client refresh is enabled, each feign client is created with `feign.Request.Options` as a refresh-scoped bean. This means properties such as `connectTimeout` and `readTimeout` can be refreshed against any Feign client instance through `POST /actuator/refresh`.
|
||||
|
||||
|
||||
@@ -120,7 +120,8 @@ public class FeignAutoConfiguration {
|
||||
|
||||
@Configuration(proxyBeanMethods = false)
|
||||
@ConditionalOnClass({ Module.class, Page.class, Sort.class })
|
||||
@ConditionalOnProperty(value = "spring.cloud.openfeign.autoconfiguration.jackson.enabled", havingValue = "true")
|
||||
@ConditionalOnProperty(value = "spring.cloud.openfeign.autoconfiguration.jackson.enabled", havingValue = "true",
|
||||
matchIfMissing = true)
|
||||
protected static class FeignJacksonConfiguration {
|
||||
|
||||
@Bean
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
"name": "spring.cloud.openfeign.autoconfiguration.jackson.enabled",
|
||||
"type": "java.lang.Boolean",
|
||||
"description": "If true, PageJacksonModule and SortJacksonModule bean will be provided for Jackson page decoding.",
|
||||
"defaultValue": "false"
|
||||
"defaultValue": "true"
|
||||
},
|
||||
{
|
||||
"name": "spring.cloud.openfeign.circuitbreaker.enabled",
|
||||
|
||||
@@ -55,8 +55,7 @@ import static org.springframework.boot.test.context.SpringBootTest.WebEnvironmen
|
||||
* @author Hyeonmin Park
|
||||
*/
|
||||
@SpringBootTest(classes = FeignPageableEncodingTests.Application.class, webEnvironment = RANDOM_PORT,
|
||||
value = { "spring.cloud.openfeign.compression.request.enabled=true",
|
||||
"spring.cloud.openfeign.autoconfiguration.jackson.enabled=true" })
|
||||
value = { "spring.cloud.openfeign.compression.request.enabled=true" })
|
||||
class FeignPageableEncodingTests {
|
||||
|
||||
@Autowired
|
||||
|
||||
Reference in New Issue
Block a user