Json2CSharp / Json2CSharpCodeGenerator

Microsoft Reciprocal License
305 stars 83 forks source link

Reports invalid format - no lint errors found though #50

Open jjensen554git opened 3 years ago

jjensen554git commented 3 years ago

Exception: Unable to cast object of type 'Newtonsoft.Json.Linq.JArray' to type 'Newtonsoft.Json.Linq.JObject'.

Boat.zip

jjensen554git commented 3 years ago

Exception occurring in JsonClassGenerator.cs: line 71 JToken json = JToken.ReadFrom(reader); if (json is JArray jArray) { examples = jArray.Cast().ToArray(); <<< exception occurs here } else if (json is JObject jObject) { examples = new[] { jObject }; }

Json2CSharp commented 3 years ago

wow i've never seen so many arrays in my life, I'll check this out see if i can do something about it, thanks for the heads up