Try our conversational search powered by Generative AI!

Json serialization of dictionaries containing underscore it camel cased differently in Newtonsoft 9

Fixed in

EPiServer.CMS.Core 10.4.0

(Or a related package)

Created

Dec 08, 2016

Updated

Feb 03, 2017

Area

CMS Core

State

Closed, Fixed and tested


Description

For dictionary data type, the key of its is not serialized in the same way as previous versions if the key contains the underscore character.

In my case, at server side, the key of dictionary follows this principle PartA_PartB. PartA is an upper case string (e.g. SYSTEMCOLUMN) and PartB is only capitalized the first character of each word (e.g SubmissionId).

In previous versions, after being serialized, at client side, all characters of partA become lower cases while PartB is kept the same as it is at server side (e.g. systemcolumn_SubmissionId).

For Newtonsoft 9, there is a slight change that the last character of part A is still an upper case (e.g. systemcolumN_SubmissionID). The character preceding _ (N) is kept the same and not converted to lower case. I attached two images, one shows our data (key and value) at server side and another one shows it after being serialized at client side.

My images, one illustrating data at server side, and another one displaying data serialized at client side.