_bAp_·hace 6 años·discussI had the same problem and used a JSONSchema as a single source of truth. Then from that schema you can generate:- the typescript interfaces: https://www.npmjs.com/package/json-schema-to-typescript- the runtime checks with AJVSo you have no duplication and you're type safe.
- the typescript interfaces: https://www.npmjs.com/package/json-schema-to-typescript
- the runtime checks with AJV
So you have no duplication and you're type safe.