Доброго времени суток, кто сможет подсказать, как распарсить такое?
Либо как можно привести вложенный json к нужно виду?
Вот проблема
https://bugs.swift.org/browse/SR-5552
https://developer.apple.com/forums/thread/83165
Возможно ли как-то решить не меняя ответ с сервера?
Не могу дословную строку кинуть, она тут отображается без слеша
import Foundation
let json = """
{
"customJson": "{\"toto\":{\"type\":\"String\",\"value\":\"toto\",\"id\":\"auQvn_2lj\"}}"
}
"""
let json = try ! JSONSerialization.jsonObject(with: json.data(using: .utf8)!, options: [])
print("json: ", json)
Fatal error: ‘try!’ expression unexpectedly raised an error: Error Domain=NSCocoaErrorDomain Code=3840 “Badly formed object around character 23.” UserInfo={NSDebugDescription=Badly formed object around character 23.}: file __lldb_expr_75/test.playground, line 9