pvieito
(Pedro José Pereira Vieito)
1
Are there any implementations of Encoder/Decoders for the Codable protocol besides the JSON and PropertyList one available in Foundation? It would be great to have YAML and XML decoders available.
Also, it seems that the Foundation PropertyList decoder/encoder is not available in Linux yet.
felix91gr
(Félix Fischer)
2
You sure? The serializer (PropertyListSerialization) seems to be complete. Take a look there, maybe we can learn what’s implemented or not for your use case.
pvieito
(Pedro José Pereira Vieito)
4
Yes, PropertyListDecoderand PropertyListEncode are not available in Swift Foundation only in the Darwin Foundation overlays (I don't know why).
The Darwin implementation of PropertyListEncoder is open source at https://github.com/apple/swift/blob/master/stdlib/public/SDK/Foundation/PlistEncoder.swift so bringing it to Linux would be a matter of copying that code to swift-corelibs-foundation, fixing any corner cases / breakage, then keeping it up to date.
2 Likes
pvieito
(Pedro José Pereira Vieito)
6
Oh, thank you! I used it a while ago and now seems to support Codable 