我还想让这个键成为可选的。因此,如果JSON中缺少密钥,则应该将其解码为nil。不幸的是,添加属性包装器打破了这一点,而抛出了一个Swift.DecodingError.keyNotFound。@propertyWrapper var wrappedValue: Bool?container.decode(Bool.self) }
public struct MyType: <
它正常工作,但是对于内部对象为空的JSON,JSONDecoder抛出一个错误The data couldn’t be read because it is missing.错误时的示例JSON: "header": { "message": "Incorrect information." "message": "Nice informati
stringValue:"orders",intValue: nil),_JSONKey(stringValue:"Index 0",intValue: 0),debugDescription:“无与键CodingKeys相关的值”。:(编辑:删除Init) let orders_important : Int let order