kakaopensource / KakaJSON

Fast conversion between JSON and model in Swift.
MIT License
1.16k stars 125 forks source link

数组嵌套数组的模型好像解析不了 #42

Closed baiyidjp closed 4 years ago

baiyidjp commented 4 years ago

比如这样的: [[SomeModel]] 就无法解析成功

CoderMJLee commented 4 years ago

目前没有去支持数组套数组,字典套数组倒是支持了:https://www.cnblogs.com/mjios/p/11352776.html#toc_title_14

解决方案:实现kj_didConvertToModel方法,在里面自定义解析逻辑即可哈

mutating func kj_didConvertToModel(from json: [String: Any]) {
    // 从服务器返回的json中取出相关数据,自行转换一下
}