typeshift 0.5.1

Zod-like parse, validation, and JSON Schema flow for Rust types
Documentation
//! `typeshift` facade crate.
//!
//! This crate provides a Zod-like parse workflow using idiomatic Rust types.
//! Use `#[typeshift]` on your struct or enum, then use:
//! - [`parse_str`] for parse + validate
//! - [`to_json`] for serialization
//! - [`schema_json`] for JSON Schema export
//!
//! Many `#[validate(...)]` field attributes are reflected in schema output via
//! `schemars` (such as `email`, `url`, `length`, `range`, and `regex`).
//!
//! # Example
//!
//! ```rust
//! use typeshift::typeshift;
//!
//! #[typeshift]
//! struct User {
//!     #[validate(length(min = 3))]
//!     name: String,
//! }
//!
//! fn main() -> Result<(), Box<dyn std::error::Error>> {
//!     let user: User = typeshift::parse_str(r#"{"name":"Ada"}"#)?;
//!     let json = typeshift::to_json(&user)?;
//!     let schema = typeshift::schema_json::<User>();
//!
//!     assert_eq!(json, r#"{"name":"Ada"}"#);
//!     assert_eq!(schema["type"], "object");
//!     Ok(())
//! }
//! ```

/// Core trait and runtime helpers.
pub use typeshift_core::*;

/// Attribute macro that adds serde, validator, and schemars derives.
pub use typeshift_derive::typeshift;

/// Legacy compatibility derive.
///
/// This derive is a no-op compatibility marker. Prefer `#[typeshift]`.
pub use typeshift_derive::TypeShift;