docsParity
colinhacks/zod43,229TypeScript

vs https://zod.dev/

The documentation is generally comprehensive and aligns well with the code API surface for Zod 4. However, there are several important mismatches where the docs either omit prominent APIs, describe deprecated features without warnings, or reference functionality that doesn't match the current code.

3 high7 medium0 low
Open issue with all findings ↗
12
Files analyzed
267
API symbols
3
Doc pages
44.4s
Analyzed in
9%
API coverage: Poorly documented
23 of 267 exported symbols mentioned in docs
4 deprecated APIs detected in code
  • $ZodCUIDParamspackages/zod/src/v4/core/api.ts
  • $ZodCheckCUIDParamspackages/zod/src/v4/core/api.ts
  • _cuidpackages/zod/src/v4/core/api.ts
  • _nativeEnumpackages/zod/src/v4/core/api.ts
12 source files inspected · claude-haiku-4-5-20251001 · Jul 10, 2026

10 mismatches found

01

z.iso object with namespace methods not clearly exported

packages/zod/src/v4/core/api.ts

high
In the code
(not documented)
In the docs
z.iso.date();
z.iso.time();
z.iso.datetime();
z.iso.duration();

The documentation uses `z.iso.date()`, `z.iso.time()`, `z.iso.datetime()`, and `z.iso.duration()` extensively, but the code API surface shows these as `_isoDate()`, `_isoTime()`, `_isoDateTime()`, and `_isoDuration()` functions with underscore prefixes. The docs don't explain how `z.iso` namespace is created or if these are internal functions with a public wrapper.

Suggested fix
Clarify in the docs whether z.iso is a namespace object with these methods, or update the examples to show the actual exported function names if they have underscore prefixes. Verify the public API exports z.iso properly.
02

z.codec() and bidirectional transformation APIs not in code API surface

packages/zod/src/v4/core/api.ts

high
In the code
(not documented)
In the docs
const stringToDate = z.codec(
  z.iso.datetime(),  // input schema: ISO date string
  z.date(),          // output schema: Date object
  {
    decode: (isoString) => new Date(isoString),
    encode: (date) => date.toISOString(),
  }
);

The documentation extensively covers the z.codec() API with examples, but the code API surface provided does not show any exports for z.codec(), z.decode(), z.encode(), or z.invertCodec(). These are supposed to be major Zod 4 features but are missing from the code listings.

Suggested fix
Verify that codec APIs are actually exported from the main Zod entry point. If they are, ensure they appear in the code API surface. If not, update the docs to note that this feature is not yet available or provide the correct import path.
03

z.stringFormat() API not documented

packages/zod/src/v4/core/api.ts

high
In the code
export function _stringFormat<Format extends string>(Class: typeof schemas.$ZodCustomStringFormat, format: Format, fnOrRegex: ((arg: string) => util.MaybeAsync<unknown>) | RegExp, _params: string | $ZodStringFormatParams = {}): schemas.$ZodCustomStringFormat<Format>
In the docs
(not documented)

The code exports a `_stringFormat()` function (L1802 in api.ts) that allows custom string format definition, which is documented in the "Custom formats" section of the docs as `z.stringFormat()`, but the actual exported function name in the code is `_stringFormat()` (with underscore prefix). This is a naming mismatch that could confuse developers trying to use the API.

Suggested fix
Verify whether the public API is `z.stringFormat()` or `_stringFormat()`. If it's `z.stringFormat()`, ensure it's properly exported through the main index. If it's `_stringFormat()`, update the docs to reflect the underscore prefix or confirm this is an internal API.
04

z.int64() and z.uint64() functions in code but no docs

packages/zod/src/v4/core/api.ts

medium
In the code
export function _int64<T extends schemas.$ZodBigIntFormat>(Class: util.SchemaClass<T>, params?: string | $ZodBigIntFormatParams): T  // L722

export function _uint64<T extends schemas.$ZodBigIntFormat>(Class: util.SchemaClass<T>, params?: string | $ZodBigIntFormatParams): T  // L735
In the docs
(not documented)

The code exports `_int64()` and `_uint64()` functions for validating 64-bit integers, but these are not mentioned anywhere in the documentation. This is a significant API gap that developers would not discover from the docs.

Suggested fix
Add documentation for z.int64() and z.uint64() in the BigInts section, similar to how z.int32() and z.uint32() are documented for numbers. Include examples showing validation ranges.
05

z.uuid() versions (v5, v8) documented but no corresponding code exports

