Jackson serialization converts uppercase parameters to lowercase

SUPPORT_UNISETT is defined in my entity class, which becomes support_UNISETT after being serialized to jsonStr by Jackson

This is because Jackson makes the first letter lowercase by default

The solution is to annotate the defined fields and get set methods

E.g

  @JsonProperty
  private String SUPPORT_UNISETT;

 @JsonIgnore
  public String getSUPPORT_UNISETT(){
     return SUPPORT_UNISETT;
  }
  @JsonIgnore
  public void setSUPPORT_UNISETT(int SUPPORT_UNISETT) {
      this.SUPPORT_UNISETT = SUPPORT_UNISETT;
  }
  

Or annotate @JsonAutoDetect(JsonMethod.FIELD) on the entire entity class street


Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326448416&siteId=291194637