kontent-ai / delivery-sdk-net

Kontent.ai Delivery .NET SDK
https://www.nuget.org/packages/Kontent.Ai.Delivery
MIT License
32 stars 41 forks source link

.NET SDK of Sync Api not correctly deserializing JSON #383

Closed selmiskr closed 8 months ago

selmiskr commented 8 months ago

Brief bug description

When sync api recognizes changes and we try to retrieve the changes with the help of the .NET SDK we get an empty response back. But when we look at the JSON of the response, we are noticing that the entire data is correctly there.

We suspect that the deserialization of the JSON item to the ISyncItem is not correctly done.

Screenshots

image (1) image (2)

pokornyd commented 8 months ago

hello and thank you for the issue submission. I'll review the sync method and get back to you with an update.

pokornyd commented 8 months ago

the model differed from the API response format, without mapping implemented to account for that. I adjusted the model to match sync API response, content item information is now nested in Data property.

a strongly typed item can be retrieved from newly introduced StronglyTypedData property, as long as a TypeProvider is registered and can found a suitable model. the property is null otherwise