title: Eliminate duplicate Json elements and retrieve element names starting with capital letters spring boot/java
body: <p>I'm developing a Rest Client using Spring Boot and Spring Framework (spring-boot-starter-parent 2.1.6.RELEASE) 
  I have a class representing a response object as shown below: </p>
  
  <pre><code>public class ValidateResponse {
      private String ResponseCode;
      private String ResponseDesc;
  
      //getters and setters
      //constructors using fields
      //empty constructor
  }
  </code></pre>
  
  <p>I'm creating a web-hook for an external api and I need to return a JSON object to for a specific endpoint (the JSON object properties must start with uppercase(s)). I'm calling returning the object from a <code>PostMapping</code> method nested in a <code>RequestMapping</code> root path:</p>
  
  <pre><code>@PostMapping("hooks/validate")
  public ValidateResponse responseObj(@RequestHeader Map&lt;String, String&gt; headersObj) {
      ValidateResponse response = new ValidateResponse("000000", "Success");
  
      logger.info("Endpoint = hooks/validate | Request Headers = {}", headersObj);
  
      return response;
  
  } 
  </code></pre>
  
  <p>However, when I hit the endpoint from postman I'm getting duplicate varialbes</p>
  
  <pre><code>{
      "ResponseCode": "000000",
      "ResponseDesc": "Success",
      "responseCode": "000000",
      "responseDesc": "Success"
  }
  </code></pre>
  
  <p>I understand that the pojo-json conversion is handled by spring but I don't understand why the conversion is yielding duplicate variables.</p>
  
  <p><strong>Note:</strong> I know the <code>ResponseDesc</code> and the <code>ResponseCode</code> are not declared using the best standards for naming variables (camelCasing). </p>
  
  <p>I've done some digging and according to the <a href="http://docs.oracle.com/javase/specs/jls/se7/html/jls-3.html#jls-3.8" rel="nofollow noreferrer"> Java Language Specification</a> </p>
  
  <blockquote>
    <p>An identifier is an unlimited-length sequence of Java letters and Java digits, the first of which must be a Java letter.</p>
  </blockquote>
  
  <p>and </p>
  
  <blockquote>
    <p>The "Java letters" include uppercase and lowercase ASCII Latin letters A-Z (\u0041-\u005a), and a-z (\u0061-\u007a), and, for historical reasons, the ASCII underscore (_, or \u005f) and dollar sign ($, or \u0024). The $ character should be used only in mechanically generated source code or, rarely, to access pre-existing names on legacy systems.</p>
  </blockquote>
  
  <p>So, I'm assuming its syntactically correct to define a variable using the <code>Camelcase</code> format [Need clarification on this]. </p>
  
  <p>I'm considering having to create the JSON object manually but I'd like to know the cause of this behaviour first. Any pointers are appreciated.</p>