4 ms·
Validating Data with JSON Schema, Angular and TypeScript
- lioeters 7y agoWhat I was most curious about was how they achieved run-time type checking in TypeScript. In this case, it was done by code generation using: https://github.com/bcherny/json-schema-to-typescript https://github.com/bcherny/json-schema-to-typescript Personally, I'd prefer a way that doesn't involve another build step. A popular library I've often seen mentioned is io-ts: https://github.com/gcanti/io-ts https://github.com/gcanti/io-ts One that I've taken a liking to, backed by ajv for JSON schema validation, is: https://github.com/andnp/ValidTyped https://github.com/andnp/ValidTyped