Hi
I have come to a problem deserializing json to dto using polymorphism. This could be fixed using JsonSerializerSettings TypeNameHandling = auto. Unfortunately abp uses hardcoded JSONSerializerSettings.
return JsonConvert.DeserializeObject<TObj>(str, new JsonSerializerSettings { ContractResolver = new CamelCasePropertyNamesContractResolver() });
So there is no way to override it specifying JsonConvert.DefaultSettings. I think you can setup json default settings semewhere during bootstrap and in code use just DeserializeObject without specifying JsonSerializerSettings.
1 Answer(s)
-
0
Hi,
TypeNameHandling may not be a good idea. Because in that case, you will send class names from javascript. But OK, you may need it. Currently, it's hardcoded as you saw. Can you create an issue on Github for that. We will consider to resolve it in next versions. Thanks.