【发布时间】:2021-05-24 21:28:21
【问题描述】:
我正在使用 jsonschema2pojo,我的一些字段需要特殊的序列化/反序列化。如何在 json 架构中进行设置?
到目前为止,这是我的架构:
"collegeEducation": {
"javaJsonView": "com.trp.erd.common.util.Views.InvestmentProfessionalListView",
"type": "array",
"position": 37,
"items": {
"$ref": "#/definitions/CollegeEducation"
}
},
并且需要生成的属性看起来像这样:
@JsonProperty("collegeEducation")
@JsonView(Views.InvestProfessionalView.class)
@JsonSerialize(using = JsonListSerializer.class)
@JsonDeserialize(using = JsonListDeserializer.class)
@Valid
private List<CollegeEducation> collegeEducation = new ArrayList<CollegeEducation>();
【问题讨论】:
标签: java json jsonschema2pojo