0

我想解析:

List<Resource> resources =
        Arrays.asList(JsonUtils.fromJson(json, new TypeReference<Resource[]>() {}));

并且在json一个字段中以大写字母开头: WebUrl而不是webUrl因此该字段为 NULL。

我怎样才能强制JsonUtils映射第一个大写字母的字段?当然在我的对象中我有WebUrl字段(第一个大写字母)

4

1 回答 1

0

好的,我需要添加@JsonProperty("WebUrl")

喜欢

@JsonProperty("WebUrl")
private String webUrl
于 2020-06-25T12:19:45.913 回答