CoreOffice / XMLCoder

Easy XML parsing using Codable protocols in Swift

Home Page:https://coreoffice.github.io/XMLCoder/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Array typemissmatch as Dictionary

paulober opened this issue · comments

commented
public struct PageObject: Codable {
    @Element var pageContent: [PageContent]
    
    enum CodingKeys: String, CodingKey {
        case pageContent = "PageContent"
    }
}

produces following error:

typeMismatch(Swift.Dictionary<Swift.String, Any>, Swift.DecodingError.Context(codingPath: [CodingKeys(stringValue: "PageObject", intValue: nil), XMLKey(stringValue: "0", intValue: 0), XMLKey(stringValue: "0", intValue: 0)], debugDescription: "Expected to decode Dictionary<String, Any> but found ChoiceBox instead.", underlyingError: nil))

How??? What has [PageContent] todo with Dictionary??

commented

it can be resolved by removing @Element. Together with #284 and #285 it seems like there are some serious bugs in the property wrapper implementation, if i'm right.