Skip to content

SchemaBridge

One source of truth for your schemas.

SchemaBridge is a cross‑language schema generator. You define your data models once with Zod in TypeScript, and SchemaBridge generates:

  • Python Pydantic models for your backend.
  • TypeScript .d.ts types to keep the rest of your TS code in sync.

That means a single source of truth for validation, types, and runtime models—no more hand‑maintained copies.

Input (TypeScript, Zod)

import { z } from 'zod';
export const userSchema = z.object({
id: z.string().uuid(),
email: z.string().email(),
createdAt: z.date(),
});

Output (Python, Pydantic)

from pydantic import BaseModel
from uuid import UUID
from datetime import datetime
class UserSchema(BaseModel):
id: UUID
email: str
createdAt: datetime
  • CLI – convert a single schema or an entire folder:
Terminal window
schemabridge convert zod schema.ts --export userSchema --to pydantic --out user.py
schemabridge convert folder ./src/schemas --out ./generated --to pydantic --init
  • Node API – call SchemaBridge from build scripts and tooling.
  • Playground – paste a schema and see the generated code side‑by‑side.
  • Start with Getting Started to install and run your first conversion.
  • Browse the API Reference if you want to embed SchemaBridge in your own tools.
  • Open the Playground to experiment with schemas and see the output live.