3 ms·
json-schema is hideous compared to TS type definitions, though.
by xsmasher 6y ago
json-schema is hideous compared to TS type definitions, though.
- throw_m239339 6y agojson-schema works at runtime, that's what you want to validate your serialized messages. None of that stuff is related to typescript. Typescript is a static code analyser, nothing more. It doesn't do anything at runtime.
- xsmasher 6y agoI see the utility of json-schema, I just wish the schemas were beautiful and succinct like TS type definitions are. I know one is runtime and one is compile-time, but they both allow you to specify the "shape" of a particular JSON object and verify an example against it.