Avatar
@swift-5.6.3 import Foundation enum Key: String, Codable { case a } let data1 = try JSONEncoder().encode([Key.a : 0]) print(String(data: data1, encoding: .utf8)!) let data2 = try JSONEncoder().encode([Key.a.rawValue : 0]) print(String(data: data2, encoding: .utf8)!)