The Last Breaking Change | JSON Schema Blog

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

Our great sponsors
  • SurveyJS - Open-Source JSON Form Builder to Create Dynamic Forms Right in Your App
  • WorkOS - The modern identity platform for B2B SaaS
  • InfluxDB - Power Real-Time Data Analytics at Scale
  • awesome-jsonschema

    A curated list of awesome JSON Schema resources, tutorials, tools, and more.

    Truth. Zod is comparable to JSON Schema plus AJV, and it doesn't compare well at all. Your Zod code is all locked inside TypeScript so not only can it not be shared to any other language in your stack but it also cannot be serialized, which introduces many limitations. You also miss out on all the JSON Schema ecosystem tooling. (1, 2) For example the intellisense you get in VS Code for config files is powered by JSON Schema and schemastore.

  • typebox

    Json Schema Type Builder with Static Type Resolution for TypeScript

    For these reasons I continue to recommend typebox over Zod. I honestly have yet to be given one compelling reason to use Zod over typebox. You'd have to argue against all of those JSON Schema upsides, which immediately undermines the argument. This whole "debate" comes off as "if all you have is a hammer, everything looks like a nail." People just don't know about JSON Schema, its many upsides, its ecosystem, and its tooling.

  • SurveyJS

    Open-Source JSON Form Builder to Create Dynamic Forms Right in Your App. With SurveyJS form UI libraries, you can build and style forms in a fully-integrated drag & drop form builder, render them in your JS app, and store form submission data in any backend, inc. PHP, ASP.NET Core, and Node.js.

  • zod

    TypeScript-first schema validation with static type inference

    Additionally Zod is also undergoing breaking changes, as any library would. (Example) As a comparison, it seems moot.

  • deno

    A modern runtime for JavaScript and TypeScript.

    Oh, and if you're looking for even better security, you should give "Deno" a try. It's another JavaScript runtime that runs programs faster and has an easy way to handle permissions. Plus, it's more secure than Node.js. Here's the link: https://deno.land

  • bun

    Incredibly fast JavaScript runtime, bundler, test runner, and package manager – all in one

    Also, have you heard of this new JavaScript runtime called "Bun"? Apparently it runs programs even faster than Node.js and automatically installs packages for you. Sounds pretty sweet, right? Here's the link if you want to check it out: https://bun.sh

  • decimal.js

    An arbitrary-precision Decimal type for JavaScript

    For your particular example though, if we keep in mind that the input data to be validated is JSON-serializable, only a string could possibly accommodate the precision expected of a decimal from among the JSON-serializable JS primitives. You could use one or more regex patterns to describe the allowable permutations. The resultant schema would be cross-platform since it doesn't use custom keywords - nice! You can also use unions if you want to say that integers, NaN, and Infinity are also allowed per the docs there.

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