zod_gen

Crates.iozod_gen
lib.rszod_gen
version1.2.0
created_at2025-07-25 13:45:33.736972+00
updated_at2025-12-05 11:44:35.904069+00
descriptionGenerate Zod schemas and TypeScript types from Rust types. Use with zod_gen_derive for automatic #[derive(ZodSchema)] support and serde rename compatibility.
homepagehttps://github.com/cimatic/zod_gen
repositoryhttps://github.com/cimatic/zod_gen
max_upload_size
id1767626
size13,612
RSA (github:rustcrypto:rsa)

documentation

https://docs.rs/zod_gen

README

zod_gen

Crates.io Documentation

Core library for generating Zod schemas from Rust types.

Features

  • ZodSchema trait for defining schemas
  • Helper functions for building Zod expressions
  • ZodGenerator for batch file generation
  • Built-in implementations for primitive types

Usage

use zod_gen::{ZodSchema, zod_object, zod_string, zod_number};

struct User {
    id: u64,
    name: String,
}

impl ZodSchema for User {
    fn type_name() -> String { "User".to_string() }
    fn zod_schema() -> String {
        zod_object(&[
            ("id", zod_number()),
            ("name", zod_string()),
        ])
    }
}

For more examples and documentation, see the main repository.

Commit count: 0

cargo fmt