contentful / contentful.net

.NET Library for Contentful's Content Delivery and Management API
MIT License
95 stars 53 forks source link

Serialization error when creating entries with Document content using the ContentfulManagementClient.CreateOrUpdateEntry #322

Closed arekkondratiuk closed 9 months ago

arekkondratiuk commented 10 months ago

I have an entry with a Document field. When I try to create it using ContentfulManagementClient.CreateOrUpdateEntry, the entry itself is created in Contentfull, but the management client can't deserialize result value.

This issue can be reproduced using ContentfulManagementClientTests.CreateOrUpdateEntryShouldCallCorrectUrlWithDataForRichText unit test. The only thing, that needs to be changed to show this error, is the conten of the SampleEntryManagement.json. I simply added the "richText" field at the end, according to the value from serialized "doc" variable from //Arrange section. After change, my SampleEntryManagement.json looks as following: { "sys": { "id": "42BwcCt4TeeskG0eq8S2CQ", "type": "Entry", "createdAt": "2016-11-23T09:40:56.857Z", "createdBy": { "sys": { "type": "Link", "linkType": "User", "id": "0w7AzFDgzUA8MWo79R1Qf7" } }, "space": { "sys": { "type": "Link", "linkType": "Space", "id": "gw484zixu8ng" } }, "contentType": { "sys": { "type": "Link", "linkType": "ContentType", "id": "testagain" } }, "firstPublishedAt": "2016-11-23T09:44:08.742Z", "publishedCounter": 1, "publishedAt": "2016-11-23T09:44:08.742Z", "publishedBy": { "sys": { "type": "Link", "linkType": "User", "id": "0w7AzFDgzUA8MWo79R1Qf7" } }, "publishedVersion": 18, "version": 19, "updatedAt": "2016-11-23T09:44:08.771Z", "updatedBy": { "sys": { "type": "Link", "linkType": "User", "id": "0w7AzFDgzUA8MWo79R1Qf7" } } }, "metadata": { "tags": [ { "sys": { "type": "Link", "linkType": "Tag", "id": "nyCampaign" } } ] }, "fields": { "field2": { "en-US": { "lat": 59.40713655426177, "lon": 17.978289127349854 } }, "field1": { "en-US": "Somethi" }, "field4": { "en-US": { "sys": { "id": "2ReMHJhXoAcy4AyamgsgwQ", "linkType": "Asset", "type": "Link" } } }, "richText": { "en-US": { "nodeType": "document", "data": null, "content": [ { "nodeType": "paragraph", "data": null, "content": [ { "nodeType": null, "data": null, "value": "Hello!", "marks": null } ] } ] } } } }

Roblinde commented 10 months ago

Hi @arekkondratiuk Thank you for the detailed issue. I'll have a look when I get some time and see what's going on here...

Roblinde commented 9 months ago

@arekkondratiuk This should now be resolved in version 7.5.0 it seems noone else has needed serialized responses back from the management client as of yet, this hasn't been working since forever, haha. Thanks for the issue report.