title: How to deserialize nested JSON array to Flux with Spring WebClient?
body: <p>I'm using <code>org.springframework.web.reactive.function.client.WebClient</code> in a Spring Boot (2.0.0.M1) application to query a REST interface that returns a nested array:</p>
  
  <pre><code>[
      [ "name1", 2331.0, 2323.3 ],
      [ "name2", 2833.3, 3838.2 ]
  ]
  </code></pre>
  
  <p>I'm now trying to map this response to a <code>Flux</code> of objects. To do that I did the following call:</p>
  
  <pre><code>WebClient webClient = WebClient.create("http://example.org");
  
  Flux&lt;Result&gt; results = webClient.get().uri("/query").
      accept(MediaType.APPLICATION_JSON_UTF8).
      exchange().
      flatMapMany(response -&gt; response.bodyToFlux(Result.class));
  </code></pre>
  
  <p>The Result class looks something like this:</p>
  
  <pre><code>import com.fasterxml.jackson.annotation.JsonCreator;
  import com.fasterxml.jackson.annotation.JsonFormat;
  import com.fasterxml.jackson.annotation.JsonProperty;
  import lombok.Data;
  
  import java.math.BigDecimal;
  
  @Data
  @JsonFormat(shape = JsonFormat.Shape.ARRAY)
  public class Result {
  
      private final String name;
      private final BigDecimal value1;
      private final BigDecimal value2;
  
      @JsonCreator
      public Result(
          @JsonProperty String name,
          @JsonProperty BigDecimal value1,
          @JsonProperty BigDecimal value2) {
          this.name = name;
          this.value1 = value1;
          this.value2 = value2;
      }
  }
  </code></pre>
  
  <p>Unfortunately I get the following error:</p>
  
  <pre><code>org.springframework.web.reactive.function.UnsupportedMediaTypeException: Content type 'application/json;charset=utf-8' not supported
  </code></pre>
  
  <p>Can anybody tell me what I'm doing wrong or tell me a better way to deserialize this kind of response into a Flux, preferably in a nonblocking way?</p>