title: Customize JSON response in Spring Boot to change key names
body: <p>I am working with a simple Spring Boot based RestController. I am returning JSON, but I am unable to control the name of the keys generated in the response. The POJO looks like this:</p>
  
  <pre><code>public class SomePojo {
     @JsonProperty("name")
     private String fullName;
     @JsonProperty("name")
     public String getFullName() {
       return fullName;
     }
     public void setFullName(String fullName) {
       this.fullName = fullName;
     }
  }
  </code></pre>
  
  <p>If I create a new instance as follows:</p>
  
  <pre><code>SomePojo sm = new SomePojo();
  sm.setFullName("John Doe");
  </code></pre>
  
  <p>and return the instance in the @ResponseBody. I expect to see</p>
  
  <pre><code>{ "name" : "John Doe" }
  </code></pre>
  
  <p>but I am seeing</p>
  
  <pre><code>{ "fullName" : "John Doe" }
  </code></pre>
  
  <p>I tried using the <code>@JsonProperty("name")</code> annotation on both the property as well as its getter, but it is not working. Spring Boot version is 1.4.2. Any suggestions as to what I am missing?</p>