Show HN: A tool to Convert JSON schemas into TypeScript classes

This page summarizes the projects mentioned and recommended in the original post on news.ycombinator.com

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

    Discontinued This is a tool that converts JSON schemas into TypeScript utility classes for use in Deno.

  • Paste JSON as Code • quicktype

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

  • Nice! JSON schemas are really useful, we use them a lot for code generation. Another library that does this for multiple languages is https://quicktype.io/ . It's great, but not so actively developed.

  • 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.

    SurveyJS logo
  • quicktype

    Generate types and converters from JSON, Schema, and GraphQL

  • I have the library demo linked from the homepage bookmarked: https://app.quicktype.io/ I use it every time I need to go from a pile of JSON to TypeScript types or zod declarations.

  • json-schema-to-typescript

    Compile JSONSchema to TypeScript type declarations

  • Nice! Lots of tricky edge cases to do this right: there’s ambiguity in the JSON Schema spec, version-to-version changes, many popular community conventions that don’t adhere to the spec, etc. Feel free to check out the tests to understand some of these: https://github.com/bcherny/json-schema-to-typescript (shameless plug — I have maintained this library for a number of years).

  • hof

    Framework that joins data models, schemas, code generation, and a task engine. Language and technology agnostic.

  • You can pretty much make up any pseudo grammar like this one, which is a reduced JSON object that is close to CUE: https://github.com/hofstadter-io/hof/blob/_dev/flow/chat/pro...

    No need to be formal or use a standard format

  • json-schema

    JSON Schema Validation, Annotation, and Bundling. Supports Draft 04, 06, 07, 2019-09, 2020-12, OpenAPI 3.0, and OpenAPI 3.1 (by hyperjump-io)

  • Ajv doesn't really do a great job at following the JSON Schema standard. I'd suggest taking a look at hyperjump.

    https://github.com/hyperjump-io/json-schema

  • unify-jdocs

    A new way of working with JSON documents without using model classes or JSON schemas

  • Nice! Talking of JSON schemas and validating JSON documents against schemas, for Java, I wrote unify-jdocs where I do not use JSON schemas but still do validations (I found them unwieldy to use and was looking for something simpler). You can find details here -> https://github.com/americanexpress/unify-jdocs. Also, no POJOs / model classes, just reading and writing JSON paths in a single line of code. It's helped us tremendously in managing complexity in a very large internal project. I am hoping it helps others.

  • InfluxDB

    Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.

    InfluxDB logo
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