How it works
Every sample is read as a value of the root type. JSON Lark merges what it sees: a key missing from some objects becomes optional, a value that is sometimes null becomes nullable, arrays holding different kinds of values become unions, and objects with the same keys and types share one interface. Paste more samples in new tabs, or several documents in one tab as JSON Lines or separated by a --- line.
The general notes
- Declare as, nested objects
interface or type declarations, named for the key they came from (repos becomes Repo), or nested objects written inline.
- Null values
- Keep
| null, treat null as a missing key, or both.
- String-literal unions
- Off by default. A string key with up to 8 distinct values, at least one of them repeated, becomes
"active" | "invited".
- Note ISO dates
- Strings such as
2026-03-14T09:26:53Z stay string (that is what JSON.parse gives you) with a comment saying they hold dates.