title: Spring WebClient PageImpl Content is missing field
body: <p>I try to retrieve a page via WebClient from another microservice.If I request thhis MS directly with Postman, I get &quot;type&quot; among other things for <code>content</code> inside the page. However, if I request the MS via <code>webClient</code>, &quot;type&quot; disappears from the <code>content</code> (and some other fields too). The content is a list of abstract class <code>account</code> with 'type' as <strong>JsonSubTypes</strong>.
  <br />
  Can someone find the mistake, why the &quot;type&quot;-attrib. disappears?</p>
  <p><strong>Responses</strong></p>
  <p><em>Response from <code>http://localhost:8080/api/v1/accounts</code></em></p>
  <pre><code>{
      &quot;content&quot;: [
          {
              &quot;type&quot;: &quot;savingsBook&quot;,
              &quot;id&quot;: 108,
              &quot;accountNumber&quot;: 99781944,
              ...
          }
      ], &quot;pageable&quot;: {
          ...
      }, &quot;totalPages&quot;: ...
      ...
  }
      
  </code></pre>
  <p><em>Response from <code>http://localhost:8081/accounts</code></em></p>
  <pre><code>{
      &quot;content&quot;: [
          {
              &quot;id&quot;: 108,
              &quot;accountNumber&quot;: 99781944,
              ...
          }
      ], &quot;pageable&quot;: {
          ...
      }, &quot;totalPages&quot;: ...
      ...
  }
  </code></pre>
  <p><strong>Code-Snippets:</strong></p>
  <p><em>8080's account controller</em></p>
  <pre><code>@RequestMapping(method = RequestMethod.GET, produces = &quot;application/json&quot;)
  public &lt;T extends Account&gt; Page&lt;T&gt; getAccounts(@RequestParam(value = &quot;page&quot;, required = false) Integer page, @RequestParam(value = &quot;pageSize&quot;, required = false) Integer pageSize, @RequestParam(value = &quot;sortBy&quot;, required = false) String sortBy) {
      if (page == null) {
          page = 0;
      }
      if (pageSize == null) {
          pageSize = 10;
      }
      if (sortBy == null) {
          Page&lt;T&gt; p = accountService.getAccounts(page, pageSize);
          return new PageImpl&lt;T&gt;(p.getContent(), p.getPageable(), p.getTotalElements()) {};
  
      } else {
          Sort sort = Sort.by(sortBy);
          Page&lt;T&gt; p = accountService.getAccounts(page, pageSize, sort);
          return new PageImpl&lt;T&gt;(p.getContent(), p.getPageable(), p.getTotalElements()) {};
      }
  }
  </code></pre>
  <p><em>8081 Account Controler</em></p>
  <pre><code>@GetMapping
  public  &lt;T extends Account&gt; Page&lt;T&gt; getAllAccounts(@RequestParam(value = &quot;page&quot;, required = false) Integer page, 
                                                     @RequestParam(value = &quot;pageSize&quot;, required = false) Integer pageSize,
                                                     @RequestParam(value = &quot;sortBy&quot;, required = false) String sortBy) {   
       if (page == null) {
           page = 0;
       }
       if (pageSize == null) {
           pageSize = 10;
       }
       if (sortBy == null) {
           return accountService.getAllAccounts(page, pageSize);
       } else {
           return accountService.getAllAccounts(page, pageSize, sortBy);
       }
  }
  </code></pre>
  <p><em>8081 AccountService</em></p>
  <pre><code>public &lt;T extends Account&gt; Page&lt;T&gt; getAllAccounts(Integer pageNumber, Integer pageSize) {
      ParameterizedTypeReference&lt;CustomPageImpl&lt;T&gt;&gt; typeReference = new ParameterizedTypeReference&lt;CustomPageImpl&lt;T&gt;&gt;(){};
      System.out.println(&quot;Anfrage an: &quot; + addr + &quot;/accounts/&quot;);
      System.out.println(client.get().uri(&quot;/accounts/&quot;).retrieve().bodyToMono(typeReference).block().getContent());
      Page&lt;T&gt; prodData = (CustomPageImpl&lt;T&gt;)(client.get().uri(&quot;/accounts/&quot;).retrieve().bodyToMono(typeReference).block());
      return prodData;
  }
  </code></pre>
  <p><em>CustomPageImpl (got it from another StackOverflow-Post)</em></p>
  <pre><code>public class CustomPageImpl&lt;T&gt; extends PageImpl&lt;T&gt; {
      private static final long serialVersionUID = 1L;
  
      @JsonCreator(mode = JsonCreator.Mode.PROPERTIES)
      public CustomPageImpl(@JsonProperty(&quot;content&quot;) List&lt;T&gt; content,
              @JsonProperty(&quot;number&quot;) int number,
              @JsonProperty(&quot;size&quot;) int size,
              @JsonProperty(&quot;totalElements&quot;) Long totalElements,
              @JsonProperty(&quot;pageable&quot;) JsonNode pageable,
              @JsonProperty(&quot;last&quot;) boolean last,
              @JsonProperty(&quot;totalPages&quot;) int totalPages,
              @JsonProperty(&quot;sort&quot;) JsonNode sort,
              @JsonProperty(&quot;first&quot;) boolean first,
              @JsonProperty(&quot;numberOfElements&quot;) int numberOfElements){
          super(content, PageRequest.of(number, size) , totalElements);
      }
      public CustomPageImpl(List&lt;T&gt; content, Pageable pageable, long total) {
          super(content, pageable, total);
      }
  
      public CustomPageImpl(List&lt;T&gt; content) {
          super(content);
      }
  
      public CustomPageImpl() {
          super(new ArrayList&lt;&gt;());
      }
  }
      
  </code></pre>