✅ Managing JSON which varies in size and/or structure?
I'm working on two hobby projects at the moment, both are meant to accept json input but I'm struggling because C# seems quite strict on datatypes and I'm a noob.
In one project the JSON I return is massive and seems like it could be broken into multiple classes.
In the second project, the JSON structure seems to vary depending on the data being sent.
What's the best way to tackle these sorts of things? I appreciate there is a way to copy JSON into Visual Studio it can generate the class for you but I don't want to be tied to Visual Studio and it's still a lot of admin work.
For the varying JSON I captured about 100 entries and put them in a text file but I'm not even sure now how to compare them against each other to see if they're the same structure? Also apparently System.Text doesn't support the "dynamic" data type but Newtonsoft.Json is a thing of the past now?
Any advice or tips would be great, thank you!
In one project the JSON I return is massive and seems like it could be broken into multiple classes.
In the second project, the JSON structure seems to vary depending on the data being sent.
What's the best way to tackle these sorts of things? I appreciate there is a way to copy JSON into Visual Studio it can generate the class for you but I don't want to be tied to Visual Studio and it's still a lot of admin work.
For the varying JSON I captured about 100 entries and put them in a text file but I'm not even sure now how to compare them against each other to see if they're the same structure? Also apparently System.Text doesn't support the "dynamic" data type but Newtonsoft.Json is a thing of the past now?
Any advice or tips would be great, thank you!


