title: Spring ignores custom ObjectMapper during data binding
body: <p>I am trying to enable Jackson's "fail on unknown properties" feature for all endpoints in my service. I've added <code>Jackson2ObjectMapperBuilder</code>: </p>
  
  <pre><code>@Configuration
  public class JacksonConfig{
      @Bean
      public Jackson2ObjectMapperBuilder objectMapperBuilder(){
          Jackson2ObjectMapperBuilder builder = new     Jackson2ObjectMapperBuilder();
          builder.failOnUnknownProperties(true);
          return builder;
      }
  }
  </code></pre>
  
  <p>When I use injected <code>ObjectMapper</code>, validation works as supposed, it throws <code>HttpMessageNotReadableException</code> while passing invalid json:</p>
  
  <pre><code>public class Person{
      @NotNull
      private String name; 
      @NotNull
      private String surname;
  
      /*getters and setters*/
  }
  
  @Autowired
  private ObjectMapper objectMapper;
  
  Person person = objectMapper.readValue("{ "\unknown\":\"field\", \"name\":\"John\", \"surname\":\"Smith\" }", Person.class);
  </code></pre>
  
  <p>However when i pass same json straight to controller validation does not occur and body of method is invoked: </p>
  
  <pre><code>@RequestMapping(value = "/something", method = RequestMethod.POST)
  public void something(@Valid @RequestBody Person person){...}
  </code></pre>
  
  <p>Firstly I thought that <code>MessageConverter</code> does not use custom <code>ObjectMapper</code> so I checked it: </p>
  
  <pre><code>@Autowired
  private MappingJackson2HttpMessageConverter converter;
  
  converter.getObjectMapper().getDeserializationConfig().hasDeserializationFeatures(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES.getMask())); 
  //returns true
  </code></pre>
  
  <p>It's even more weird because when i use repositories in other part of service validation works in POST method but does not work in PUT method.</p>
  
  <pre><code>@RepositoryRestResource(collectionResourceRel = "...", path = "...")
  public interface CarRepository extends CrudRepository&lt;Car, Long&gt; {
      @Override 
      @PreAuthorize("hasRole('ROLE_ADMIN') || hasPermission(#car, T(...).CREATE_OR_MODIFY")
      Car save(@Param("car") Car car);
  
      /*other methods*/
  }
  </code></pre>
  
  <p>Is there a simple way to force controllers and repositories to check if passed json does not contain unknown properties?</p>