The Plexdata Model Generator is a program that is able to generate source code files for C# and Visual Basic which are based on pure JSON and/or XML files.
The software has been published under the terms of MIT License.
The latest release can be obtained from https://github.com/akesseler/modelgenerator/releases/latest.
The master branch can be downloaded as ZIP from https://github.com/akesseler/modelgenerator/archive/master.zip.
Under some circumstances it is possible that a generated class contains an item of some type as well as a list of that type. In such a case it will be necessary to remove the redundant item manually. Here an example.
Source XML
<LabelCollection>
<Label>Business</Label>
</LabelCollection>
...
<LabelCollection>
<Label>Fax</Label>
<Label>Business</Label>
</LabelCollection>
Generated Class
[XmlRoot("LabelCollection")]
public class LabelCollection
{
[XmlElement("Label")]
public Label Label { get; set; } // Must be removed manually.
[XmlElement("Label")]
public List<Label> Labels { get; set; }
}
The reason behind, the generator is unable at the moment to distinguish between item types and a list of items of the same type.