| Crates.io | zod_gen |
| lib.rs | zod_gen |
| version | 1.2.0 |
| created_at | 2025-07-25 13:45:33.736972+00 |
| updated_at | 2025-12-05 11:44:35.904069+00 |
| description | Generate Zod schemas and TypeScript types from Rust types. Use with zod_gen_derive for automatic #[derive(ZodSchema)] support and serde rename compatibility. |
| homepage | https://github.com/cimatic/zod_gen |
| repository | https://github.com/cimatic/zod_gen |
| max_upload_size | |
| id | 1767626 |
| size | 13,612 |
Core library for generating Zod schemas from Rust types.
ZodSchema trait for defining schemasZodGenerator for batch file generationuse 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.