Add the Newtonsoft Json NuGet package to your solution. Add a function below and pass the circuit and your json answer in the line below the function.
public void ValidateSchema(JsonSchema JSchema, string JsonString) { JsonString = JsonString.Replace("\"", "'"); var ArrJobj = JArray.Parse(JsonString); foreach (JObject jo in ArrJobj) { if (!jo.IsValid(JSchema)) throw new Exception("Schems Validation failed"); } }
Hope this helps
source share