Skip to content

Cannot Decode "ResourceLink" Content Types in Swift SDK (Sync API Fails with dataCorrupted) #423

@mertvardar

Description

@mertvardar

When using the Swift SDK to perform a Sync API call, the response includes content types referencing "ResourceLink". On iOS, the SDK fails to decode these fields with a dataCorrupted error indicating it “Cannot initialize FieldType from invalid String value ResourceLink.”

This only occurs when using the iOS Swift SDK. The same token and sync configuration work without issue on Android. Also, I can fetch the content types via Postman successfully, suggesting the data from the Contentful API is valid, but the Swift SDK isn’t handling "ResourceLink" fields.

iOS Version: 18.3
Contentful Version: 5.5.13
Xcode Version: 16.2

[Contentful] Error: dataCorrupted(Swift.DecodingError.Context(codingPath: [ArrayCodingKeys(stringValue: "items", intValue: nil), _CodingKey(stringValue: "Index 2", intValue: 2), CodingKeys(stringValue: "fields", intValue: nil), _CodingKey(stringValue: "Index 1", intValue: 1), CodingKeys(stringValue: "type", intValue: nil)], debugDescription: "Cannot initialize FieldType from invalid String value ResourceLink", underlyingError: nil))

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions