Avatar
omochimetaru 6/5/2021 4:49 PM
たしかに!w
4:50 PM
@swift-main import Foundation enum E: Codable { case a(Int???) } let encoder = JSONEncoder() encoder.outputFormatting = .prettyPrinted let value: [E] = [ .a(.none), .a(.some(.none)), .a(.some(.some(.none))), .a(.some(.some(.some(1)))) ] let json = try encoder.encode(value) print(String(data: json, encoding: .utf8)!) (edited)