2 ms·
I do find it nicer to write my JSON schemas first as Typescript interfaces. Looks like there's a decent tool to automate that conversion to a JSON schema file [
by WorldMaker 11y ago
I do find it nicer to write my JSON schemas first as Typescript interfaces. Looks like there's a decent tool to automate that conversion to a JSON schema file [1], but I haven't tried that yet.
I also think it would be great if Typescript offered a "JSON strict interface" that could warn/error if you do something like use a Date instead of a string. (Even better if you could use that type information along with something like decorators for run-time checks before trying to `JSON.stringify`, at least in debug runs.)
[1] https://github.com/lbovet/typson https://github.com/lbovet/typson