为什么 JSONSerialization.jsonObject 转换不好?

问题描述 投票:0回答:0
 guard let jsonData = try? jsonEncoder.encode(userDTO),
          let dictionary = try? JSONSerialization.jsonObject(with: jsonData, options: []) as? [String: Any] else
    {
        return nil
    }
    let updatedDictionary = updateNode(node: dictionary, value: value, keyPath: keyPath, operation: operation)

我也尝试过

.mutableLeaves
,没有任何运气。

一些嵌套在结构深处的键值对没有转换,为什么?

swift codable
© www.soinside.com 2019 - 2024. All rights reserved.