Skip to content
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

Array typemissmatch as Dictionary #286

Open
paulober opened this issue Jul 19, 2024 · 1 comment
Open

Array typemissmatch as Dictionary #286

paulober opened this issue Jul 19, 2024 · 1 comment

Comments

@paulober
Copy link

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

@paulober
Copy link
Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant