3 ms·
Well, you could have one or the other and then just convert a schema to an Interface [1], or vice versa [2]. The reason I like schema-first is because a schema
by whatever_dude 10y ago
Well, you could have one or the other and then just convert a schema to an Interface [1], or vice versa [2].
The reason I like schema-first is because a schema allows you to be way more strict about what's accepted in most cases, e.g. validating an entry via RegEx. It tends to make APIs safer and runtime errors more clear.
[1] https://github.com/bcherny/json-schema-to-typescript https://github.com/bcherny/json-schema-to-typescript
[2] https://github.com/YousefED/typescript-json-schema https://github.com/YousefED/typescript-json-schema