gcanti / io-ts-codegen

Code generation for io-ts
https://gcanti.github.io/io-ts-codegen/
MIT License
156 stars 14 forks source link

Integration with json-ts #23

Open tonyxiao opened 6 years ago

tonyxiao commented 6 years ago

Is it possible to integrate with something like (json-ts)[https://github.com/shakyShane/json-ts] such that we can automate this entire process from json based API response directly into types that validate both compile time and runtime?

cyberixae commented 4 years ago

@tonyxiao I just created a package that turns a json schema into io-ts. The code is far from beautiful but depending on the format you have, it might do the job. See https://www.npmjs.com/package/io-ts-from-json-schema