Ask HN: Do you use JSON Schema? Help us shape its future stability guarantees

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
  • WorkOS - The modern identity platform for B2B SaaS
  • InfluxDB - Power Real-Time Data Analytics at Scale
  • cue

    The home of the CUE language! Validate and define text-based and dynamic configuration

  • My struggle with JSON Schema is that not everyone uses it! I do a lot of work with various APIs and ingestion systems that accept JSON, but they don't provide a JSON Schema for me to validate my payloads against. Instead, I often have a human being on the other side emailing me and saying, "Your data structure isn't correct."

    It's mildly infuriating. I've taken to using Cuelang[0] to write my own validators based on their specifications. (Using Cue because JSON isn't the only data format I have to support.)

    I wish there were an easier way to take some documentation and generate JSON Schema from it. I can take the sample JSON in the docs and generate one, but those samples don't usually contain all the edge cases that the systems complain about, so it's not super useful.

    [0] https://cuelang.org/

  • alterschema

    Convert between JSON Schema specification versions.

  • A project exists which does this, and the team even support its development: https://github.com/sourcemeta/alterschema

    Personally, I'd like to see it become officially supported. We have work to do!

  • 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
  • schema-dts

    JSON-LD TypeScript types for Schema.org vocabulary

  • Just last week, I added the ability to export [Umami](https://www.umami.recipes/) recipes as [Recipe JSON Schema](https://schema.org/Recipe). Writing the code for it was quite pleasant thanks to [schema-dts](https://github.com/google/schema-dts).

  • pg_jsonschema

    PostgreSQL extension providing JSON Schema validation

  • I'm not currently using it, but I'm strongly considering validating json in postgres with https://github.com/supabase/pg_jsonschema - which uses the https://docs.rs/jsonschema/latest/jsonschema/ Rust crate

    So I'm not sure if my feedback is valid but, I sure hope that the jsonschema crate follows the spec! Otherwise I'll never use jsonschema but instead something-not-exactly-jsonschema. In other words.. you better not break anything.

  • dynamic_dns

    A Dynamic DNS Widget (by chapmajs)

  • I do use it, and it's a nice additional layer in forcing APIs to a) remain consistent and b) increase security. I think the only public program I'm using it in is my dynamic DNS widget:

    https://github.com/chapmajs/dynamic_dns

    My main interest in using JSON Schema in the above project was security related: this service sits on the public Internet, by nature I cannot restrict the sources that connect to it (road warrior type systems couldn't send DNS updates!). Having a strict schema is another layer of sanitization on what one nowadays must assume is a malicious source.

  • raml-spec

    Discontinued RAML Specification

  • > Do you use JSON Schema?

    At one point I did, but then discovered RAML[0] and it subsumed the value of what JSON Schema provides as well as being easier to work with than OpenAPI[1]. Also, generating JSON Schema from RAML definitions has proven to be a fairly straightforward process.

    The usual caveats apply... Your mileage may vary, my experiences do not speak for any others, my opinion does not detract from the value of JSON Schema, etc.

    0 - https://github.com/raml-org/raml-spec/blob/master/versions/r...

    1 - https://swagger.io/specification/

  • alt-schema

    Flat JSON Schema specification and basic utility methods

  • I considered using it some time back for API payload validations. I found it bit too verbose for my use case then. I ended up writing my own lighter version and it worked pretty well. I later open sourced it here - https://github.com/sleeksky-dev/alt-schema .

  • WorkOS

    The modern identity platform for B2B SaaS. The APIs are flexible and easy-to-use, supporting authentication, user identity, and complex enterprise features like SSO and SCIM provisioning.

    WorkOS logo
  • openapi-generator

    OpenAPI Generator allows generation of API client libraries (SDK generation), server stubs, documentation and configuration automatically given an OpenAPI Spec (v2, v3)

  • - Most YAML based configuration files.

    GraphQL doesn't quite supersede JSONSchema because it doesn't deal with validation. (Something like Cue (https://cuelang.org/) might)

    Type systems are not typically cross-language, which is where JSONSchema tends to be used a lot.

    There are indeed a lot of openapi-based client generators. This one, for example, has been around for quite some time: https://github.com/OpenAPITools/openapi-generator

  • library-recommendations

    Evaluating Open Source libraries for particular purposes

  • I reviewed JSON Schema libraries for Haskell:

    https://github.com/sshine/library-recommendations/blob/main/...

    My current impression is that JSON Schema is nicer in theory than in practice.

  • open-kun

    Discontinued Open source Al-Kun

  • OpenMetadata

    Open Standard for Metadata. A Single place to Discover, Collaborate and Get your data right.

  • We at OpenMetadata(https://open-metadata.org) use JsonSchema extensively to define the metadata standards. JsonSchema is one of the reasons we are able to ship and get the project to what it is today in quick time. More about it here https://www.youtube.com/watch?v=ZrVTZwmTR3k

  • json-editor

    JSON Schema Based Editor

  • I use JSON schema to generate JSON-editing forms via json-editor: https://github.com/json-editor/json-editor

    Then I can use the same schema in the backend to validate the data, both sent in via the form and directly with the application/json content-type. It's a pretty smooth flow, and reduces a lot of redundancy.

  • laminar

    Discontinued OpenApi backed REST APIs. Automatic validation of request / response based on the api schema. (by ovotech)

  • I use it extensively in prod. Well the superset that is OpenApi. It enables contract first development where any change to the api is done in the schema fist, and then implemented by the clients/server.

    Since we have tooling[0] that validates requests and responses at runtime, the clients can be absolutely sure of what they receive (we through 500 if the server attempts to respond with an undocumented respond) And the server is also sure about the shape of the requests. This allows us to validate everything at compile time too, generating typescript types for both client and server.

    And since we have similar tooling regarding our data stores (typescript types for sql queries) most of the time if there is a bug, the code would simply not compile - pretty nifty!

    [0] - https://github.com/ovotech/laminar

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