title: com.fasterxml.jackson.databind.exc.MismatchedInputException: Cannot deserialize value of type `com.company.FruitsList' from Array value (token'JsonTok
body: <p>I just started coding in java, so this question might sound stupid.</p>
  <p><strong>Goal:</strong>
  I am trying to build a Quarkus Rest application which has a POST method using Apache Camel routes. The goal is to take an array of fruits as input and add additional information and return it back to the calling application</p>
  <p><em>Input which is being passed to Quarkus Application http://localhost:8080/simple through POSTMAN</em></p>
  <pre><code>[{
      &quot;id&quot;: 1,
      &quot;name&quot;: &quot;one&quot;
  },{
      &quot;id&quot;: 2,
      &quot;name&quot;: &quot;second&quot;
  }]
  </code></pre>
  <p><strong>Issue:</strong>
  Whenever i try to call the REST endpoint through a HTTP client (POSTMAN), I am getting an error. Stack trace below</p>
  <p>Can someone please help me identify what am i doing wrong ?</p>
  <pre><code>{
    &quot;details&quot;: &quot;Error id 0fd95541-edf3-443a-9e56-261400017f01-15, com.fasterxml.jackson.databind.exc.MismatchedInputException: Cannot deserialize value of type `com.company.FruitsList` from Array value (token `JsonToken.START_ARRAY`)&quot;,
    &quot;stack&quot;: &quot;com.fasterxml.jackson.databind.exc.MismatchedInputException: Cannot deserialize value of type `com.company.FruitsList` from Array value (token `JsonToken.START_ARRAY`)\n at [Source: (ByteArrayInputStream); line: 1, column: 1]\r\n\tat com.fasterxml.jackson.databind.exc.MismatchedInputException.from(MismatchedInputException.java:59)\r\n\tat com.fasterxml.jackson.databind.DeserializationContext.reportInputMismatch(DeserializationContext.java:1741)\r\n\tat com.fasterxml.jackson.databind.DeserializationContext.handleUnexpectedToken(DeserializationContext.java:1515)\r\n\tat com.fasterxml.jackson.databind.DeserializationContext.handleUnexpectedToken(DeserializationContext.java:1462)\r\n\tat com.fasterxml.jackson.databind.deser.BeanDeserializer._deserializeFromArray(BeanDeserializer.java:638)\r\n\tat com.fasterxml.jackson.databind.deser.BeanDeserializer._deserializeOther(BeanDeserializer.java:210)\r\n\tat com.fasterxml.jackson.databind.deser.BeanDeserializer.deserialize(BeanDeserializer.java:186)\r\n\tat com.fasterxml.jackson.databind.deser.DefaultDeserializationContext.readRootValue(DefaultDeserializationContext.java:322)\r\n\tat com.fasterxml.jackson.databind.ObjectReader._bindAndClose(ObjectReader.java:2051)\r\n\tat com.fasterxml.jackson.databind.ObjectReader.readValue(ObjectReader.java:1427)\r\n\tat com.fasterxml.jackson.databind.ObjectReader.readValue(ObjectReader.java:1442)\r\n\tat org.apache.camel.component.jackson.AbstractJacksonDataFormat.unmarshal(AbstractJacksonDataFormat.java:188)\r\n\tat org.apache.camel.support.processor.UnmarshalProcessor.process(UnmarshalProcessor.java:64)\r\n\tat org.apache.camel.impl.engine.DefaultAsyncProcessorAwaitManager.process(DefaultAsyncProcessorAwaitManager.java:83)\r\n\tat org.apache.camel.support.AsyncProcessorSupport.process(AsyncProcessorSupport.java:41)\r\n\tat org.apache.camel.processor.RestBindingAdvice.unmarshal(RestBindingAdvice.java:307)\r\n\tat org.apache.camel.processor.RestBindingAdvice.before(RestBindingAdvice.java:142)\r\n\tat org.apache.camel.processor.RestBindingAdvice.before(RestBindingAdvice.java:51)\r\n\tat org.apache.camel.impl.engine.CamelInternalProcessor.process(CamelInternalProcessor.java:341)\r\n\tat org.apache.camel.component.platform.http.vertx.VertxPlatformHttpConsumer.lambda$handleRequest$2(VertxPlatformHttpConsumer.java:185)\r\n\tat io.vertx.core.impl.ContextImpl.lambda$null$0(ContextImpl.java:159)\r\n\tat io.vertx.core.impl.AbstractContext.dispatch(AbstractContext.java:100)\r\n\tat io.vertx.core.impl.ContextImpl.lambda$executeBlocking$1(ContextImpl.java:157)\r\n\tat org.jboss.threads.ContextHandler$1.runWith(ContextHandler.java:18)\r\n\tat org.jboss.threads.EnhancedQueueExecutor$Task.run(EnhancedQueueExecutor.java:2449)\r\n\tat org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1478)\r\n\tat org.jboss.threads.DelegatingRunnable.run(DelegatingRunnable.java:29)\r\n\tat org.jboss.threads.ThreadLocalResettingRunnable.run(ThreadLocalResettingRunnable.java:29)\r\n\tat io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)\r\n\tat java.base/java.lang.Thread.run(Thread.java:830)&quot;
  
  
  
  </code></pre>
  <p>Here is my Route code:</p>
  <pre><code>package com.company;
  
  import org.apache.camel.LoggingLevel;
  import org.apache.camel.builder.RouteBuilder;
  import org.apache.camel.model.rest.RestBindingMode;
  import org.apache.camel.Exchange;
  import org.apache.camel.Processor;
  import org.slf4j.Logger;
  import org.slf4j.LoggerFactory;
  
  import javax.enterprise.context.ApplicationScoped;
  import javax.ws.rs.core.MediaType;
  import javax.ws.rs.core.Response;
  import java.util.List;
  
  @ApplicationScoped
  public class RouteBuild extends RouteBuilder {
  
    Logger logger = LoggerFactory.getLogger(RouteBuild.class);
  
    @Override
    public void configure() throws Exception {
  
      restConfiguration().component(&quot;platform-http&quot;).bindingMode(RestBindingMode.auto);
  
      rest(&quot;/simple&quot;)
        .post()
        .type(FruitsList.class)
        .outType(AddressRequest.class)
        .route()
        .routeId(&quot;New Route&quot;)
        .log(LoggingLevel.INFO, &quot;Passing input data to Direct Component for further actions&quot;)
        .to(&quot;direct:directDataEntry&quot;);
  
      from(&quot;direct:directDataEntry&quot;)
        .unmarshal().json()
        .log(LoggingLevel.INFO, &quot;Inside the route to validate the data structure of the input&quot;)
        .log(LoggingLevel.INFO, &quot;data of input is ${body}&quot;)
        .to(&quot;direct:directDataEntry1&quot;);
  
      from(&quot;direct:directDataEntry1&quot;)
        .routeId(&quot;validateData&quot;)
        //.log(LoggingLevel.INFO,&quot;Passing input data to validate in route \&quot;validationData\&quot;&quot;)
        .process(new Processor() {
          @Override
          public void process(Exchange exchange) throws Exception {
  
            AddressRequest addressRequest = new AddressRequest();
            addressRequest.setCity(&quot;Atlanta&quot;);
            addressRequest.setInput_id(&quot;1&quot;);
            addressRequest.setState(&quot;GA&quot;);
            addressRequest.setStreet(exchange.getIn().getBody(FruitsList.class).getFruitsList().get(0).getName());
            exchange.getIn().setBody(addressRequest);
     }
        });
  
    }
  }
  </code></pre>
  <p>Below are the FruitsList, Fruits and AddressRequest Class code (POJO)</p>
  <p>Fruits.class</p>
  <pre><code>package com.company;
  
  public class Fruits {
  
    public Fruits() {}
    private int id;
    private String name;
  
    public int getId() {
      return id;
    }
  
    public void setId(int id) {
      this.id = id;
    }
  
    public String getName() {
      return name;
    }
  
    public void setName(String name) {
      this.name = name;
    }
  }
  </code></pre>
  <p>FruitsList.class</p>
  <pre><code>package com.company;
  
  import java.util.List;
  
  public class FruitsList {
  
      private List&lt;Fruits&gt; fruitsList;
      public FruitsList(){
      }
      public List&lt;Fruits&gt; getFruitsList() {
          return fruitsList;
      }
      public void setFruitsList(List&lt;Fruits&gt; fruitsList) {
          this.fruitsList = fruitsList;
      }
  }
  </code></pre>