title: Jackson with Feign can't deserialized Spring's org.springframework.data.domain.Sort
body: <p>The problem: A feign client, making an API call to a Spring boot Rest API that returns a <code>Page&lt;T&gt;</code> can't deserialize the <code>sort</code> property of that page.</p>
  <ul>
  <li>Spring Boot: 2.3.3.Release</li>
  <li>Spring Cloud Feign: 2.2.5.RELEASE</li>
  </ul>
  <blockquote>
  <p>com.fasterxml.jackson.databind.exc.InvalidDefinitionException: Cannot
  construct instance of <code>org.springframework.data.domain.Sort</code> (no
  Creators, like default constructor, exist): cannot deserialize from
  Object value (no delegate- or property-based Creator)  at [Source:
  (BufferedReader); line: 1, column: 238] (through reference chain:
  org.springframework.cloud.openfeign.support.PageJacksonModule$SimplePageImpl[&quot;sort&quot;])</p>
  </blockquote>
  <p>Not sure why the registered <code>PageJacksonModule</code> doesn't seem to support that.</p>
  <p>Given a manually configured Feign client:</p>
  <pre class="lang-java prettyprint-override"><code>public class TelematicsConfig {
  
    private String host;
  
    ObjectMapper provideObjectMapper() {
      return new ObjectMapper()
          .configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false)
          .setPropertyNamingStrategy(SnakeCaseStrategy.SNAKE_CASE)
          .registerModule(new PageJacksonModule());
    }
  
    @Bean
    TelematicsClient provideTelematicsClient() {
      return Feign.builder()
          .client(new OkHttpClient())
          .encoder(new JacksonEncoder(provideObjectMapper()))
          .decoder(new JacksonDecoder(provideObjectMapper()))
          .logger(new Slf4jLogger(TelematicsClient.class))
          .logLevel(Logger.Level.FULL)
          .target(TelematicsClient.class, host);
    }
  
  }
  </code></pre>
  <p>The client itself:</p>
  <pre class="lang-java prettyprint-override"><code>public interface TelematicsClient {
  
    @RequestLine(&quot;GET /api/v1/telematics/devices&quot;)
    Page&lt;TelematicsDevice&gt; getDevices();
  
  }
  </code></pre>
  <p>When invoking this I get:</p>
  <pre><code>2020-09-16 12:38:49.707 ERROR 96244 --- [nio-8080-exec-1] o.a.c.c.C.[.[.[/].[dispatcherServlet]    : Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed; nested exception is feign.FeignException: Cannot construct instance of `org.springframework.data.domain.Sort` (no Creators, like default constructor, exist): cannot deserialize from Object value (no delegate- or property-based Creator)
   at [Source: (BufferedReader); line: 1, column: 238] (through reference chain: org.springframework.cloud.openfeign.support.PageJacksonModule$SimplePageImpl[&quot;sort&quot;]) reading GET http://localhost:8081/api/v1/telematics/devices] with root cause
  
  com.fasterxml.jackson.databind.exc.InvalidDefinitionException: Cannot construct instance of `org.springframework.data.domain.Sort` (no Creators, like default constructor, exist): cannot deserialize from Object value (no delegate- or property-based Creator)
   at [Source: (BufferedReader); line: 1, column: 238] (through reference chain: org.springframework.cloud.openfeign.support.PageJacksonModule$SimplePageImpl[&quot;sort&quot;])
      at com.fasterxml.jackson.databind.exc.InvalidDefinitionException.from(InvalidDefinitionException.java:67)
      at com.fasterxml.jackson.databind.DeserializationContext.reportBadDefinition(DeserializationContext.java:1611)
      at com.fasterxml.jackson.databind.DatabindContext.reportBadDefinition(DatabindContext.java:400)
      at com.fasterxml.jackson.databind.DeserializationContext.handleMissingInstantiator(DeserializationContext.java:1077)
      at com.fasterxml.jackson.databind.deser.BeanDeserializerBase.deserializeFromObjectUsingNonDefault(BeanDeserializerBase.java:1320)
      at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserializeFromObject(BeanDeserializer.java:331)
      at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserialize(BeanDeserializer.java:164)
      at com.fasterxml.jackson.databind.deser.SettableBeanProperty.deserialize(SettableBeanProperty.java:542)
      at com.fasterxml.jackson.databind.deser.BeanDeserializer._deserializeWithErrorWrapping(BeanDeserializer.java:535)
      at com.fasterxml.jackson.databind.deser.BeanDeserializer._deserializeUsingPropertyBased(BeanDeserializer.java:419)
      at com.fasterxml.jackson.databind.deser.BeanDeserializerBase.deserializeFromObjectUsingNonDefault(BeanDeserializerBase.java:1310)
      at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserializeFromObject(BeanDeserializer.java:331)
      at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserialize(BeanDeserializer.java:164)
      at com.fasterxml.jackson.databind.ObjectMapper._readMapAndClose(ObjectMapper.java:4482)
      at com.fasterxml.jackson.databind.ObjectMapper.readValue(ObjectMapper.java:3463)
      at feign.jackson.JacksonDecoder.decode(JacksonDecoder.java:61)
  
  </code></pre>
  <p>Any insights into why this isn't working would be greatly appreciated.</p>
  <p>Edit: The following class seems to hint at support for sorting, no?</p>
  <p><a href="https://github.com/spring-cloud/spring-cloud-openfeign/blob/master/spring-cloud-openfeign-core/src/main/java/org/springframework/cloud/openfeign/support/PageJacksonModule.java#L69" rel="nofollow noreferrer">https://github.com/spring-cloud/spring-cloud-openfeign/blob/master/spring-cloud-openfeign-core/src/main/java/org/springframework/cloud/openfeign/support/PageJacksonModule.java#L69</a></p>