Bal*_*hna 3 java android retrofit moshi
这是我所拥有的JSON的例子
filter : [
{ category: [] } ,
{ sub-category: [] } ,
{ brand: [] } ,
{ color: [] }
]
Run Code Online (Sandbox Code Playgroud)
请注意,标签"category,subcategory ..."可能会动态变化
如何使用Moshi解析此JSON?
Jes*_*son 13
将其解码为Map<String, Object>.地图键将是您的JSON值.您可以像这样获得该适配器:
Type map = Types.newParameterizedType(Map.class, String.class, Object.class);
JsonAdapter<Map<String, Object>> adapter = moshi.adapter(map);
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
1986 次 |
| 最近记录: |