Avatar
でもやっぱり↓は微妙じゃないですか? @swift-5.2.5 import Foundation struct Foo: Codable { let a = 5 } let json = """ {"a":2} """ let foo = try! JSONDecoder().decode(Foo.self, from: json.data(using: .utf8)!) print(String(data: try! JSONEncoder().encode(foo), encoding: .utf8)!) (edited)