I have an xml document that i want to convert to JSON using a JSON Schema.
I am able to convert/serialize the xml into JSON using Newtonsoft.JSON
the code i use to convert it into JSON is JsonConvert.SerializeObject(xmlDocumentObject);
the thing is if there is an array object and it has only one element, then NewtonSoft JSON Serializer converts it into an object rather than an array.
so i've generated a valid json schema out of my JSON and i want to convert the xml document using this json schema. is there a way i can do this using NewtonSoft JSON?
i can see they have a JSchema class that is used to validate a json using a schema but is there a way to convert an object into json using the same schema object?