I have no definitive idea of what could be the different uses of Typson for TypeScript developers. It is possible that someone would use it in a way I did not imagine.
JSON is nowadays a common format for many cases from data exchange between applications to persistence. Its simplicity makes interoperability very easy to realize.
JSON schema is an attempt at standardizing the way we describe JSON data. There is an emergence of tools that uses JSON schema: validators, document generators, code generators (and vice-versa), see
. There is quite a need for such a standard, I think.
Two cases I imagined where it could be useful:
1) A pure browser TypeScript application that renders/manipulate data. The data structure would surely be defined as TypeScript interfaces. Typson would provide a JSON schema version of this data structure. One may want to connect this application to different
servers providing this data. These servers can be implemented in any technology (PHP, .NET, Java, Node.js, ...). So, one can use the JSON schema to document and validate the JSON data. We can even generate the server classes out of the JSON schema.
2) A Node.js server-side application written in TypeScript that expose a JSON/REST API to clients (any technology). Here again, one can generate the documentation (e.g. with Swagger) out of the TypeScript interfaces, validate the data sent by clients and also
generate the client-side types.
This is actually a contract-last approach to interface definition.
There are some JSON schema tools able to generate fake data from JSON schema, so the use case you describe makes sense.
Now, I am not a Visual Studio user, so I don't exactly know how this could be integrated in a build process, but I imagine that spawning the node.js version of Typson during the build process is possible (after all, the TypeScript compiler is a node.js module).