packages/zod/src/v4/core/api.ts

medium
In the code
export function _uuidv4<...>(...): ...;
export function _uuidv6<...>(...): ...;
export function _uuidv7<...>(...): ...;
In the docs
// supports "v1", "v2", "v3", "v4", "v5", "v6", "v7", "v8"
z.uuid({ version: "v4" });

The documentation states that z.uuid() supports versions v1, v2, v3, v4, v5, v6, v7, and v8, and shows convenience methods for v4, v6, and v7. However, the code API surface only exports _uuidv4, _uuidv6, and _uuidv7. There are no exports for v1, v2, v3, v5, or v8 versions.

Suggested fix
Update the docs to reflect which UUID versions are actually supported (v4, v6, v7) and remove claims about v1, v2, v3, v5, v8 support unless those functions are actually exported.
06

z.nativeEnum() is documented but marked as deprecated without migration guidance

packages/zod/src/v4/core/api.ts

medium
In the code
Use `z.enum()` for externally declared TypeScript enums. The `z.nativeEnum()` API is deprecated.
In the docs
Use `z.nativeEnum()` API is deprecated.

Note that using TypeScript's `enum` keyword is [not recommended](https://www.totaltypescript.com/why-i-dont-like-typescript-enums).

The docs mention z.nativeEnum() is deprecated but don't provide clear guidance on the transition. The code shows both z.enum() and z.nativeEnum() are exported from api.ts, but the documentation only briefly notes the deprecation without showing a migration example from nativeEnum to enum.

Suggested fix
Add a migration example: 'z.nativeEnum() is deprecated. Use z.enum() instead: z.enum(Object.values(MyEnum)) or pass the enum directly to z.enum(MyEnum).'
07

z.promise() marked as deprecated but docs don't warn users to stop using it

packages/zod/src/v4/core/api.ts

medium
In the code
**Deprecated** — `z.promise()` is deprecated.
In the docs
**Deprecated** — `z.promise()` is deprecated. There are vanishingly few valid uses cases for a `Promise` schema. If you suspect a value might be a `Promise`, simply `await` it before parsing it with Zod.

The code API surface shows `z.promise()` exists and is exported, but the documentation only mentions it's deprecated without providing a migration path or clear guidance on what to use instead. Users reading the docs would see the deprecation warning but have no clear alternative pattern to follow.

Suggested fix
Add a dedicated section explaining that promise validation is now deprecated and provide clear alternatives. For example: 'Instead of validating promises, `await` the promise before parsing: `const result = await maybePromise; const validated = schema.parse(result);`'
08

z.regexes object referenced in docs but not exported in code

medium
In the code
(not documented)
In the docs
// Zod's default email regex
z.email();
z.email({ pattern: z.regexes.email }); // equivalent

// the regex used by browsers to validate input[type=email] fields
z.email({ pattern: z.regexes.html5Email });

The docs reference `z.regexes.email`, `z.regexes.html5Email`, `z.regexes.rfc5322Email`, `z.regexes.unicodeEmail`, and `z.regexes.domain` multiple times, but these are not shown in the code API surface exports. It's unclear if this object is exported or if the docs are outdated.

Suggested fix
Verify that z.regexes is exported from the main API. If not, update the docs to remove these examples or provide the regex patterns directly in code comments.
09

z.httpUrl() documented but not in code API surface

medium
In the code
(not documented)
In the docs
z.url();
z.httpUrl();       // http or https URLs only

The docs mention `z.httpUrl()` as a convenience method, but this is not found in the code API surface. The docs show an alternative recommended pattern using `z.url({ protocol: /^https?$/, ... })` but don't clarify if `z.httpUrl()` is a direct export or just a recommended pattern.

Suggested fix
Either export z.httpUrl() as a convenience function, or update the docs to remove it and only show the explicit z.url() configuration pattern with protocol and hostname options.
10

z.hash() API mentioned in docs but not clearly exported in code

medium
In the code
(not documented)
In the docs
z.hash("md5");
z.hash("sha1");
z.hash("sha256");
z.hash("sha384");
z.hash("sha512");

The documentation provides examples of z.hash() for validating cryptographic hashes, but this function is not found in the provided code API surface (api.ts). It's unclear whether this is exported elsewhere or if the docs describe an unimplemented feature.

Suggested fix
Verify that z.hash() is exported and available in the public API. If it's not implemented, update the docs to remove or mark as coming soon. If it is implemented, ensure it's exported from the main entry point.