Skip to content

Advanced Schemas

Advanced schemas handle specialized data like dates, network addresses, identifiers, and files. They're self-contained but can nest with primitives/composites.

Each supports:

  • Core Methods: .parse(value) and .safe(value).
  • Type Inference: Infer<typeof schema> for exact types.
  • Chains: Specific methods (e.g., .ipv4() for IP).
  • Date – Temporal validation with coercion.
  • IP – IPv4/IPv6 addresses.
  • UUID – Standard UUID format.
  • File – Upload validation (size, MIME).

Pro Tip: Combine with utilities, e.g., v.optional(v.date().future()) for optional expiry dates.


Last updated: October 23, 2025.

MIT Licensed | Copyright © 2025 ManojKumar2920