json响应中的默认值(Rest API)

时间:2018-06-11 06:48:57

标签: rest web-services

我有一个模型类TEST

TEST {

 @Indexed
 @NotNull
 private String name;

/**
 * Test base release dep
 */
@Indexed
@NotNull
private String dep;

@NotNull
@Field("active")
@JsonProperty("active")
private boolean Active = true;
 // respective getter and setter methods are there 

}

问题是,响应永远不会显示默认值活动字段。 当active为true时,不显示在响应正文中 当活动为假时,它显示 我想在响应正文中始终显示默认值 指出我在这里缺少什么,或者我应该做些什么。

0 个答案:

没有答案
相关问题