title: How should I set a Feature on a Spring Message Converter's Object Mapper?
body: <p>I'm using a 3rd party REST API which is returning 'NaN' in it's JSON response :( I can't change the response.</p>
  
  <p>I'm using Spring MVC with RestTemplate and the built in Message Converters to deserialize the JSON to an Object.</p>
  
  <p>I was wondering, if there is a smart way of setting the <code>JsonParser.Feature.ALLOW_NON_NUMERIC_NUMBERS</code> property to allow for the NaN in the response.</p>
  
  <p>Because I have other message converters which I do not need to configure myself I'm currently doing the following:</p>
  
  <pre><code>List&lt;HttpMessageConverter&lt;?&gt;&gt; converters = restTemplate.getMessageConverters();
  for (HttpMessageConverter converter : converters) {
      if (converter instanceof MappingJacksonHttpMessageConverter) {
          ObjectMapper objectMapper = ((MappingJacksonHttpMessageConverter) converter).getObjectMapper();
          objectMapper.configure(JsonParser.Feature.ALLOW_NON_NUMERIC_NUMBERS, true);
      }
  }
  </code></pre>
  
  <p>This works but I don't like the fact that I'm a) iterating and b) doing the instanceof comparison just to set this property.</p>
  
  <p>What would be a smarter/nicer way to do this?</p>