title: Converting camelCase to underscore when deserializing an object using ObjectMapper
body: <p>I have a fixture file <code>person.json</code>,</p>
  
  <pre><code>{
     "fistName": "John"
     "lastName": "Smith"
  }
  </code></pre>
  
  <p>I have a class called Person</p>
  
  <pre><code>public class Person {
    private String firstName;
    private String lastName;
    //.. getters and setters
  }
  </code></pre>
  
  <p>I deserialize <code>Person</code> using <code>ObjectMapper</code> like below</p>
  
  <pre><code>ObjectMapper mapper = new ObjectMapper(); 
  Person person = mapper.readValue(new FileInputStream(new File("person.json")),Person.class);
  </code></pre>
  
  <p>I get this error,</p>
  
  <pre><code>    java.lang.RuntimeException: com.fasterxml.jackson.databind.exc.UnrecognizedPropertyException: 
  Unrecognized field "firstName" (class com.foo.Person), not marked as ignorable (2 known properties: , "first_name", "last_name"])
  </code></pre>
  
  <p>I get the same error when I use<br>
    <code>mapper.setPropertyNamingStrategy(PropertyNamingStrategy.CAMEL_CASE_TO_LOWER_CASE_WITH_UNDERSCORES);</code>. </p>
  
  <p>My question is Why do I get this error and how to resolve it?</p>