You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
publicstaticJsonSerializerSettingsSettings=>new JsonSerializerSettings
{
TypeNameHandling =TypeNameHandling.All,// Allow preserving type information (necessary for deserializing interfaces into implemented types) ReferenceLoopHandling=ReferenceLoopHandling.Serialize,// The content item models contain recursive references which are supposed to be preserved.PreserveReferencesHandling=PreserveReferencesHandling.All,// The code must not use arrays and readonly collections, otherwise it'll result in "Cannot preserve reference to array or readonly list, or list created from a non-default constructor" exception. (more details at https://stackoverflow.com/a/41307438/1332034)Converters=newList<JsonConverter>{newUtcDateTimeConverter()}};
There is no way to set the max depth property on that settings object as it is read-only. Can you open this up so we can set the maxdepth property? I tried this:
Brief bug description
Get the following error when deserializing cached data using the IDeliveryCacheClient using a IDistributedCache:
I tried to modify this but this property is marked with only a setter:
https://github.com/kontent-ai/delivery-sdk-net/blob/master/Kontent.Ai.Delivery.Caching/Extensions/SerializationExtensions.cs
The problem is here:
There is no way to set the max depth property on that settings object as it is read-only. Can you open this up so we can set the maxdepth property? I tried this:
Kontent.Ai.Delivery.Caching.Extensions.SerializationExtensions.Settings.MaxDepth = 256;
But that doesn't change the default 64 path limit, I think its because that property is marked as static with a getter only.
Repro steps
You need to provide a query to the kentico API that will create a fairly large object. In my case it was serializing an object that is about 40MB.
Expected behavior
What is the correct behavior?
You should be able to control the depth size of seriliazation.
Test environment
Latest Kontent.ai packages
The text was updated successfully, but these errors were encountered: