title: How to map a JSON which contains a key whichs value is an array in Spring MVC via @RequestBody
body: <p>I try to map the following JSON to be received by my Spring MVC Controller:</p>
  
  <pre><code>{
   "name" : "toolOne",
   "parameters" : ["abc", "def"]
  }
  </code></pre>
  
  <p>The Class I want to map it to is the following:</p>
  
  <p><strong>Tool.java</strong></p>
  
  <pre><code>public class Tool {                                         
  
    private String name;                                      
    private List&lt;String&gt; parameters;     // not working                     
  
    public Tool(String name, List&lt;String&gt; parameters) {       
      this.name = name;                                       
      this.parameters = parameters;                           
    }                                                         
  }         
  </code></pre>
  
  <p>And this is the handler
  <strong>ToolExecutorController.java</strong></p>
  
  <pre><code>@RestController
  public class ToolExecutorController {
  
    @RequestMapping(value = "/toolbox/execute", method = POST,
            consumes = MediaType.APPLICATION_JSON_VALUE,
            produces = MediaType.TEXT_PLAIN_VALUE)
    public String handleExecutionRequest(@RequestBody Tool tool) {
      return "thanks";
    }
  }
  </code></pre>
  
  <p>Following Spring-Error log occurs:</p>
  
  <pre><code>2017-02-03 18:21:13.381  WARN 10940 --- [nio-8080-exec-1] .w.s.m.s.DefaultHandlerExceptionResolver : Failed to read HTTP message: org.springframework.http.converter.HttpMessageNotReadableException: Could not read document: Can not construct instance of com.abc.toolbox.components.rest.Tool: no String-argument constructor/factory method to deserialize from String value ('name')
   at [Source: java.io.PushbackInputStream@7e2445fa; line: 1, column: 1]; nested exception is com.fasterxml.jackson.databind.JsonMappingException: Can not construct instance of com.abc.toolbox.components.rest.Tool: no String-argument constructor/factory method to deserialize from String value ('name')
   at [Source: java.io.PushbackInputStream@7e2445fa; line: 1, column: 1]
  2017-02-03 18:21:13.381  WARN 10940 --- [nio-8080-exec-1] .w.s.m.s.DefaultHandlerExceptionResolver : Resolved exception caused by Handler execution: org.springframework.http.converter.HttpMessageNotReadableException: Could not read document: Can not construct instance of com.abc.toolbox.components.rest.Tool: no String-argument constructor/factory method to deserialize from String value ('name')
   at [Source: java.io.PushbackInputStream@7e2445fa; line: 1, column: 1]; nested exception is com.fasterxml.jackson.databind.JsonMappingException: Can not construct instance of com.abc.toolbox.components.rest.Tool: no String-argument constructor/factory method to deserialize from String value ('name')
   at [Source: java.io.PushbackInputStream@7e2445fa; line: 1, column: 1]
  2017-02-03 18:21:13.398  WARN 10940 --- [nio-8080-exec-1] .w.s.m.s.DefaultHandlerExceptionResolver : Resolved exception caused by Handler execution: org.springframework.web.HttpMediaTypeNotAcceptableException: Could not find acceptable representation   
  </code></pre>
  
  <p>I'd love to have the array of <em>parameters</em> mapped to my Java object. What am I missing here?</p>