JSON Schema === Runtime Type System for TypeScript

This page summarizes the projects mentioned and recommended in the original post on /r/typescript

SaaSHub - Software Alternatives and Reviews
SaaSHub helps you find the best software and product alternatives
www.saashub.com
featured
  • typebox

    Json Schema Type Builder with Static Type Resolution for TypeScript

  • SaaSHub

    SaaSHub - Software Alternatives and Reviews. SaaSHub helps you find the best software and product alternatives

    SaaSHub logo
  • zod

    TypeScript-first schema validation with static type inference

    This is cool — how does it compare to zod? https://github.com/colinhacks/zod

  • schema-builder

    A typescript JSON Schema library that creates a schema and its type at the same time

    Similar to https://github.com/serafin-labs/schema-builder

  • Paste JSON as Code • quicktype

    Xcode extension to paste JSON as Swift, Objective-C, and more

    https://quicktype.io/ might be a solution for that.

  • typescript-is

    typescript-is. This uses a compile-time transformer to generate code for type-checking. You'll need to use ttypescript instead of typescript to compile your code (I recommend setting this up with ts-patch). It won't work if your build pipeline is actually using something like esbuild or Babel to transpile TS->JS.

  • class-validator

    Decorator-based property validation for classes.

    class-validator + class-transformer. Your build pipeline needs to support the TC39 decorators proposal (the TypeScript compiler has this built-in).

  • class-transformer

    Decorator-based transformation, serialization, and deserialization between objects and classes.

    class-validator + class-transformer. Your build pipeline needs to support the TC39 decorators proposal (the TypeScript compiler has this built-in).

  • openapi-typescript-validator

    Generate typescript with ajv validation based on openapi schemas

    Take a look at this repo for an example of how to do that: https://github.com/Q42/openapi-typescript-validator

NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts

  • I found 10,000x faster TypeScript validator library

    5 projects | dev.to | 1 Nov 2022
  • Validate your data with Zod

    2 projects | dev.to | 31 Oct 2022
  • zod code sharing across edge and front end

    2 projects | /r/Deno | 27 Jul 2022
  • Popular Libraries For Building Type-safe Web Application APIs

    6 projects | dev.to | 7 Apr 2024
  • Where DRY Applies

    3 projects | news.ycombinator.com | 3 Nov 2023