Type Overrides
Map external crate types (or any Rust type) to custom TypeScript types via [codegen.type_overrides].
# metaxy.config.toml
[codegen.type_overrides]
"chrono::DateTime" = "string" # ISO 8601 strings
"chrono::NaiveDate" = "string"
"uuid::Uuid" = "string"
"serde_json::Value" = "unknown"
"rust_decimal::Decimal" = "string"
"url::Url" = "string"or via CLI
metaxy generate --type-override "chrono::DateTime=string" --type-override "uuid::Uuid=string"Example
use chrono::{DateTime, Utc};
use uuid::Uuid;
#[derive(Serialize)]
struct Event {
id: Uuid,
name: String,
created_at: DateTime<Utc>,
}// With type_overrides: chrono::DateTime = "string", uuid::Uuid = "string"
export interface Event {
id: string;
name: string;
created_at: string;
}Matching Rules
Override keys are matched against type names by their last path segment. For example, key "chrono::DateTime" matches both the fully-qualified chrono::DateTime<Utc> and the imported DateTime<Utc>. If you use fully-qualified paths in your Rust source, exact
full-path matching takes priority.
Overrides are applied before code generation — every occurrence of the matched type (including
inside Vec<T>, Option<T>, etc.) is replaced with the specified TypeScript type, and generic
parameters are stripped.