3 ms·
Or just use AJV which has the ability to statically represent JSON Schemas as full-fledged types, so that the schemas themselves become the authoritative IDL, v
by junon 4y ago
Or just use AJV which has the ability to statically represent JSON Schemas as full-fledged types, so that the schemas themselves become the authoritative IDL, via the new JSONDataType in AJV@7.
- vosper 4y agotRPC is more than schemas, though - in tRPC schemas are actually supplied by Zod. tRPC is more of a framework that abstracts away building an API and makes removes the perception of a serialization barrier between client and server. It feels like it's all one codebase. It also carries types across, so that changing (eg) the shape of a database response will immediately throw up type errors in client-side code.