struct MultiStatus: Codable {
let responses: [MultiStatusResponse]
enum CodingKeys: String, CodingKey {
case responses = "response"
}
}
struct MultiStatusResponse: Codable {
struct Property: Codable {
enum ResourceType: Codable {
case collection
case file
case redirect
}
let ressourceType: ResourceType
}
let href: String
let properties: [Property]
let error: String?
enum CodingKeys: String, CodingKey {
case href
case properties = "prop"
case error
}
}
-> This implementation does not work, because it is complaining about the ResourceType enum not conforming to Codable because of the missing method implementations of decode and encode.
part into an enum case based on the tag inside the <d:resourcetype> tag. So in this case I would like the ResourceType enum to be of case collection. Is that possible with your library or do I need to go one level deeper and parse the XML by myself ? I tried to write custom decode and encode methods but unfortunately didn't get it to work.
Hey, at first thanks a lot for making this library, great work!
I am rather new to the XML game and trying to decode WebDAV responses. So I have the following response from the server:
And the following
Codable
models:-> This implementation does not work, because it is complaining about the
ResourceType
enum not conforming toCodable
because of the missing method implementations ofdecode
andencode
.I am searching for a way to decode the
part into an enum case based on the tag inside the
<d:resourcetype>
tag. So in this case I would like theResourceType
enum to be of casecollection
. Is that possible with your library or do I need to go one level deeper and parse the XML by myself ? I tried to write customdecode
andencode
methods but unfortunately didn't get it to work.