Jackson renames primitive boolean field by removing 'is'

后端 未结 10 817
渐次进展
渐次进展 2020-11-27 12:07

This might be a duplicate. But I cannot find a solution to my Problem.

I have a class

public class MyResponse implements Serializable {

    private          


        
10条回答
  •  一向
    一向 (楼主)
    2020-11-27 12:54

    When you are using Kotlin and data classes:

    data class Dto(
        @get:JsonProperty("isSuccess") val isSuccess: Boolean
    )
    

    You might need to add @param:JsonProperty("isSuccess") if you are going to deserialize JSON as well.

提交回复
热议问题