【发布时间】:2018-03-15 11:55:40
【问题描述】:
我尝试使用Gson 将此json 转换为java 对象。如何转换字段“内容”?
有时是字符串,有时是具有两个字段的对象。
"content": "TODO List",
或
"content": {
"one": "one",
"other": "other"
}
【问题讨论】:
标签: java json object gson pojo
我尝试使用Gson 将此json 转换为java 对象。如何转换字段“内容”?
有时是字符串,有时是具有两个字段的对象。
"content": "TODO List",
或
"content": {
"one": "one",
"other": "other"
}
【问题讨论】:
标签: java json object gson pojo
回答以下问题,可能有助于解决您的问题。
How to handle different data types with same attribute name with Gson?
【讨论】: