Skip to content

Array typemissmatch as Dictionary #286

@paulober

Description

@paulober
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??

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions