docsParity
colinhacks/zod42,836TypeScript

vs https://zod.dev/

The documentation is comprehensive and generally accurate. However, there are several undocumented or inadequately documented features in the code API that developers should be aware of, particularly around internal type parameter utilities, core API functions, and some advanced schema methods.

0 high4 medium5 low
Open issue with all findings ↗
12
Files analyzed
267
API symbols
5
Doc pages
50.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 · Jun 2, 2026

9 mismatches found

01

Deprecated `message` parameter not documented with migration guidance

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

medium
In the code
/** @deprecated This parameter is deprecated. Use `error` instead. */ message?: string | undefined;
In the docs
Replace `message` with `error`. (The `message` parameter is still supported but deprecated.)

The code shows `message` is marked `@deprecated` in favor of `error`, and the docs mention this replacement once in the 'Simplified error customization' section. However, the docs do not provide a comprehensive migration guide or warning that developers using the old API should update their code. The deprecation warning in the code is more prominent than in the documentation.

Suggested fix
Add a dedicated migration section or warning in the error customization documentation explaining that `message` is deprecated, showing side-by-side examples of old vs. new syntax, and recommending developers update their code before the parameter is removed in Zod 5.
02

Internal type parameter utilities (Params, TypeParams, CheckParams, etc.) are undocumented

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

medium
In the code
export type Params< T extends schemas.$ZodType | checks.$ZodCheck, IssueTypes extends errors.$ZodIssueBase, OmitKeys extends keyof T["_zod"]["def"] = never, > = util.Flatten< ... >;
In the docs
(not documented)

The code exports several advanced type parameter utilities like `Params`, `TypeParams`, `CheckParams`, `StringFormatParams`, and `CheckTypeParams` used throughout the core/api.ts module. These are part of the public API surface but are not documented in the provided documentation. Developers attempting to use or extend Zod's core may be confused about how to use these types.

Suggested fix
Add documentation explaining these type parameter utilities in the 'Zod Core' or API reference section, clarifying their purpose and when extension developers would need to use them.
03

Undocumented string format functions and custom regex support

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

medium
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 `_stringFormat` function for creating custom string formats, but the documentation does not mention how developers can create their own custom string format validators beyond the built-in ones (email, uuid, etc.). The release notes mention custom email regex, but don't explain how to define entirely new string formats.

Suggested fix
Add a section in the API documentation explaining how to create custom string formats using the exported functions, with clear examples.
04

Undocumented `_check` function and its relationship to custom checks

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

medium
In the code
export function _check<O = unknown>(fn: schemas.CheckFn<O>, params?: string | $ZodCustomParams): checks.$ZodCheck<O>
In the docs
(not documented)

The code exports a `_check` function for creating custom checks, which appears to be related to or similar to `.refine()`, but this function is not documented anywhere. The purpose and use case distinction between `_check` and other refinement APIs is unclear.

Suggested fix
Document the `_check` function in the 'Custom checks' or 'Refinements' section, explaining how it differs from `.refine()`, `.superRefine()`, etc., and when developers should use it.
05

Undocumented `_string`, `_coercedString` and related internal creator functions

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

low
In the code
export function _string<T extends schemas.$ZodString>(Class: util.SchemaClass<T>, params?: string | $ZodStringParams): T
export function _coercedString<T extends schemas.$ZodString>(Class: util.SchemaClass<T>, params?: string | $ZodStringParams): T
In the docs
(not documented)

The code exports internal functions like `_string`, `_coercedString`, `_number`, `_coercedNumber`, etc. that are used to create schema instances. These functions are not mentioned in the documentation, though they may be used internally or by library authors extending Zod. Their naming convention (underscore prefix) suggests they may be internal, but they are explicitly exported from the public API.

Suggested fix
Clarify in the 'For library authors' documentation whether these functions are intended for internal use only or if they should be used by extension developers, and document their purpose if they are part of the public extension API.
06

Undocumented `describe` and `meta` check functions

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

low
In the code
export function describe<T>(description: string): checks.$ZodCheck<T>
export function meta<T>(metadata: registries.GlobalMeta): checks.$ZodCheck<T>
In the docs
For compatibility with Zod 3, `.describe()` is still available, but `.meta()` is preferred.

The code exports standalone `describe` and `meta` functions (which return checks), but the documentation only mentions `.describe()` and `.meta()` as methods on schemas. The functional API variants are not explicitly documented, though they are part of the public API.

Suggested fix
Clarify in the Zod Mini or API documentation that `describe()` and `meta()` are available as standalone functions and show functional API examples alongside the method examples.
07

Undocumented `_overwrite`, `_normalize`, `_trim`, `_toLowerCase`, `_toUpperCase`, `_slugify` functions

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

low
In the code
export function _overwrite<T>(tx: (input: T) => T): checks.$ZodCheckOverwrite<T>
export function _normalize(form?: "NFC" | "NFD" | "NFKC" | "NFKD" | (string & {})): checks.$ZodCheckOverwrite<string>
export function _trim(): checks.$ZodCheckOverwrite<string>
export function _toLowerCase(): checks.$ZodCheckOverwrite<string>
export function _toUpperCase(): checks.$ZodCheckOverwrite<string>
export function _slugify(): checks.$ZodCheckOverwrite<string>
In the docs
z.trim();
z.toLowerCase();
z.toUpperCase();

While the docs mention `.trim()`, `.toLowerCase()`, and `.toUpperCase()` as methods in the Zod Mini section and show them as part of the functional API, the code exports internal functions `_trim`, `_toLowerCase`, `_toUpperCase`, `_normalize`, `_overwrite`, and `_slugify`. The underscore-prefixed functions are the actual implementation, but the docs don't explain how or where `_slugify` and `_normalize` fit into the public API or if they are accessible to users.

Suggested fix
Document `_normalize` and `_slugify` in the Zod Mini API section or clarify if these are for internal use only. If they are public, provide examples of how to use them in Zod Mini.
08

Zod v3 compatibility imports documented but actual v3 API not fully detailed

packages/zod/src/v3/index.ts

low
In the code
// FILE: packages/zod/src/v3/index.ts
export * from "./external.js"
export { z }
export default z
In the docs
Zod is tested against _TypeScript v5.5_ and later.

The code exports Zod v3 as a separate entry point, and the docs mention migration from v3 to v4, but there is no detailed documentation on what changed in the v3 API compared to v4, making it hard for developers still on v3 to understand migration paths.

Suggested fix
Link the migration guide more prominently from the intro page and ensure it covers the major v3→v4 breaking changes in detail.
09

Undocumented TimePrecision export

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

low
In the code
export const TimePrecision
In the docs
(not documented)

The code exports `TimePrecision` as a const (line 501) but its type and purpose are not shown in the code snippet and are not documented. It is referenced in relation to ISO datetime formats but its usage is unclear.

Suggested fix
Add documentation or a note in the ISO datetime formats section explaining what `TimePrecision` is and how to use it (e.g., type declaration, examples).