8 mismatches found
01Deprecated message parameter not documented for removal
packages/zod/src/v4/core/api.ts
highIn the code
/** @deprecated This parameter is deprecated. Use `error` instead. */ message?: string | undefined; // supported in Zod 3
In the docs
(not documented)
The code marks a `message` parameter as deprecated in favor of `error` in type definitions for Params, but the documentation does not warn users about this deprecation or provide migration guidance. Developers using the old `message` parameter would not know it's deprecated.
Suggested fix
Add a deprecation notice to the documentation explaining that the `message` parameter in error customization is deprecated in favor of `error`, and provide examples of the correct usage.
02z.nativeEnum() documented as deprecated but implementation unclear
packages/zod/src/v4/core/api.ts
mediumIn the code
export function _nativeEnum<T extends util.EnumLike>(Class: util.SchemaClass<schemas.$ZodEnum>, entries: T, params?: string | $ZodEnumParams): schemas.$ZodEnum<T>
In the docs
Use `z.enum()` for externally declared TypeScript enums. The `z.nativeEnum()` API is deprecated.
The documentation states that `z.nativeEnum()` is deprecated in favor of `z.enum()`, but the code still exports `_nativeEnum()`. The docs don't provide a migration example or explain what users should do with existing code using z.nativeEnum().
Suggested fix
Add a migration example showing how to convert code from `z.nativeEnum(MyEnum)` to the new `z.enum(MyEnum)` pattern, and ensure the exported symbol has a clear deprecation warning in comments.
03stringFormat API signature mismatch
packages/zod/src/v4/core/api.ts
mediumIn 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
const coolId = z.stringFormat("cool-id", (val)=>{ return val.length === 100 && val.startsWith("cool-"); });
The code shows `_stringFormat` requires a Class parameter as the first argument, but the documentation shows usage as `z.stringFormat(format, fnOrRegex)` without the Class parameter. This suggests either the documented API is an intermediate wrapper or the signature documentation is incomplete about internal implementation details.
Suggested fix
Clarify in the documentation whether `z.stringFormat()` is a public convenience method that wraps the internal `_stringFormat()` function, or update the example to show how Class is actually obtained/used by end users.
In the code
(not documented in code as deprecated marker)
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 documentation marks z.promise() as deprecated and explains why, which is good. However, the actual code does not appear to have a clear `@deprecated` marker in the exported signature based on the provided API surface, making it unclear to developers importing the symbol whether it's truly deprecated.
Suggested fix
Ensure the z.promise() export in the code is marked with `@deprecated` comments/JSDoc so IDEs can warn users at development time, matching the deprecation status indicated in the documentation.
05Internal Type Params APIs not documented
packages/zod/src/v4/core/api.ts
lowIn the code
export type Params< T extends schemas.$ZodType | checks.$ZodCheck, IssueTypes extends errors.$ZodIssueBase, OmitKeys extends keyof T["_zod"]["def"] = never, > = ...
In the docs
(not documented)
The code exports numerous internal type parameter types (Params, TypeParams, CheckParams, StringFormatParams, etc.) that are part of the public API surface but are not documented. These are likely used by advanced users extending Zod, but are completely undocumented.
Suggested fix
Document these advanced type utilities in an 'Advanced' or 'TypeScript' section, explaining their purpose and typical use cases for schema extension and customization.
06Undocumented internal check functions exported
packages/zod/src/v4/core/api.ts
lowIn 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 `_check()` function but it is not mentioned in the documentation. While `.check()` is documented under refinements, the standalone `_check()` function and its use cases are not explained.
Suggested fix
Document `z.check()` in the Refinements section, explaining how it differs from `.refine()` and `.superRefine()`, and when developers should use it.
In the code
(promise-related exports not clearly shown in code surface)
In the docs
**Deprecated** — `z.promise()` is deprecated... ### See z.promise() documentation
The documentation has a 'Promises' section that marks the entire API as deprecated and says 'See z.promise() documentation', but there is no visible linked section showing actual z.promise() API details or examples. This leaves developers unsure of the exact deprecated API.
Suggested fix
Either remove the Promises section entirely from the docs, or add a subsection showing the exact signature of z.promise() for reference before the deprecation notice.
08TimePrecision export not documented
packages/zod/src/v4/core/api.ts
lowIn the code
export const TimePrecision
In the docs
(not documented)
The code exports a `TimePrecision` constant from api.ts, but it is never documented or explained. Its type and purpose are unclear from the code snippet alone.
Suggested fix
Document what `TimePrecision` is, how it's used, and provide an example of its usage in the ISO datetime/time validation sections.