Open-Awesome
CategoriesAlternativesStacksSelf-HostedExplore
Open-Awesome

© 2026 Open-Awesome. Curated for the developer elite.

TermsPrivacyAboutGitHubRSS
  1. Home
  2. OCaml
  3. atdgen

atdgen

NOASSERTIONOCaml4.2.0

A syntax for defining cross-language data types to generate type-safe serializers, deserializers, and validators for JSON APIs.

GitHubGitHub
354 stars62 forks0 contributors

What is atdgen?

ATD (Adaptable Type Definitions) is a syntax and toolset for defining cross-language data types, used to generate type-safe serializers, deserializers, and validators for JSON APIs. It solves the problem of maintaining consistent data structures across different programming languages in a service-oriented architecture.

Target Audience

Developers and teams building multi-language systems or JSON APIs who need to ensure type safety and consistency across services written in different programming languages.

Value Proposition

ATD provides a single source of truth for data definitions, reducing bugs and boilerplate code by automatically generating type-safe serialization and validation code for multiple languages from one schema.

Overview

Static types for JSON APIs

Use Cases

Best For

  • Generating type-safe API clients and servers in multiple languages from a single schema
  • Ensuring data consistency across microservices written in different programming languages
  • Automating validation and serialization code for JSON-based APIs
  • Migrating or integrating systems that use different tech stacks but share data structures
  • Reducing boilerplate and potential errors in API data handling
  • Comparing and versioning API schemas to detect breaking changes

Not Ideal For

  • Monolingual projects where a single-language type system suffices, as ATD's cross-language generation adds unnecessary complexity
  • Teams that prioritize rapid iteration with dynamic or schema-less data, since ATD requires rigid type definitions upfront
  • Environments already standardized on JSON Schema for validation, as ATD's export feature might duplicate existing tooling
  • Small, short-lived prototypes where setting up the opam toolchain and multi-language integration is overkill

Pros & Cons

Pros

Cross-Language Consistency

Define types once in ATD syntax and generate code for C++, Java, Python, TypeScript, and other languages, ensuring consistent data structures across services, as listed in the README.

Type-Safe Serialization

Generates serializers and deserializers that enforce data integrity when converting between JSON and native types, reducing bugs in API handling.

Automated Validation

Produces validators from type definitions to enforce constraints automatically, minimizing manual error-checking boilerplate.

Schema Tooling Suite

Includes utilities like atdcat for syntax checking and atddiff for comparing interface revisions, aiding in API maintenance and versioning, as highlighted in the README.

Cons

OCaml Ecosystem Dependency

Installation requires opam and familiarity with OCaml tooling, which can be a barrier for teams not using OCaml, as noted in the installation instructions.

Incomplete Language Support

Some target languages have legacy implementations (e.g., OCaml) or are marked as 'coming soon', limiting readiness for certain tech stacks, per the README's language list.

Setup Complexity

Integrating ATD into multi-language build processes demands custom scripting and maintenance, adding initial overhead compared to language-native solutions.

Frequently Asked Questions

Quick Stats

Stars354
Forks62
Contributors0
Open Issues87
Last commit2 months ago
CreatedSince 2013

Tags

#json-api#validation#static-types#data-contracts#serialization#api-schema#code-generation#type-definitions#cross-language#ocaml

Built With

O
OCaml

Included in

OCaml3.1k
Auto-fetched 1 day ago

Related Projects

yojsonyojson

Low-level JSON parsing and pretty-printing library for OCaml

Stars368
Forks61
Last commit16 days ago
sexplibsexplib

Automated S-expression conversion

Stars198
Forks33
Last commit3 months ago
binioubiniou

Extensible binary data format, like JSON but faster

Stars43
Forks16
Last commit4 years ago
cborcbor

OCaml CBOR generic decoder/encoder, RFC 7049, http://cbor.io/

Stars25
Forks11
Last commit4 years ago
Community-curated · Updated weekly · 100% open source

Found a gem we're missing?

Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.

Submit a projectStar on GitHub