Guides
14 short guides in plain English. Each one ends with something you can try in the tool.
The choices a generator makes
Optional, null, a union, a date, a name. Where the code comes from, and where it goes wrong.
Which JSON fields are optional? What a generator can and cannot know
A sample shows you what was there once. It cannot show you what is always there. Here is how to tell the difference, and what to do about it.
null in JSON — missing, empty, or unknown?
A key that is absent, a key that holds null, and a key that holds an empty string are three different things. Most bugs here come from treating them as one.
The number that does not fit — int64, bigint and decimal
A JSON number above 9007199254740992 is already wrong by the time a generator sees it. Here is why, and which type to ask for instead.
Dates in JSON, and the type a generator should give you
JSON has no date. What you get depends on the format in your sample, and an epoch number is almost always missed.
snake_case to camelCase — what a generator renames, and why
Your JSON keys and your language's naming rules disagree. Here is what gets renamed, what keeps the original name, and where it goes wrong.
When one field holds two types
An array of mixed things, a field that is a string on Monday and a number on Tuesday. What a generator does, and what you should do instead.
In your language
The library, the setting that matters, and the trap that catches people.
Go json tags, omitempty, and the zero value trap
Why every generated Go struct has tags, what omitempty really drops, and why a pointer is sometimes the only honest type.
Pydantic or a dataclass? Python types from JSON
A dataclass with type hints checks nothing at all. Pydantic checks everything. Here is when each one is the right answer.
Checking the data
A type is not a check. What to use at the edge of the program.
A type is not a check
TypeScript, Flow and Elm types vanish when the program runs. If your data comes from outside, you need something that is still there at run time.
Zod or a JSON Schema — which one should you keep?
Both check data. One lives in your TypeScript, one lives in a file every language can read. The choice depends on how many languages you have.
An enum, or a string?
A generator sees "admin" and writes string. Sometimes that is right and sometimes it throws away the most useful fact in your data.
Keeping it working
From a sample to a schema to code, and what to do when the API changes.
From a sample, to a schema, to code
The way to use a generator that still works in six months: make the schema once, read it, commit it, and make the code from it every time.
Keep generated code honest — make it again in CI
Generated files rot the moment somebody edits one by hand. One CI step makes that impossible.
The API changed. Now what?
A new field, a removed field, a type that flipped. Which changes break your generated code, which break it quietly, and how to find out first.