New Tools Simplify JSON schema for Rust and Go Developers

New Tools Simplify JSON schema for Rust and Go Developers
Adil El

New developer tools, omni-schema and Godantic, are streamlining JSON schema workflows in Rust and Go, solving common sync and validation problems.

JSON Schema provides a standardized vocabulary for ensuring data consistency and validity, a critical function for developers working with JSON at scale. However, managing these schemas and keeping them synchronized with application code across different systems can introduce significant friction. Addressing this challenge, developers in the Rust and Go communities have recently released new open-source tools designed to streamline these workflows.

Bridging the Gap in Rust with Omni-Schema

In the Rust ecosystem, a new crate named omni-schema aims to solve the problem of keeping multiple data definition formats in sync. A developer known as /u/Key-Reading-2582 explained the motivation behind the project, stating, “Every time I changed a struct I had to update multiple files. It was annoying.”

New Tools Simplify JSON schema for Rust and Go Developers
New Tools Simplify JSON schema for Rust and Go Developers 11

Omni-schema allows developers to define a Rust struct once and then automatically generate corresponding definitions for JSON Schema, TypeScript, Protocol Buffers, GraphQL SDL, OpenAPI, and Avro. By deriving a schema directly from the source Rust types, it creates a single source of truth, eliminating the manual and error-prone process of updating schemas in different files. The tool also translates validation attributes, such as minimum length or email format, into the appropriate constraints for each output format.

Unifying Validation in Go for Modern APIs

For Go developers, particularly those interacting with Large Language Model (LLM) APIs, a new library called Godantic offers a novel solution. Creator /u/deepankarmh built the tool to address the pain point where validation libraries and JSON Schema generators use different struct tags, making it difficult to maintain consistency.

Godantic unifies validation and schema generation into executable Go code, moving logic out of struct tags and into methods. This approach provides a single, type-safe source of truth that is easily debuggable and testable. The library is especially useful for developers working with structured outputs from models like OpenAI’s, where both strict data validation and a correct JSON Schema are required for reliable performance.

#JSONschema #Godevelopment #Rustdevelopment #APIvalidation #developertools

TAGGED:
Share This Article
Leave a Comment