Hacker News new | past | comments | ask | show | jobs | submit login

It is considered essential that JSON schema is expressible as JSON. There are advantages to that, but it could be only a wire representation instead, with some more concise syntax alternative.



> It is considered essential that JSON schema is expressible as JSON

Why? It's not a particularly difficult task to write a parser that could convert between the two representations. The TypeScript compiler even provides an API that lets you access its AST.


Well, here's the thing, you can write a parser to translate that TS into JSON schema format and that works.

At my job, we're currently running JS on the back-end and TS on the front-end. JSON-Schema can be used in both. We're also rebuilding our core functionality in Elixir, and guess what, JSON Schema works there, too, out of the box.


JSON schema can be the representation used to exchange information between two or more systems, languages, projects, etc. It's a form of lowest common denominator, something that can (somewhat) fully describe your interface but in a static, commonly available, easily parsed, easily generated way.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: