This was my personal pet peeve for a while. I even half-assed a spec language called RELAX JSON that I bet Bray would like. [0]

But then I realized that what I had made up was very similar to type definitions in TypeScript!

Especially if you use `interface` and not `class`, TypeScript gives you a lot of flexilibity in specifying data structures. You get optional values, typed arrays, typed but mixed arrays, references to other named types that you define yourself, and so on. Really, it's all you need and more. The only downside is that you can spec stuff that you can't put in JSON, such as Date objects. As a schema language, that is a bit weird. But just don't spec it like that! :-D

I'll post some examples in a reply when I'm back behind a computer.

[0]https://github.com/eteeselink/relax-json

Ha! That's the reason I started working on https://github.com/bcherny/json-schema-to-typescript.

For the record, JSON Schemas are quite a bit more expressive than TypeScript interfaces, or even Scala Traits. I actually put together a big list of every JSON Schema constraint that isn't checkable at compile time in TS: https://github.com/bcherny/json-schema-to-typescript#not-exp....