I know, It doesn’t make sense. but I have no choice.
There are 2 problems
There are 2 problems
Code Block // problem1 let type = ReservedKeyword.`Type`(rawValue: 1) public class ReservedKeyword: Codable { public enum `Type`: Int, Codable { case zero = 0 case one = 1 case two = 2 case three = 3 } public var type: ReservedKeyword.`Type` public init(type: ReservedKeyword.`Type`) { self.type = type } private enum CodingKeys: String, CodingKey { case type } public required init(from decoder: Decoder) throws { let container = try decoder.container(keyedBy: CodingKeys.self) // problem2 self.type = try container.decode(ReservedKeyword.`Type`.self, forKey: .type) } public func encode(to encoder: Encoder) throws { var container = encoder.container(keyedBy: CodingKeys.self) try container.encode(self.type, forKey: .type) } }