title: Spring adding extra keys when returning java obect in API response
body: <p>I am facing an issue where Spring adds extra keys to my response object. I have attached the response below (Response-2).</p>
  <p>I also tried removing @JsonProperty but that also doesnt work because all keys are lowercase.</p>
  <p>WANTED RESULT: I want that all my keys should be uppercase as I have declared them in POJO class. I will be sending the JSON via Kafka.</p>
  <p>WITHOUT @JsonProperty:</p>
  <pre><code>{
      &quot;watchlsttype&quot;: null,
      &quot;acctno&quot;: null,
      &quot;chg_TYPE&quot;: null,
      &quot;status&quot;: null,
      &quot;rec_TYPE&quot;: null,
      &quot;lstchgtimestamp&quot;: null,
      &quot;expirytimestamp&quot;: null
  }
  </code></pre>
  <p>API:</p>
  <pre><code>@GetMapping(value = &quot;/dummyAPI&quot;)
      public Object dummyAPI() throws Exception {
          return new InteracAccountAllowList();
      }
  </code></pre>
  <p>RESPONSE -2:</p>
  <pre><code>{
      &quot;ACCTNO&quot;: null,
      &quot;EXPIRYTIMESTAMP&quot;: null,
      &quot;LSTCHGTIMESTAMP&quot;: null,
      &quot;WATCHLSTTYPE&quot;: null,
      &quot;STATUS&quot;: null,
      &quot;CHG_TYPE&quot;: null,
      &quot;REC_TYPE&quot;: null,
      &quot;lstchgtimestamp&quot;: null,
      &quot;expirytimestamp&quot;: null,
      &quot;status&quot;: null,
      &quot;rec_TYPE&quot;: null,
      &quot;watchlsttype&quot;: null,
      &quot;chg_TYPE&quot;: null,
      &quot;acctno&quot;: null
  }
  </code></pre>
  <p>CLASS:</p>
  <pre><code>import com.fasterxml.jackson.annotation.JsonProperty;
      
      public class InteracAccountAllowList {
      
          @JsonProperty
          private String ACCTNO;
      
          @JsonProperty
          private String EXPIRYTIMESTAMP;
      
          @JsonProperty
          private String LSTCHGTIMESTAMP;
      
          @JsonProperty
          private String WATCHLSTTYPE;
      
          @JsonProperty
          private String STATUS;
      
          @JsonProperty
          private String CHG_TYPE;
      
          @JsonProperty
          private String REC_TYPE;
      
          public String getACCTNO() {
              return ACCTNO;
          }
      
          public void setACCTNO(String aCCTNO) {
              ACCTNO = aCCTNO;
          }
      
          public String getEXPIRYTIMESTAMP() {
              return EXPIRYTIMESTAMP;
          }
      
          public void setEXPIRYTIMESTAMP(String eXPIRYTIMESTAMP) {
              EXPIRYTIMESTAMP = eXPIRYTIMESTAMP;
          }
      
          public String getLSTCHGTIMESTAMP() {
              return LSTCHGTIMESTAMP;
          }
      
          public void setLSTCHGTIMESTAMP(String lSTCHGTIMESTAMP) {
              LSTCHGTIMESTAMP = lSTCHGTIMESTAMP;
          }
      
          public String getWATCHLSTTYPE() {
              return WATCHLSTTYPE;
          }
      
          public void setWATCHLSTTYPE(String wATCHLSTTYPE) {
              WATCHLSTTYPE = wATCHLSTTYPE;
          }
      
          public String getSTATUS() {
              return STATUS;
          }
      
          public void setSTATUS(String sTATUS) {
              STATUS = sTATUS;
          }
      
          public String getCHG_TYPE() {
              return CHG_TYPE;
          }
      
          public void setCHG_TYPE(String cHG_TYPE) {
              CHG_TYPE = cHG_TYPE;
          }
      
          public String getREC_TYPE() {
              return REC_TYPE;
          }
      
          public void setREC_TYPE(String rEC_TYPE) {
              REC_TYPE = rEC_TYPE;
          }
      
      }
  </code></pre>