In this post we'll go over the basics required to customize quicktype to suit your needs. Warning: The quicktype API is mostly pretty nice, but also pretty undocumented. It's on our TODO list. If you're curious about anything at all, please don't hesitate to reach out, ideally on Slack.
The example we'll work with is the data model for a game we're writing in C#. We're preparing the model in JSON Schema, and quicktype will generate the C# classes for us. There are two extensions we need:
-
Some of the types will represent objects in the game, and we want those to be subclasses of GameObject
.
-
We'd like to specify default values for some properties.