We’re using NewtonSoft’s JSON library to deserialise/parse the JSON data into C# objects. And to create those C# classes we’re using a free online tool, namely http://json2csharp.com/
The tool has a few shortcomings. One is that it of course infers by example, so if the example JSON I paste doesn’t exhibit all the possible nodes, the generated classes lack those properties. We don’t know they’re missing until we try to access them.
Another shortcoming is that it duplicates classes with the same signature, e.g. those with an ID and a Data field result in many “Datum”-named classes.
Furthermore, because there is commonality between the list of measures available under a commodity and the list of measures applicable to a header-level commodity (i.e. declarable header), it would be good to re-use the same classes to represent the data that has a home in both places.
Is it possible to either see an example JSON (doesn’t have to be for a real commodity) with every possible field populated, from which we can infer the schema? Or even better, to be pointed to a schema definition so that we don’t need to infer anything?