-
Notifications
You must be signed in to change notification settings - Fork 144
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
make YAMLDecoder compliant to TopLevelDecoder to be used with Combine.decode #261
Comments
Thanks for the suggestion! In the meantime, you should be able to add the conformance in your own code: extension YAMLDecoder: TopLevelDecoder {
public typealias Input = String
public func decode<T>(_ type: T.Type, from: String) throws -> T where T : Decodable {
try self.decode(type, from: from, userInfo: [:])
}
} |
Started a PR tracking the work left to do here: #262 |
suggested code seems halfway. If I do:
I can replace JSONDecoder() above with XMLCoder or CSVDecoder, but not yet YAMLDecoder (even with your suggestion). Some piece is missing. |
With my provided code, you need to give the decoder a |
thanks a bunch! will test it! |
would be cool to chain with Combine .decode(type: ..., decoder: YAMLDecoder()) but YAMLDecoder is not compliant with protocol TopLevelDecoder. XMLCoder does it and it is really useful
The text was updated successfully, but these errors were encountered: