今天在做Docker的管理工具时,遇到一个解析JSON串的问题,由于Docker返回的JSON属性的首字母都为大写,如下
[
{
"Created": 1422514187,
"Id": "2ef051877a7aeb4041c343b2f941a7628c5787fc1d4dbcdd3cf4af71cd28cab4",
"ParentId": "372c34633691fea23decca8f2c400877ad33b6ecddcd899a20b9cb9734f0265d",
"RepoTags": [
"zhangjy/starsms:v2"
],
"Size": 0,
"VirtualSize": 703334375
}
]
对象定义如下
package com.dms.domain;
import java.io.Serializable;
import java.util.List;
import com.fasterxml.jackson.annotation.JsonProperty;
public class Image implements Serializable {
private static final long serialVersionUID = -895599442916010326L;
private Long created;
private String id;
private String parentId;
private List<String> repoTags;
private Long size