News for hackers. Stuff that matters.
Re:JSON Schema bundling formalised by run-types on Friday September 10, 2021 @08:47AM (#28480745)
For those looking to sanitize input from Typescript, I highly recommend the runtypes library: https://github.com/pelotom/runtypes

It let's you specify type definitions a DSL in Typescript using syntax very similar to Typescript's type definitions. Once you define your types in the DSL, you get Typescript types and parsing / verification for free. Not as general purpose as JSON Schema, but 1000x cleaner and easier to use.

Re:JSON Schema bundling formalised by dolmen on Friday September 10, 2021 @09:40AM (#28481403)
The point of JSON Schema is to have a common format independant of the programming language to ease interoperability.
Re:JSON Schema bundling formalised by move-on-by on Friday September 10, 2021 @09:43AM (#28481437)
I've never seen runtypes, but I've seen io-ts [1]. Are you aware of the pros/cons between them?

[1] https://gcanti.github.io/io-ts/

Re:JSON Schema bundling formalised by run-types on Friday September 10, 2021 @10:45AM (#28482273)
They look roughly the same