title: Using different jackson ObjectMappers for seperate RequestMapping
body: <p>I have a single <code>@RequestMapping</code> that consumes a custom MIME type. The request uses an <code>ObjectMapper</code> bean defined in the <code>@Configuration</code> to enabled the <code>JsonParser.Feature.ALLOW_BACKSLASH_ESCAPING_ANY_CHARACTER</code>.</p>
  
  <p>This feature allows typically invalid json (treating backslashes as a non-special character) to be consumed, which is a requirement of this particular <code>@RequestMapping</code> to allow google encoded polylines to be parsed directly. However this means that this ObjectMapper is now being used for <em>ALL</em> of my <code>@RequestMapping</code> when it is really only a requirement for one.</p>
  
  <p>Is there a way to differentiate the ObjectMapper being used for each <code>@Controller</code> or <code>@RequestMapping</code>?</p>
  
  <p><strong>Object Mapper Bean</strong></p>
  
  <pre><code>@Bean
  public ObjectMapper objectMapper() {
      Jackson2ObjectMapperBuilder builder = new Jackson2ObjectMapperBuilder();
      builder.featuresToEnable(
        JsonParser.Feature.ALLOW_BACKSLASH_ESCAPING_ANY_CHARACTER);
  
      return builder.build();
  }
  </code></pre>
  
  <p><strong>Request Mapping Interface Method</strong></p>
  
  <pre><code>@ApiOperation(value = "Returns the toll cost breakdown for a journey", notes = "", response = TotalCost.class, tags={ "pricing", })
  @ApiResponses(value = { 
      @ApiResponse(code = 200, message = "successful operation", response = TotalCost.class) })
  @RequestMapping(value = "/pricing/journeyCost",
      produces = { "application/json" }, 
      consumes = { "application/vnd.toll-pricing+json" },
      method = RequestMethod.POST)
  ResponseEntity&lt;TotalCost&gt; getTollBreakdownFromEncodedPoly(@ApiParam(value = "Request object representing the journey" ,required=true ) @RequestBody Journey body);
  </code></pre>