@propertyWrapper struct Ignore { var wrappedValue: T } extension Ignore: Encodable where T: Encodable { } extension Ignore: Decodable where T: Decodable { } extension KeyedEncodingContainer { mutating func encode(_ value: Ignore, forKey key: KeyedEncodingContainer.Key) throws { } } extension KeyedDecodingContainer { func decode(_ type: Ignore.Type, forKey key: KeyedDecodingContainer.Key) throws -> Ignore { return try .init(wrappedValue: decodeIfPresent(T.self, forKey: key)) } }