I recently upgraded to the latest Newtonsoft.Json version 12.0.2. I was previously running an older version (11.0.2), and somewhere in between, the StringEnumConverter.CamelCaseText property was deprecated.
Per the StringEnumConverter class, "StringEnumConverter.CamelCaseText is obsolete. Set StringEnumConverter.NamingStrategy with CamelCaseNamingStrategy instead." As a result, I made the following change in scenarios where CamelCaseText == true:
// Deprecated approach
new StringEnumConverter() { CamelCaseText = true };
// New approach
new StringEnumConverter() { NamingStrategy = new CamelCaseNamingStrategy() };
While this seems straightforward, I am unsure how to approach scenarios where CamelCaseText == false. I have read the CamelCaseNamingStrategy class but do not know where I would disable the camel-casing. My guess is that I need to use a different naming strategy class than CamelCaseNamingStrategy such as DefaultNamingStrategy, but I am unsure what the difference is in the behavior of this class.
Can anybody point me to documentation explaining the difference, and/or help me understand which naming strategy to use in this case?
// Deprecated approach
new StringEnumConverter() { CamelCaseText = false };
// New approach
new StringEnumConverter() { NamingStrategy = ? };