cub*_*oft 1 java android json jackson resttemplate
我定义了以下类
@JsonTypeName("PhotoSetUpdater")
public class PhotoSetUpdater {
@JsonProperty("Title")
private String title;
@JsonProperty("Caption")
private String caption;
@JsonProperty("Keywords")
private String[] keywords;
@JsonProperty("Categories")
private int[] categories;
@JsonProperty("CustomReference")
private String customReference; // new in version 1.1
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
public String getCaption() {
return caption;
}
public void setCaption(String caption) {
this.caption = caption;
}
public String getCustomReference() {
return customReference;
}
public void setCustomReference(String customReference) {
this.customReference = customReference;
}
public void setKeywords(String[] keywords) {
this.keywords = keywords;
}
public String[] getKeywords() {
return keywords;
}
public void setCategories(int[] categories) {
this.categories = categories;
}
public int[] getCategories() {
return categories;
}
Run Code Online (Sandbox Code Playgroud)
}
问题是在我使用Jackson JSON序列化程序序列化此类之后,字段在结果有效负载中被插入两次:一个以较低的字母开头,一个以大写字母开头:
...... {"标题":"aa","标题":"aa",...}
类型定义可能有什么问题?
问候
| 归档时间: |
|
| 查看次数: |
1509 次 |
| 最近记录: |