contentful-management.java icon indicating copy to clipboard operation
contentful-management.java copied to clipboard

Inconsistent Rich Text Embedding Types Between Contentful Management API and Java SDK

Open amirhbakan opened this issue 7 months ago • 0 comments

Issue Description There's a critical inconsistency between how embedded entries/assets are represented in rich text when fetched directly through the Management API versus when retrieved using the Contentful Java SDK.

Current Behavior When fetching rich text containing embedded entries using the Management API, the data structure clearly identifies the embedding type:

{
    "data": {
        "target": {
            "sys": {
                "id": "[masked]",
                "type": "Link",
                "linkType": "Entry"
            }
        }
    },
    "content": [],
    "nodeType": "embedded-entry-inline"
}

However, when fetching the exact same content using the Java SDK, the embedding structure is different and lacks clarity on the embedding type:

{
    "content": [],
    "nodeType": "hyperlink",
    "data": {
        "sys": {
            "id": "[masked]",
            "linkType": "Entry",
            "type": "Link"
        }
    }
}

Expected Behavior The SDK should maintain the same structure and embedding type information as the Management API. In particular:

The nodeType should accurately reflect whether the embedded content is "embedded-entry-inline", "embedded-entry-block", or other appropriate rich text node types The structure of the embedding data should be consistent between API and SDK responses Impact This inconsistency makes it impossible to determine the correct rendering approach for embedded content. I cannot distinguish whether an entry should be rendered as an inline element or a block element based on the data provided by the SDK.

Additional Context This issue affects any application that relies on the Java SDK to render rich text fields with embedded entries or assets. The proper rendering of rich text content depends on accurately identifying the embedding type (inline vs. block vs. hyperlink).

Requested Solution Please update the Java SDK to preserve the accurate node types and structure for rich text fields containing embedded entries and assets, matching what's returned by the Management API.

amirhbakan avatar Jun 12 '25 15:06 amirhbakan