Schemas for JSON optimized for code generation

JSON Type Definition, aka RFC 8927, is an easy-to-learn, portable, and standardized way to describe the shape of your JSON data.

user.jtd.json
{
  "properties": {
    "id": { "type": "string" },
    "createdAt": { "type": "timestamp" },
    "karma": { "type": "int32" },
    "isAdmin": { "type": "boolean" }
  }
}
export interface User {
  createdAt: string;
  id: string;
  isAdmin: boolean;
  karma: number;
}

Use JSON Typedef with the language of your choice

Why JSON Typedef?

A better way to work with JSON

JSON Type Definition is a lightweight schema language for JSON data. Describe the shape of your data once, and get portable validators and types across many languages.

Tiny and Easy to Learn

Most developers can learn the entire JSON Typedef specification in about five to ten minutes.

Portable and Specific Errors

Specific validation errors are part of the JTD spec. Every implementation returns the same errors.

Powerful Code Generation

The jtd-codegen tool can consistently generate code in many programming languages from any schema.

Easy Onboarding

Want to add JSON Typedef to an existing system? jtd-infer can generate a schema from examples of your data.

Mocking and Fuzzing

Once you have a schema, jtd-fuzz can generate mocks of your data. Generate seed data or load-testing workloads with ease.

Easy to Embed

JSON Typedef schemas are just plain old JSON, so you can embed them in your organization's JSON (or YAML) custom tools.

Ready to be more productive with JSON? Dig into the docs.