I have an object which I use NewtonSoft JSON to deserialize to string
Jsonstring = JsonConvert.SerializeObject(InfoObject)
Is there a way I can convert to Canonicalized JSON string. I couldn't find anyway with NewtonSoft JSON.
The sorting needs to be case sensitive. So “orgExtra” should appear before “organization” because a capital “E” is before a lower case “a”. Also, it needs to flatten the JSON structure, so
{ “organization” : “exampleorg”,
“fName” : “name of person”,
“orgExtra” : {
“orgLocator” : “Bldg1”,
“desg” : “Mgr”
}
should be
“fName:name of person” + “\n” + “orgExtra.desg:Mgr” + “\n” + “orgExtra.orgLocator:Bldg1” + “\n” + “organization:exampleorg” + “\n”
Can this Canonicalization be done with NewtonSoft?