Jackson - Java bean to JSON string : uppercase variable converted into lowercase in JSON

前端 未结 2 443
后悔当初
后悔当初 2021-01-03 13:44

I am converting Java bean to JSON string using writeValueAsString method of ObjectMapper where uppercase variables from Java bean is being changed to lowercase in JSON strin

2条回答
  •  悲&欢浪女
    2021-01-03 14:23

    Add Json Property with required keycase. Create variable with lowercase.

    public class BaseBean {
    
    @JsonProperty("XId")
    private int xId;
    ..
    }
    

    Hope this will help

提交回复
热议问题