@orval/zod 8.16.0 → 8.17.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.mjs +10 -10
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
package/dist/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { buildDynamicScope, camel, compareVersions,
|
|
1
|
+
import { buildDynamicScope, camel, compareVersions, generateMutator, getDynamicAnchorName, getFormDataFieldFileType, getNumberWord, getRefInfo, isBoolean, isDynamicReference, isNumber, isObject, isString, jsStringEscape, jsStringLiteralEscape, logVerbose, pascal, resolveDynamicRef, resolveRef, stringify } from "@orval/core";
|
|
2
2
|
import { unique } from "remeda";
|
|
3
3
|
//#region src/compatible-v4.ts
|
|
4
4
|
const getZodPackageVersion = (packageJson) => {
|
|
@@ -262,11 +262,11 @@ const generateZodValidationSchemaDefinition = (schema, context, name, strict, is
|
|
|
262
262
|
if (schema.default !== void 0) {
|
|
263
263
|
defaultVarName = `${name}Default${constsCounterValue}`;
|
|
264
264
|
let defaultValue;
|
|
265
|
-
if (schema.type === "string" && (schema.format === "date" || schema.format === "date-time") && context.output.override.useDates) defaultValue = `new Date(
|
|
265
|
+
if (schema.type === "string" && (schema.format === "date" || schema.format === "date-time") && context.output.override.useDates) defaultValue = `new Date(${JSON.stringify(schema.default)})`;
|
|
266
266
|
else if (isObject(schema.default)) {
|
|
267
267
|
const entries = Object.entries(schema.default).map(([key, value]) => {
|
|
268
|
-
if (isString(value)) return `${key}:
|
|
269
|
-
if (Array.isArray(value)) return `${key}: [${value.map((item) => isString(item) ?
|
|
268
|
+
if (isString(value)) return `${key}: ${JSON.stringify(value)} as const`;
|
|
269
|
+
if (Array.isArray(value)) return `${key}: [${value.map((item) => isString(item) ? `${JSON.stringify(item)} as const` : `${item}`).join(", ")}]`;
|
|
270
270
|
if (value === null || value === void 0 || isNumber(value) || isBoolean(value)) return `${key}: ${value}`;
|
|
271
271
|
}).join(", ");
|
|
272
272
|
defaultValue = entries.length === 0 ? `{}` : `{ ${entries} }`;
|
|
@@ -356,17 +356,17 @@ const generateZodValidationSchemaDefinition = (schema, context, name, strict, is
|
|
|
356
356
|
}
|
|
357
357
|
if (isZodV4) {
|
|
358
358
|
if (!predefinedZodFormats.has(schema.format ?? "")) {
|
|
359
|
-
if ("const" in schema) functions.push(["literal",
|
|
359
|
+
if ("const" in schema) functions.push(["literal", JSON.stringify(String(schema.const))]);
|
|
360
360
|
else if (schema.pattern && schema.format) {
|
|
361
361
|
const isStartWithSlash = schema.pattern.startsWith("/");
|
|
362
362
|
const isEndWithSlash = schema.pattern.endsWith("/");
|
|
363
363
|
const regexp = `new RegExp('${jsStringLiteralEscape(schema.pattern.slice(isStartWithSlash ? 1 : 0, isEndWithSlash ? -1 : void 0))}')`;
|
|
364
364
|
consts.push(`export const ${name}RegExp${constsCounterValue} = ${regexp};\n`);
|
|
365
|
-
functions.push(["stringFormat", [`'${
|
|
365
|
+
functions.push(["stringFormat", [`'${jsStringLiteralEscape(schema.format)}'`, `${name}RegExp${constsCounterValue}`]]);
|
|
366
366
|
} else functions.push([type, void 0]);
|
|
367
367
|
break;
|
|
368
368
|
}
|
|
369
|
-
} else if ("const" in schema) functions.push(["literal",
|
|
369
|
+
} else if ("const" in schema) functions.push(["literal", JSON.stringify(String(schema.const))]);
|
|
370
370
|
else functions.push([type, void 0]);
|
|
371
371
|
if (schema.format === "date") {
|
|
372
372
|
const formatAPI = getZodDateFormat(isZodV4);
|
|
@@ -472,14 +472,14 @@ const generateZodValidationSchemaDefinition = (schema, context, name, strict, is
|
|
|
472
472
|
const isEndWithSlash = matches.endsWith("/");
|
|
473
473
|
const regexp = `new RegExp('${jsStringLiteralEscape(matches.slice(isStartWithSlash ? 1 : 0, isEndWithSlash ? -1 : void 0))}')`;
|
|
474
474
|
consts.push(`export const ${name}RegExp${constsCounterValue} = ${regexp};\n`);
|
|
475
|
-
if (schema.format && !predefinedZodFormats.has(schema.format) && isZodV4) functions.push(["stringFormat", [`'${
|
|
475
|
+
if (schema.format && !predefinedZodFormats.has(schema.format) && isZodV4) functions.push(["stringFormat", [`'${jsStringLiteralEscape(schema.format)}'`, `${name}RegExp${constsCounterValue}`]]);
|
|
476
476
|
else functions.push(["regex", `${name}RegExp${constsCounterValue}`]);
|
|
477
477
|
}
|
|
478
478
|
if (schema.enum && type !== "array") {
|
|
479
479
|
const uniqueEnumValues = unique(schema.enum);
|
|
480
|
-
if (uniqueEnumValues.every((value) => isString(value))) functions.push(["enum", `[${uniqueEnumValues.map((value) => `'${
|
|
480
|
+
if (uniqueEnumValues.every((value) => isString(value))) functions.push(["enum", `[${uniqueEnumValues.map((value) => `'${jsStringLiteralEscape(value)}'`).join(", ")}]`]);
|
|
481
481
|
else functions.push(["oneOf", uniqueEnumValues.map((value) => ({
|
|
482
|
-
functions: [["literal", isString(value) ? `'${
|
|
482
|
+
functions: [["literal", isString(value) ? `'${jsStringLiteralEscape(value)}'` : value]],
|
|
483
483
|
consts: []
|
|
484
484
|
}))]);
|
|
485
485
|
}
|
package/dist/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","names":[],"sources":["../src/compatible-v4.ts","../src/index.ts"],"sourcesContent":["import { compareVersions, type PackageJson } from '@orval/core';\n\nconst getZodPackageVersion = (packageJson: PackageJson) => {\n return (\n packageJson.resolvedVersions?.zod ??\n packageJson.dependencies?.zod ??\n packageJson.devDependencies?.zod ??\n packageJson.peerDependencies?.zod\n );\n};\n\nexport const isZodVersionV4 = (packageJson: PackageJson) => {\n const version = getZodPackageVersion(packageJson);\n\n if (!version) {\n return false;\n }\n\n const withoutRc = version.split('-')[0];\n\n return compareVersions(withoutRc, '4.0.0');\n};\n\nexport const getZodDateFormat = (isZodV4: boolean) => {\n return isZodV4 ? 'iso.date' : 'date';\n};\n\nexport const getZodTimeFormat = (isZodV4: boolean) => {\n return isZodV4 ? 'iso.time' : 'time';\n};\n\nexport const getZodDateTimeFormat = (isZodV4: boolean) => {\n return isZodV4 ? 'iso.datetime' : 'datetime';\n};\n\ntype ParameterDefinitions = Record<string, unknown>;\ntype ParameterFunction = [string, ParameterDefinitions | undefined];\nexport const getParameterFunctions = (\n isZodV4: boolean,\n strict: boolean,\n parameters: ParameterDefinitions,\n): ParameterFunction[] => {\n if (isZodV4 && strict) {\n return [['strictObject', parameters]];\n } else {\n return strict\n ? [\n ['object', parameters],\n ['strict', undefined],\n ]\n : [['object', parameters]];\n }\n};\n\nexport const getObjectFunctionName = (isZodV4: boolean, strict: boolean) => {\n return isZodV4 && strict ? 'strictObject' : 'object';\n};\n\n/**\n * Returns the object constructor to use for open/generic objects.\n *\n * - Zod v4 supports `zod.looseObject({...})` directly.\n * - Zod v3 falls back to `zod.object({...})` and is finalized with\n * `.passthrough()` during parsing.\n */\nexport const getLooseObjectFunctionName = (isZodV4: boolean) => {\n return isZodV4 ? 'looseObject' : 'object';\n};\n","/* eslint-disable unicorn/no-array-reduce */\n\nimport {\n buildDynamicScope,\n camel,\n type ClientBuilder,\n type ClientGeneratorsBuilder,\n type ContextSpec,\n escape,\n generateMutator,\n type GeneratorDependency,\n type GeneratorMutator,\n type GeneratorOptions,\n type GeneratorVerbOptions,\n getDynamicAnchorName,\n getFormDataFieldFileType,\n getNumberWord,\n getRefInfo,\n isBoolean,\n isDynamicReference,\n isNumber,\n isObject,\n isString,\n jsStringEscape,\n jsStringLiteralEscape,\n logVerbose,\n type OpenApiParameterObject,\n type OpenApiReferenceObject,\n type OpenApiRequestBodyObject,\n type OpenApiResponseObject,\n type OpenApiSchemaObject,\n pascal,\n resolveDynamicRef,\n resolveRef,\n stringify,\n type ZodCoerceType,\n} from '@orval/core';\nimport { unique } from 'remeda';\n\nimport {\n getLooseObjectFunctionName,\n getObjectFunctionName,\n getParameterFunctions,\n getZodDateFormat,\n getZodDateTimeFormat,\n getZodTimeFormat,\n isZodVersionV4,\n} from './compatible-v4';\n\nconst ZOD_DEPENDENCIES: GeneratorDependency[] = [\n {\n exports: [\n {\n default: false,\n name: 'zod',\n syntheticDefaultImport: false,\n namespaceImport: true,\n values: true,\n },\n ],\n dependency: 'zod',\n },\n];\n\nexport const getZodDependencies = () => ZOD_DEPENDENCIES;\n\n/**\n * values that may appear in \"type\". Equals SchemaObjectType\n */\nconst possibleSchemaTypes = new Set([\n 'integer',\n 'number',\n 'string',\n 'boolean',\n 'object',\n 'strictObject',\n 'null',\n 'array',\n]);\n\nexport const predefinedZodFormats = new Set([\n 'date',\n 'time',\n 'date-time',\n 'email',\n 'uri',\n 'hostname',\n 'uuid',\n]);\n\ntype ResolvedZodType =\n | string\n | {\n multiType: string[];\n };\n\nconst resolveZodType = (schema: OpenApiSchemaObject): ResolvedZodType => {\n const schemaTypeValue = schema.type as unknown;\n\n // Handle array of types (OpenAPI 3.1+)\n if (Array.isArray(schemaTypeValue)) {\n // Filter out 'null' type as it's handled separately via nullable\n const nonNullTypes = schemaTypeValue\n .filter((t): t is string => isString(t))\n .filter((t) => t !== 'null' && possibleSchemaTypes.has(t))\n .map((t) => (t === 'integer' ? 'number' : t));\n\n // If multiple types, return a special marker for union handling\n if (nonNullTypes.length > 1) {\n return { multiType: nonNullTypes };\n }\n\n // Single type\n const type = nonNullTypes[0];\n\n // Handle prefixItems for tuples\n if (type === 'array' && 'prefixItems' in schema) {\n return 'tuple';\n }\n\n return type;\n }\n\n // Handle single type value\n const type = isString(schemaTypeValue) ? schemaTypeValue : undefined;\n\n // TODO: if \"prefixItems\" exists and type is \"array\", then generate a \"tuple\"\n if (schema.type === 'array' && 'prefixItems' in schema) {\n return 'tuple';\n }\n\n switch (type) {\n case 'integer': {\n return 'number';\n }\n default: {\n return type ?? 'unknown';\n }\n }\n};\n\n// https://github.com/colinhacks/zod#coercion-for-primitives\nconst COERCIBLE_TYPES = new Set([\n 'string',\n 'number',\n 'boolean',\n 'bigint',\n 'date',\n]);\n\nexport interface ZodValidationSchemaDefinition {\n functions: [string, unknown][];\n consts: string[];\n}\n\nconst minAndMaxTypes = new Set(['number', 'string', 'array']);\n\nconst removeReadOnlyProperties = (\n schema: OpenApiSchemaObject,\n): OpenApiSchemaObject => {\n if (schema.properties && isObject(schema.properties)) {\n const filteredProperties: Record<string, OpenApiSchemaObject> = {};\n\n for (const [key, value] of Object.entries(schema.properties)) {\n if (isObject(value) && 'readOnly' in value && value.readOnly) {\n continue;\n }\n filteredProperties[key] = value as OpenApiSchemaObject;\n }\n\n return {\n ...(schema as Record<string, unknown>),\n properties: filteredProperties,\n };\n }\n if (schema.items && isObject(schema.items) && 'properties' in schema.items) {\n return {\n ...(schema as Record<string, unknown>),\n items: removeReadOnlyProperties(schema.items as OpenApiSchemaObject),\n };\n }\n return schema;\n};\n\ninterface DateTimeOptions {\n offset?: boolean;\n local?: boolean;\n precision?: number;\n}\n\ninterface TimeOptions {\n precision?: -1 | 0 | 1 | 2 | 3;\n}\n\n/* eslint-disable @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-argument, @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-call */\n\nconst COMPONENT_SCHEMAS_REF_PATTERN = /^#\\/components\\/schemas\\/[^/]+$/;\n\nconst isComponentSchemaRef = (ref: string): boolean =>\n COMPONENT_SCHEMAS_REF_PATTERN.test(ref);\n\nexport const generateZodValidationSchemaDefinition = (\n schema: OpenApiSchemaObject | OpenApiReferenceObject | undefined,\n context: ContextSpec,\n name: string,\n strict: boolean,\n isZodV4: boolean,\n rules?: {\n required?: boolean;\n /**\n * Required keys inherited from sibling `allOf` members. Per JSON Schema /\n * OpenAPI 3.1, a `required` array in one `allOf` member applies to\n * properties contributed by ANY member, so it is collected at the `allOf`\n * level and applied here. Consumed at THIS object level only — never\n * forwarded into nested property schemas, so a deeper object sharing a key\n * name is unaffected. (#3171)\n */\n additionalRequired?: string[];\n dateTimeOptions?: DateTimeOptions;\n timeOptions?: TimeOptions;\n /**\n * Override schemas for properties at THIS level only.\n * Not passed to nested schemas. Used by form-data for file type handling.\n */\n propertyOverrides?: Record<string, ZodValidationSchemaDefinition>;\n /**\n * Internal registry to keep generated const names unique within a single\n * schema generation tree without leaking suffixes across unrelated top-level\n * schemas.\n */\n constNameRegistry?: Record<string, number>;\n /**\n * When true, plain `$ref`s into `#/components/schemas/*` emit a `namedRef`\n * placeholder instead of being inlined.\n */\n useReusableSchemas?: boolean;\n /**\n * When true (and `isZodV4`), the top-level (named component) schema emits a\n * `.meta({ id, description?, deprecated? })` instead of `.describe(...)`.\n * Set ONLY for top-level component-schema generation — recursive calls omit\n * it, so nested schemas keep `.describe()` and never get a duplicate `id`.\n */\n emitMeta?: boolean;\n },\n): ZodValidationSchemaDefinition => {\n if (!schema) return { functions: [], consts: [] };\n\n const CHAINABLE_SIBLINGS = new Set(['nullable', 'default', 'description']);\n const isChainable = (k: string) => CHAINABLE_SIBLINGS.has(k);\n\n const applyChainableSiblings = (\n functions: [string, unknown][],\n consts: string[],\n siblingSchema: OpenApiSchemaObject & {\n nullable?: boolean;\n default?: unknown;\n description?: string;\n },\n ): void => {\n const refRequired = rules?.required ?? false;\n const refHasDefault = siblingSchema.default !== undefined;\n\n if (!refRequired && siblingSchema.nullable) {\n functions.push(['nullish', undefined]);\n } else if (siblingSchema.nullable) {\n functions.push(['nullable', undefined]);\n } else if (!refRequired && !refHasDefault) {\n functions.push(['optional', undefined]);\n }\n\n if (refHasDefault) {\n const registry = rules?.constNameRegistry ?? {};\n const counter = isNumber(registry[name]) ? registry[name] + 1 : 0;\n registry[name] = counter;\n const suffix = counter ? pascal(getNumberWord(counter)) : '';\n const defaultVarName = `${name}Default${suffix}`;\n const defaultLiteral = stringify(siblingSchema.default);\n if (defaultLiteral !== undefined) {\n consts.push(`export const ${defaultVarName} = ${defaultLiteral};`);\n functions.push(['default', defaultVarName]);\n }\n }\n\n if (typeof siblingSchema.description === 'string') {\n // Use the same single-quoted, fully JS-escaped form as the primitive\n // description path (see `pushDescriptionOrMeta`). `escape` only escapes\n // quote chars, so a multi-line description would emit raw newlines and\n // break the generated string literal (TS1002).\n functions.push([\n 'describe',\n `'${jsStringEscape(siblingSchema.description)}'`,\n ]);\n }\n };\n\n // Ref-aware path: emit a placeholder that the orchestrator will rewrite into\n // either a direct identifier or `z.lazy(() => Name)`.\n if (\n rules?.useReusableSchemas &&\n '$ref' in schema &&\n typeof schema.$ref === 'string' &&\n isComponentSchemaRef(schema.$ref)\n ) {\n const siblings = Object.keys(schema).filter((k) => k !== '$ref');\n const allSiblingsChainable = siblings.every((k) => isChainable(k));\n\n if (allSiblingsChainable) {\n const refName = getRefInfo(schema.$ref, context).name;\n const functions: [string, unknown][] = [\n ['namedRef', { name: refName, sourceRef: schema.$ref }],\n ];\n const consts: string[] = [];\n\n applyChainableSiblings(\n functions,\n consts,\n schema as OpenApiSchemaObject & {\n $ref: string;\n nullable?: boolean;\n default?: unknown;\n description?: string;\n },\n );\n\n return { functions, consts };\n }\n\n logVerbose(\n `[orval/zod] $ref ${schema.$ref} has non-chainable siblings ` +\n `[${siblings.filter((s) => !isChainable(s)).join(', ')}]; falling back to inlining.`,\n );\n schema = dereference(\n schema as OpenApiSchemaObject | OpenApiReferenceObject,\n context,\n );\n }\n\n // Dynamic-ref-aware path: when useReusableSchemas is true, resolve the\n // anchor and emit a namedRef sentinel if the target is a concrete component\n // schema. The SCC pipeline then decides direct vs zod.lazy().\n if (rules?.useReusableSchemas && isDynamicReference(schema)) {\n const anchorName = getDynamicAnchorName(schema.$dynamicRef);\n if (anchorName) {\n const { resolvedTypeName, schemaName } = resolveDynamicRef(\n anchorName,\n context,\n );\n\n if (resolvedTypeName !== 'unknown' && schemaName) {\n const siblings = Object.keys(schema).filter((k) => k !== '$dynamicRef');\n const allSiblingsChainable = siblings.every((k) => isChainable(k));\n\n if (allSiblingsChainable) {\n const sourceRef = `${COMPONENT_SCHEMAS_PREFIX}${encodeSegment(schemaName)}`;\n const functions: [string, unknown][] = [\n ['namedRef', { name: resolvedTypeName, sourceRef }],\n ];\n const consts: string[] = [];\n\n applyChainableSiblings(\n functions,\n consts,\n schema as OpenApiSchemaObject & {\n $dynamicRef: string;\n nullable?: boolean;\n default?: unknown;\n description?: string;\n },\n );\n\n return { functions, consts };\n }\n\n logVerbose(\n `[orval/zod] $dynamicRef ${schema.$dynamicRef} has non-chainable siblings ` +\n `[${siblings.filter((s) => !isChainable(s)).join(', ')}]; falling back to inlining.`,\n );\n }\n }\n\n // Not emitted as namedRef (non-chainable siblings, unresolvable anchor,\n // or external ref) — dereference now so the main body sees a resolved\n // schema with a proper type instead of the raw $dynamicRef (which\n // resolveZodType classifies as 'unknown').\n schema = dereference(\n schema as OpenApiSchemaObject | OpenApiReferenceObject,\n context,\n );\n }\n\n const useReusableSchemas = rules?.useReusableSchemas ?? false;\n const consts: string[] = [];\n const constNameRegistry = rules?.constNameRegistry ?? {};\n const constsCounter = isNumber(constNameRegistry[name])\n ? constNameRegistry[name] + 1\n : 0;\n\n const constsCounterValue = constsCounter\n ? pascal(getNumberWord(constsCounter))\n : '';\n\n constNameRegistry[name] = constsCounter;\n\n const functions: [string, unknown][] = [];\n\n // Emit the schema's trailing description/metadata. On zod v4 with `emitMeta`\n // (top-level component schemas only) this is a single `.meta({ id, ... })`\n // carrying the schema name as `id` plus description/deprecated when present;\n // otherwise it falls back to the plain `.describe(...)`. Called from both\n // return points (the multi-type union exit and the main exit) so every schema\n // shape is covered. `.meta()` must be the LAST modifier in the chain — zod v4\n // turns `.meta({id}).describe(...)` into a `$ref` wrapper, whereas\n // `.describe(...).meta({id})` (and a lone `.meta`) stay flat.\n const pushDescriptionOrMeta = () => {\n // Empty-string descriptions are treated as absent — preserves the prior\n // `if (schema.description)` falsy-check semantics (which skipped both `''`\n // and `undefined`), so this change never emits a no-op `.describe('')` or\n // `description: ''` in meta.\n const description =\n typeof schema.description === 'string' && schema.description.length > 0\n ? schema.description\n : undefined;\n const deprecated =\n 'deprecated' in schema && schema.deprecated === true ? true : undefined;\n\n if (rules?.emitMeta && isZodV4) {\n const meta: Record<string, unknown> = { id: name };\n if (description !== undefined) meta.description = description;\n if (deprecated) meta.deprecated = true;\n functions.push(['meta', meta]);\n } else if (description !== undefined) {\n functions.push(['describe', `'${jsStringEscape(description)}'`]);\n }\n };\n\n const type = resolveZodType(schema);\n const required = rules?.required ?? false;\n const hasDefault = schema.default !== undefined;\n const nullable =\n // changing to ?? here changes behavior - so don't\n // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing\n ('nullable' in schema && schema.nullable) ||\n (Array.isArray(schema.type) && schema.type.includes('null'));\n const min = schema.minimum ?? schema.minLength ?? schema.minItems;\n const max = schema.maximum ?? schema.maxLength ?? schema.maxItems;\n\n // Handle exclusiveMinimum and exclusiveMaximum (OpenAPI 3.0 vs 3.1 compatibility)\n // OpenAPI 3.0: exclusiveMinimum/exclusiveMaximum are booleans indicating if minimum/maximum is exclusive\n // OpenAPI 3.1: exclusiveMinimum/exclusiveMaximum are numbers (the value itself)\n const exclusiveMinRaw =\n 'exclusiveMinimum' in schema ? schema.exclusiveMinimum : undefined;\n const exclusiveMaxRaw =\n 'exclusiveMaximum' in schema ? schema.exclusiveMaximum : undefined;\n\n // Convert boolean to number if using OpenAPI 3.0 format\n const exclusiveMin =\n isBoolean(exclusiveMinRaw) && exclusiveMinRaw ? min : exclusiveMinRaw;\n const exclusiveMax =\n isBoolean(exclusiveMaxRaw) && exclusiveMaxRaw ? max : exclusiveMaxRaw;\n\n const multipleOf = schema.multipleOf;\n const matches = schema.pattern ?? undefined;\n // Enum-based schemas are emitted as `zod.enum(...)` or literal unions, so\n // chaining scalar constraints onto the parent schema would generate invalid\n // Zod output. Arrays are handled separately via their item schema.\n const hasNonArrayEnum = !!schema.enum && type !== 'array';\n\n // Check for allOf/oneOf/anyOf BEFORE processing by type\n // This ensures these constraints work with any base type (string, number, object, etc.)\n let skipSwitchStatement = false;\n if (schema.allOf || schema.oneOf || schema.anyOf) {\n const separator = schema.allOf ? 'allOf' : schema.oneOf ? 'oneOf' : 'anyOf';\n\n const schemas = (schema.allOf ?? schema.oneOf ?? schema.anyOf) as (\n | OpenApiSchemaObject\n | OpenApiReferenceObject\n )[];\n\n // In JSON Schema / OpenAPI 3.1 a `required` array in any `allOf` member\n // (and on the composing schema itself) applies to properties contributed by\n // any member. Collect them all so each member's own properties can be marked\n // required even when the `required` lives in a sibling member — e.g. props\n // in a `$ref` base + `required` in a constraint-only sibling. Only valid for\n // `allOf` (a conjunction); `oneOf`/`anyOf` are alternatives. (#3171)\n const allOfRequired = schema.allOf\n ? [\n ...new Set([\n ...(schema.required ?? []),\n ...schemas.flatMap((member) => {\n // Only the member's top-level `required` is needed. For `$ref`\n // members resolve shallowly (no deep property dereference) and\n // tolerate unresolvable refs — they simply contribute no keys.\n const resolved =\n '$ref' in member && typeof member.$ref === 'string'\n ? tryResolveRefSchema(member.$ref, context)\n : (member as OpenApiSchemaObject);\n const memberRequired = resolved?.required;\n return Array.isArray(memberRequired)\n ? (memberRequired as string[])\n : [];\n }),\n ]),\n ]\n : undefined;\n\n // Use index-based naming to ensure uniqueness when processing multiple schemas\n // This prevents duplicate schema names when nullable refs are used\n const baseSchemas = schemas.map((schema, index) =>\n generateZodValidationSchemaDefinition(\n schema as OpenApiSchemaObject,\n context,\n `${camel(name)}${pascal(getNumberWord(index + 1))}`,\n strict,\n isZodV4,\n {\n required: true,\n additionalRequired: allOfRequired,\n constNameRegistry,\n useReusableSchemas,\n },\n ),\n );\n\n // Handle allOf/oneOf/anyOf with additional properties - merge additional properties into the schema\n if ((schema.allOf || schema.oneOf || schema.anyOf) && schema.properties) {\n const additionalPropertiesSchema = {\n properties: schema.properties,\n required: schema.required,\n additionalProperties: schema.additionalProperties,\n type: schema.type,\n } as OpenApiSchemaObject;\n\n // Use index-based naming to ensure uniqueness\n const additionalIndex = baseSchemas.length + 1;\n const additionalPropertiesDefinition =\n generateZodValidationSchemaDefinition(\n additionalPropertiesSchema,\n context,\n `${camel(name)}${pascal(getNumberWord(additionalIndex))}`,\n strict,\n isZodV4,\n {\n required: true,\n additionalRequired: allOfRequired,\n constNameRegistry,\n useReusableSchemas,\n },\n );\n\n // For oneOf/anyOf, use allOf to combine union with common properties\n // This generates: zod.union([...]).and(commonProperties)\n if (schema.oneOf || schema.anyOf) {\n functions.push([\n 'allOf',\n [\n { functions: [[separator, baseSchemas]], consts: [] },\n additionalPropertiesDefinition,\n ],\n ]);\n } else {\n // For allOf, just add to the list\n baseSchemas.push(additionalPropertiesDefinition);\n functions.push([separator, baseSchemas]);\n }\n } else {\n functions.push([separator, baseSchemas]);\n }\n skipSwitchStatement = true;\n }\n\n let defaultVarName: string | undefined;\n if (schema.default !== undefined) {\n defaultVarName = `${name}Default${constsCounterValue}`;\n let defaultValue: string | undefined;\n\n const isDateType =\n schema.type === 'string' &&\n (schema.format === 'date' || schema.format === 'date-time') &&\n context.output.override.useDates;\n\n if (isDateType) {\n // OpenApiSchemaObject defines default as 'any'\n defaultValue = `new Date(\"${escape(schema.default)}\")`;\n } else if (isObject(schema.default)) {\n // Narrow string literals individually with `as const` so `zod.enum([...])`\n // properties accept the emitted default (#3244). Whole-object/array\n // `as const` would make nested arrays `readonly`, which zod v4's\n // `.default()` rejects against its mutable parameter type (#3399).\n const entries = Object.entries(schema.default)\n .map(([key, value]) => {\n if (isString(value)) {\n return `${key}: \"${escape(value)}\" as const`;\n }\n\n if (Array.isArray(value)) {\n const arrayItems = value.map((item) =>\n isString(item) ? `\"${escape(item)}\" as const` : `${item}`,\n );\n return `${key}: [${arrayItems.join(', ')}]`;\n }\n\n if (\n value === null ||\n value === undefined ||\n isNumber(value) ||\n isBoolean(value)\n )\n return `${key}: ${value}`;\n })\n .join(', ');\n defaultValue = entries.length === 0 ? `{}` : `{ ${entries} }`;\n } else {\n // OpenApiSchemaObject defines default as 'any'\n const rawStringified = stringify(schema.default);\n defaultValue =\n rawStringified === undefined\n ? 'null'\n : rawStringified.replaceAll(\"'\", '`');\n\n // If the schema is an array with enum items, inject inplace to avoid issues with default values\n const isArrayWithEnumItems =\n Array.isArray(schema.default) &&\n type === 'array' &&\n schema.items &&\n 'enum' in schema.items &&\n schema.default.length > 0;\n\n if (isArrayWithEnumItems) {\n defaultVarName = defaultValue;\n defaultValue = undefined;\n }\n }\n if (defaultValue) {\n consts.push(`export const ${defaultVarName} = ${defaultValue};`);\n }\n }\n\n // Handle multi-type schemas (OpenAPI 3.1+ type arrays)\n if (isObject(type) && 'multiType' in type) {\n const types = type.multiType;\n functions.push([\n 'oneOf',\n types.map((t) =>\n generateZodValidationSchemaDefinition(\n {\n ...(schema as Record<string, unknown>),\n type: t,\n } as OpenApiSchemaObject,\n context,\n name,\n strict,\n isZodV4,\n {\n required: true,\n constNameRegistry,\n useReusableSchemas,\n },\n ),\n ),\n ]);\n\n if (!required && nullable) {\n functions.push(['nullish', undefined]);\n } else if (nullable) {\n functions.push(['nullable', undefined]);\n } else if (!required) {\n functions.push(['optional', undefined]);\n }\n\n pushDescriptionOrMeta();\n\n return { functions, consts };\n }\n\n if (!skipSwitchStatement) {\n switch (type) {\n case 'tuple': {\n /**\n *\n * > 10.3.1.1. prefixItems\n * > The value of \"prefixItems\" MUST be a non-empty array of valid JSON Schemas.\n * >\n * > Validation succeeds if each element of the instance validates against the schema at the same position, if any.\n * > This keyword does not constrain the length of the array. If the array is longer than this keyword's value,\n * > this keyword validates only the prefix of matching length.\n * >\n * > This keyword produces an annotation value which is the largest index to which this keyword applied a subschema.\n * > The value MAY be a boolean true if a subschema was applied to every index of the instance, such as is produced by the \"items\" keyword.\n * > This annotation affects the behavior of \"items\" and \"unevaluatedItems\".\n * >\n * > Omitting this keyword has the same assertion behavior as an empty array.\n */\n if ('prefixItems' in schema) {\n const schema31 = schema as OpenApiSchemaObject;\n const prefixItems = Array.isArray(schema31.prefixItems)\n ? (schema31.prefixItems as (\n | OpenApiSchemaObject\n | OpenApiReferenceObject\n )[])\n : [];\n\n if (prefixItems.length > 0) {\n functions.push([\n 'tuple',\n prefixItems.map((item, idx) =>\n generateZodValidationSchemaDefinition(\n dereference(item, context),\n context,\n camel(`${name}-${idx}-item`),\n isZodV4,\n strict,\n {\n required: true,\n constNameRegistry,\n useReusableSchemas,\n },\n ),\n ),\n ]);\n\n if (\n schema.items &&\n (max ?? Number.POSITIVE_INFINITY) > prefixItems.length\n ) {\n // only add zod.rest() if number of tuple elements can exceed provided prefixItems:\n functions.push([\n 'rest',\n generateZodValidationSchemaDefinition(\n schema.items as OpenApiSchemaObject | undefined,\n context,\n camel(`${name}-item`),\n strict,\n isZodV4,\n {\n required: true,\n constNameRegistry,\n useReusableSchemas,\n },\n ),\n ]);\n }\n }\n }\n break;\n }\n case 'array': {\n functions.push([\n 'array',\n generateZodValidationSchemaDefinition(\n schema.items as OpenApiSchemaObject | undefined,\n context,\n camel(`${name}-item`),\n strict,\n isZodV4,\n {\n required: true,\n constNameRegistry,\n useReusableSchemas,\n },\n ),\n ]);\n break;\n }\n case 'string': {\n if (schema.enum) {\n break;\n }\n\n if (\n context.output.override.useDates &&\n (schema.format === 'date' || schema.format === 'date-time')\n ) {\n functions.push(['date', undefined]);\n break;\n }\n\n if (schema.format === 'binary') {\n functions.push(['instanceof', 'File']);\n break;\n }\n\n // The @scalar/openapi-parser upgrader converts format: binary to\n // contentMediaType: application/octet-stream when upgrading\n // Swagger 2.0 / OAS 3.0 → OAS 3.1. Treat it the same as\n // format: binary so $ref-based model types generate File validation.\n if (\n schema.contentMediaType === 'application/octet-stream' &&\n !schema.contentEncoding\n ) {\n functions.push(['instanceof', 'File']);\n break;\n }\n\n if (isZodV4) {\n if (!predefinedZodFormats.has(schema.format ?? '')) {\n if ('const' in schema) {\n functions.push(['literal', `\"${schema.const}\"`]);\n } else if (schema.pattern && schema.format) {\n const isStartWithSlash = schema.pattern.startsWith('/');\n const isEndWithSlash = schema.pattern.endsWith('/');\n const regexp = `new RegExp('${jsStringLiteralEscape(\n schema.pattern.slice(\n isStartWithSlash ? 1 : 0,\n isEndWithSlash ? -1 : undefined,\n ),\n )}')`;\n consts.push(\n `export const ${name}RegExp${constsCounterValue} = ${regexp};\\n`,\n );\n functions.push([\n 'stringFormat',\n [\n `'${escape(schema.format)}'`,\n `${name}RegExp${constsCounterValue}`,\n ],\n ]);\n } else {\n functions.push([type as string, undefined]);\n }\n break;\n }\n } else {\n if ('const' in schema) {\n functions.push(['literal', `\"${schema.const}\"`]);\n } else {\n functions.push([type as string, undefined]);\n }\n }\n\n if (schema.format === 'date') {\n const formatAPI = getZodDateFormat(isZodV4);\n\n functions.push([formatAPI, undefined]);\n break;\n }\n\n if (schema.format === 'time') {\n const options = context.output.override.zod.timeOptions;\n const formatAPI = getZodTimeFormat(isZodV4);\n\n functions.push([formatAPI, JSON.stringify(options)]);\n break;\n }\n\n if (schema.format === 'date-time') {\n const options = context.output.override.zod.dateTimeOptions;\n const formatAPI = getZodDateTimeFormat(isZodV4);\n\n functions.push([formatAPI, JSON.stringify(options)]);\n break;\n }\n\n if (schema.format === 'email') {\n functions.push(['email', undefined]);\n break;\n }\n\n if (schema.format === 'uri') {\n functions.push(['url', undefined]);\n break;\n }\n\n if (schema.format === 'hostname') {\n if (isZodV4) {\n functions.push(['hostname', undefined]);\n } else {\n functions.push(['url', undefined]);\n }\n break;\n }\n\n if (schema.format === 'uuid') {\n functions.push(['uuid', undefined]);\n break;\n }\n\n break;\n }\n default: {\n const hasProperties = !!schema.properties;\n const properties = schema.properties ?? {};\n const hasDefinedProperties = Object.keys(properties).length > 0;\n const hasAdditionalPropertiesSchema =\n !!schema.additionalProperties &&\n !isBoolean(schema.additionalProperties);\n\n // A plain `type: object` without explicit properties/additionalProperties\n // represents an open dictionary-like object in OpenAPI and should not be\n // generated as a strict object.\n const shouldUseLooseObject =\n type === 'object' &&\n !hasDefinedProperties &&\n schema.additionalProperties === undefined &&\n !hasAdditionalPropertiesSchema;\n\n if (hasProperties && hasDefinedProperties) {\n const objectType = getObjectFunctionName(isZodV4, strict);\n\n // A property is required when this schema requires it OR when a\n // sibling `allOf` member requires it (propagated via additionalRequired). (#3171)\n const requiredKeys = new Set<string>([\n ...(schema.required ?? []),\n ...(rules?.additionalRequired ?? []),\n ]);\n\n functions.push([\n objectType,\n Object.keys(properties)\n .map((key) => ({\n [key]:\n rules?.propertyOverrides?.[key] ??\n generateZodValidationSchemaDefinition(\n properties[key] as OpenApiSchemaObject | undefined,\n context,\n camel(`${name}-${key}`),\n strict,\n isZodV4,\n {\n required: requiredKeys.has(key),\n constNameRegistry,\n useReusableSchemas,\n },\n ),\n }))\n .reduce((acc, curr) => ({ ...acc, ...curr }), {}),\n ]);\n\n if (strict && !isZodV4) {\n functions.push(['strict', undefined]);\n }\n\n break;\n }\n\n if (shouldUseLooseObject) {\n const looseObjectType = getLooseObjectFunctionName(isZodV4);\n\n functions.push([looseObjectType, {}]);\n\n if (!isZodV4) {\n functions.push(['passthrough', undefined]);\n }\n\n break;\n }\n\n if (schema.additionalProperties) {\n functions.push([\n 'additionalProperties',\n generateZodValidationSchemaDefinition(\n isBoolean(schema.additionalProperties)\n ? {}\n : (schema.additionalProperties as OpenApiSchemaObject),\n context,\n name,\n strict,\n isZodV4,\n {\n required: true,\n constNameRegistry,\n useReusableSchemas,\n },\n ),\n ]);\n\n break;\n }\n\n if (schema.enum) {\n break;\n }\n\n functions.push([type, undefined]);\n\n break;\n }\n }\n }\n\n if (!hasNonArrayEnum && isString(type) && minAndMaxTypes.has(type)) {\n // Handle minimum constraints: exclusiveMinimum (>.gt()) takes priority over minimum (.min())\n // Check if exclusive flag was set (boolean format in OpenAPI 3.0) or a different value (OpenAPI 3.1)\n const shouldUseExclusiveMin = exclusiveMinRaw !== undefined;\n const shouldUseExclusiveMax = exclusiveMaxRaw !== undefined;\n\n if (shouldUseExclusiveMin && exclusiveMin !== undefined) {\n consts.push(\n `export const ${name}ExclusiveMin${constsCounterValue} = ${exclusiveMin};`,\n );\n // Generate .gt() for exclusive minimum (> instead of >=)\n functions.push(['gt', `${name}ExclusiveMin${constsCounterValue}`]);\n } else if (min !== undefined) {\n if (min === 1) {\n functions.push(['min', `${min}`]);\n } else {\n consts.push(`export const ${name}Min${constsCounterValue} = ${min};`);\n functions.push(['min', `${name}Min${constsCounterValue}`]);\n }\n }\n\n // Handle maximum constraints: exclusiveMaximum (<.lt()) takes priority over maximum (.max())\n if (shouldUseExclusiveMax && exclusiveMax !== undefined) {\n consts.push(\n `export const ${name}ExclusiveMax${constsCounterValue} = ${exclusiveMax};`,\n );\n // Generate .lt() for exclusive maximum (< instead of <=)\n functions.push(['lt', `${name}ExclusiveMax${constsCounterValue}`]);\n } else if (max !== undefined) {\n consts.push(`export const ${name}Max${constsCounterValue} = ${max};`);\n functions.push(['max', `${name}Max${constsCounterValue}`]);\n }\n\n if (multipleOf !== undefined) {\n consts.push(\n `export const ${name}MultipleOf${constsCounterValue} = ${multipleOf.toString()};`,\n );\n functions.push(['multipleOf', `${name}MultipleOf${constsCounterValue}`]);\n }\n if (\n exclusiveMin !== undefined ||\n min !== undefined ||\n exclusiveMax !== undefined ||\n multipleOf !== undefined ||\n max !== undefined\n ) {\n consts.push(`\\n`);\n }\n }\n\n const stringFormatAlreadyEmitted =\n isZodV4 &&\n type === 'string' &&\n !!matches &&\n !!schema.format &&\n !predefinedZodFormats.has(schema.format ?? '');\n\n if (\n matches &&\n !hasNonArrayEnum &&\n type === 'string' &&\n !stringFormatAlreadyEmitted\n ) {\n const isStartWithSlash = matches.startsWith('/');\n const isEndWithSlash = matches.endsWith('/');\n\n const regexp = `new RegExp('${jsStringLiteralEscape(\n matches.slice(isStartWithSlash ? 1 : 0, isEndWithSlash ? -1 : undefined),\n )}')`;\n\n consts.push(\n `export const ${name}RegExp${constsCounterValue} = ${regexp};\\n`,\n );\n if (schema.format && !predefinedZodFormats.has(schema.format) && isZodV4) {\n functions.push([\n 'stringFormat',\n [`'${escape(schema.format)}'`, `${name}RegExp${constsCounterValue}`],\n ]);\n } else {\n functions.push(['regex', `${name}RegExp${constsCounterValue}`]);\n }\n }\n\n // Array item enums are handled by the nested item schema. Guard parent-array\n // enum emission to avoid generating invalid trailing `.enum(...)` chains.\n if (schema.enum && type !== 'array') {\n const uniqueEnumValues = unique(schema.enum);\n\n if (uniqueEnumValues.every((value) => isString(value))) {\n functions.push([\n 'enum',\n `[${uniqueEnumValues.map((value) => `'${escape(value)}'`).join(', ')}]`,\n ]);\n } else {\n functions.push([\n 'oneOf',\n uniqueEnumValues.map((value) => ({\n functions: [\n ['literal', isString(value) ? `'${escape(value)}'` : value],\n ],\n consts: [],\n })),\n ]);\n }\n }\n\n if (!required && nullable) {\n functions.push(['nullish', undefined]);\n } else if (nullable) {\n functions.push(['nullable', undefined]);\n } else if (!required && !hasDefault) {\n functions.push(['optional', undefined]);\n }\n\n if (hasDefault) {\n functions.push(['default', defaultVarName]);\n }\n\n pushDescriptionOrMeta();\n\n return { functions, consts: unique(consts) };\n};\n\n/**\n * Runtime shape passed to the user-supplied `override.zod.params` function for\n * every emitted validator. Exported so consumers can type their function with\n * `import type { ZodParamsContext } from 'orval'` instead of hand-writing it.\n */\nexport interface ZodParamsContext {\n /** The OpenAPI `operationId`, or `''` for shared component schemas. */\n operationId: string;\n /** `'schema'` is used for shared component schemas with no owning operation. */\n location: 'param' | 'query' | 'header' | 'body' | 'response' | 'schema';\n /** Generated schema name, e.g. `CreateUserBody`, or the component name. */\n schemaName: string;\n /** Path to the current property within the schema. Only object property names are appended. */\n fieldPath: string[];\n /** The Zod method being emitted, e.g. `'string'`, `'min'`, `'email'`. */\n validator: string;\n}\n\nexport interface ZodParamsInjection extends Pick<\n ZodParamsContext,\n 'operationId' | 'location' | 'schemaName'\n> {\n mutator: GeneratorMutator;\n}\n\nconst PARAMS_MODIFIER_VALIDATORS = new Set([\n 'optional',\n 'nullable',\n 'nullish',\n 'default',\n 'describe',\n // Nullary / degenerate validators — either no params arg accepted in zod v3\n // (e.g. .unknown(), .any(), .never(), .null(), .undefined(), .void()) or no\n // meaningful error to attach (unknown/any accept everything).\n 'unknown',\n 'any',\n 'never',\n 'null',\n 'undefined',\n 'void',\n]);\n\n// Validators whose single argument is already a params-shaped options object\n// (e.g. `z.iso.datetime({ offset, precision })`). For these, the injected\n// params must merge into the existing object rather than be appended as a\n// second argument.\nconst PARAMS_MERGE_INTO_OPTIONS_VALIDATORS = new Set([\n 'datetime',\n 'time',\n 'iso.datetime',\n 'iso.time',\n]);\n\nexport const parseZodValidationSchemaDefinition = (\n input: ZodValidationSchemaDefinition,\n context: ContextSpec,\n coerceTypes: boolean | ZodCoerceType[] = false,\n strict: boolean,\n isZodV4: boolean,\n preprocess?: GeneratorMutator,\n paramsInjection?: ZodParamsInjection,\n): { zod: string; consts: string; usedRefs: Set<string> } => {\n if (input.functions.length === 0) {\n return { zod: '', consts: '', usedRefs: new Set() };\n }\n\n let consts = '';\n const usedRefs = new Set<string>();\n\n const appendConstsChunk = (chunk: string) => {\n if (!chunk) {\n return;\n }\n\n if (\n consts.length > 0 &&\n !consts.endsWith('\\n') &&\n !chunk.startsWith('\\n')\n ) {\n consts += '\\n';\n }\n\n consts += chunk;\n };\n\n const formatFunctionArgs = (value: unknown): string => {\n if (value === undefined) return '';\n if (value === null) return 'null';\n if (isString(value)) return value;\n if (Array.isArray(value)) {\n return value.map((item) => formatFunctionArgs(item)).join(', ');\n }\n if (isObject(value)) {\n return stringify(value) ?? '';\n }\n if (isNumber(value) || isBoolean(value)) return `${value}`;\n return '';\n };\n\n const buildParamsArg = (\n fn: string,\n fieldPath: readonly string[],\n ): string | undefined => {\n if (!paramsInjection) return undefined;\n if (PARAMS_MODIFIER_VALIDATORS.has(fn)) return undefined;\n const ctx: ZodParamsContext = {\n operationId: paramsInjection.operationId,\n location: paramsInjection.location,\n schemaName: paramsInjection.schemaName,\n fieldPath: [...fieldPath],\n validator: fn,\n };\n return `${paramsInjection.mutator.name}(${JSON.stringify(ctx)})`;\n };\n\n const parseProperty = (\n property: [string, unknown],\n fieldPath: readonly string[] = [],\n ): string => {\n const [fn, args = ''] = property;\n\n if (fn === 'namedRef') {\n const refArgs = args as { name: string; sourceRef: string };\n usedRefs.add(refArgs.name);\n return `__REF_${refArgs.name}__`;\n }\n\n // `.meta({ id, description?, deprecated? })` — registry metadata for zod v4.\n // Built explicitly (rather than via stringify) so the description is\n // JS-string-escaped and the field order is stable: id, description,\n // deprecated.\n if (fn === 'meta') {\n const metaArgs = args as {\n id: string;\n description?: string;\n deprecated?: boolean;\n };\n const parts = [`id: '${jsStringEscape(metaArgs.id)}'`];\n if (metaArgs.description !== undefined) {\n parts.push(`description: '${jsStringEscape(metaArgs.description)}'`);\n }\n if (metaArgs.deprecated) {\n parts.push('deprecated: true');\n }\n return `.meta({ ${parts.join(', ')} })`;\n }\n\n // File | string for text contentMediaType/encoding (user can pass string, runtime wraps in Blob)\n if (fn === 'fileOrString') {\n return 'zod.instanceof(File).or(zod.string())';\n }\n\n if (fn === 'allOf') {\n const allOfArgs = args as ZodValidationSchemaDefinition[];\n // Check if all parts are objects and we need to merge them for strict mode\n const allAreObjects =\n strict &&\n allOfArgs.length > 0 &&\n allOfArgs.every((partSchema) => {\n if (partSchema.functions.length === 0) return false;\n const firstFn = partSchema.functions[0][0];\n // Check if first function is object or strictObject\n // For Zod v3 with strict, it will be object followed by strict\n return firstFn === 'object' || firstFn === 'strictObject';\n });\n\n if (allAreObjects) {\n // Merge all object properties into a single object\n const mergedProperties: Record<string, ZodValidationSchemaDefinition> =\n {};\n let allConsts = '';\n\n for (const partSchema of allOfArgs) {\n if (partSchema.consts.length > 0) {\n allConsts += partSchema.consts.join('\\n');\n }\n\n // Find the object function (might be first or second after strict)\n const objectFunctionIndex = partSchema.functions.findIndex(\n ([fnName]) => fnName === 'object' || fnName === 'strictObject',\n );\n\n if (objectFunctionIndex !== -1) {\n const objectArgs = partSchema.functions[objectFunctionIndex][1];\n if (isObject(objectArgs)) {\n // Merge properties (later schemas override earlier ones)\n Object.assign(\n mergedProperties,\n objectArgs as Record<string, ZodValidationSchemaDefinition>,\n );\n }\n }\n }\n\n if (allConsts.length > 0) {\n appendConstsChunk(allConsts);\n }\n\n // Generate merged object\n const objectType = getObjectFunctionName(isZodV4, strict);\n const mergedObjectString = `zod.${objectType}({\n${Object.entries(mergedProperties)\n .map(([key, schema]) => {\n const value = schema.functions\n .map((prop) => parseProperty(prop, [...fieldPath, key]))\n .join('');\n appendConstsChunk(schema.consts.join('\\n'));\n return ` \"${key}\": ${value.startsWith('.') ? 'zod' : ''}${value}`;\n })\n .join(',\\n')}\n})`;\n\n // Apply strict only once for Zod v3 (v4 uses strictObject)\n if (!isZodV4) {\n return `${mergedObjectString}.strict()`;\n }\n\n return mergedObjectString;\n }\n\n // Fallback to original .and() approach for non-object or non-strict cases\n let acc = '';\n for (const partSchema of allOfArgs) {\n const value = partSchema.functions\n .map((prop) => parseProperty(prop, fieldPath))\n .join('');\n const valueWithZod = `${value.startsWith('.') ? 'zod' : ''}${value}`;\n\n if (partSchema.consts.length > 0) {\n appendConstsChunk(partSchema.consts.join('\\n'));\n }\n\n if (acc.length === 0) {\n acc = valueWithZod;\n } else {\n acc += `.and(${valueWithZod})`;\n }\n }\n\n return acc;\n }\n if (fn === 'oneOf' || fn === 'anyOf') {\n const unionArgs = args as ZodValidationSchemaDefinition[];\n // Can't use zod.union() with a single item\n if (unionArgs.length === 1) {\n appendConstsChunk(unionArgs[0].consts.join('\\n'));\n return unionArgs[0].functions\n .map((prop: [string, unknown]) => parseProperty(prop, fieldPath))\n .join('');\n }\n\n const union = unionArgs.map(\n ({\n functions,\n consts: argConsts,\n }: {\n functions: [string, unknown][];\n consts: string[];\n }) => {\n const value = functions\n .map((prop) => parseProperty(prop, fieldPath))\n .join('');\n const valueWithZod = `${value.startsWith('.') ? 'zod' : ''}${value}`;\n // consts are missing here\n appendConstsChunk(argConsts.join('\\n'));\n return valueWithZod;\n },\n );\n\n return `.union([${union.join(',')}])`;\n }\n\n if (fn === 'additionalProperties') {\n const additionalPropertiesArgs = args as ZodValidationSchemaDefinition;\n const value = additionalPropertiesArgs.functions\n .map((prop: [string, unknown]) => parseProperty(prop, fieldPath))\n .join('');\n const valueWithZod = `${value.startsWith('.') ? 'zod' : ''}${value}`;\n if (Array.isArray(additionalPropertiesArgs.consts)) {\n appendConstsChunk(additionalPropertiesArgs.consts.join('\\n'));\n }\n return `zod.record(zod.string(), ${valueWithZod})`;\n }\n\n if (fn === 'object' || fn === 'strictObject' || fn === 'looseObject') {\n const objectArgs = args as Record<string, ZodValidationSchemaDefinition>;\n const objectType =\n fn === 'looseObject'\n ? isZodV4\n ? 'looseObject'\n : 'object'\n : getObjectFunctionName(isZodV4, strict);\n\n const parsedObject = `zod.${objectType}({\n${Object.entries(objectArgs)\n .map(([key, schema]) => {\n const value = schema.functions\n .map((prop) => parseProperty(prop, [...fieldPath, key]))\n .join('');\n appendConstsChunk(schema.consts.join('\\n'));\n return ` \"${key}\": ${value.startsWith('.') ? 'zod' : ''}${value}`;\n })\n .join(',\\n')}\n})`;\n\n if (fn === 'looseObject' && !isZodV4) {\n return `${parsedObject}.passthrough()`;\n }\n\n return parsedObject;\n }\n\n if (fn === 'passthrough') {\n return '.passthrough()';\n }\n\n if (fn === 'array') {\n const arrayArgs = args as ZodValidationSchemaDefinition;\n const value = arrayArgs.functions\n .map((prop: [string, unknown]) => parseProperty(prop, fieldPath))\n .join('');\n if (isString(arrayArgs.consts)) {\n appendConstsChunk(arrayArgs.consts);\n } else if (Array.isArray(arrayArgs.consts)) {\n appendConstsChunk(arrayArgs.consts.join('\\n'));\n }\n return `.array(${value.startsWith('.') ? 'zod' : ''}${value})`;\n }\n\n if (fn === 'strict' && !isZodV4) {\n return '.strict()';\n }\n\n if (fn === 'tuple') {\n return `zod.tuple([${(args as ZodValidationSchemaDefinition[])\n .map((x) => {\n const value = x.functions\n .map((prop) => parseProperty(prop, fieldPath))\n .join('');\n return `${value.startsWith('.') ? 'zod' : ''}${value}`;\n })\n .join(',\\n')}])`;\n }\n if (fn === 'rest') {\n return `.rest(zod${(args as ZodValidationSchemaDefinition).functions\n .map((prop) => parseProperty(prop, fieldPath))\n .join('')})`;\n }\n const shouldCoerceType =\n coerceTypes &&\n (Array.isArray(coerceTypes)\n ? coerceTypes.includes(fn as ZodCoerceType)\n : COERCIBLE_TYPES.has(fn));\n\n const formattedArgs = formatFunctionArgs(args);\n const paramsArg = buildParamsArg(fn, fieldPath);\n let combinedArgs: string;\n if (\n paramsArg &&\n formattedArgs &&\n PARAMS_MERGE_INTO_OPTIONS_VALIDATORS.has(fn)\n ) {\n combinedArgs = `{ ...${formattedArgs}, ...${paramsArg} }`;\n } else if (paramsArg) {\n combinedArgs = formattedArgs\n ? `${formattedArgs}, ${paramsArg}`\n : paramsArg;\n } else {\n combinedArgs = formattedArgs;\n }\n\n if (\n (fn !== 'date' && shouldCoerceType) ||\n (fn === 'date' && shouldCoerceType && context.output.override.useDates)\n ) {\n return `.coerce.${fn}(${combinedArgs})`;\n }\n\n return `.${fn}(${combinedArgs})`;\n };\n\n appendConstsChunk(input.consts.join('\\n'));\n\n const schema = input.functions.map((prop) => parseProperty(prop)).join('');\n const value = preprocess\n ? `.preprocess(${preprocess.name}, ${\n schema.startsWith('.') ? 'zod' : ''\n }${schema})`\n : schema;\n\n const zod = `${value.startsWith('.') ? 'zod' : ''}${value}`;\n // Some export consts includes `,` as prefix, adding replace to remove those\n if (consts.includes(',export')) {\n consts = consts.replaceAll(',export', '\\nexport');\n }\n return { zod, consts, usedRefs };\n};\n\nconst dereferenceScalar = (value: unknown, context: ContextSpec): unknown => {\n if (isObject(value)) {\n return dereference(\n value as OpenApiSchemaObject | OpenApiReferenceObject,\n context,\n );\n } else if (Array.isArray(value)) {\n return value.map((item) => dereferenceScalar(item, context));\n } else {\n return value;\n }\n};\n\n/**\n * Attempts to resolve a `$ref` to its target schema. Returns `undefined`\n * instead of throwing when the ref cannot be found (e.g. external refs\n * not yet bundled). Logs a verbose warning on failure to aid debugging.\n */\nfunction tryResolveRefSchema(\n $ref: string,\n context: ContextSpec,\n): OpenApiSchemaObject | undefined {\n try {\n return resolveRef({ $ref } as OpenApiReferenceObject, context)\n .schema as OpenApiSchemaObject;\n } catch (error) {\n logVerbose(\n `[orval/zod] Failed to resolve $ref \"${$ref}\":`,\n error instanceof Error ? error.message : error,\n );\n return;\n }\n}\n\nconst COMPONENT_SCHEMAS_PREFIX = '#/components/schemas/';\n\nfunction extractSchemaNameFromRef($ref: string): string | undefined {\n if (!$ref.startsWith(COMPONENT_SCHEMAS_PREFIX)) return undefined;\n const raw = $ref.slice(COMPONENT_SCHEMAS_PREFIX.length);\n return decodeURIComponent(raw.replaceAll('~1', '/').replaceAll('~0', '~'));\n}\n\n/**\n * Recursively inlines all `$ref` and `$dynamicRef` references in an OpenAPI\n * schema tree, producing a fully-resolved schema suitable for Zod code generation.\n *\n * Tracks visited `$ref` paths via `context.parents` to break circular\n * references (returning `{}` for cycles).\n *\n * `$dynamicRef` is resolved using the dynamic scope attached to `context`:\n * 1. Look up the anchor name in `context.dynamicScope`.\n * 2. If not found, fall back to scanning `components.schemas` for a schema\n * that declares `$dynamicAnchor` with the same name.\n * 3. If resolved to a concrete schema, inline it (same as `$ref`).\n * 4. If unresolved, external, or a generic parameter → return `{}`.\n */\nexport const dereference = (\n schema: OpenApiSchemaObject | OpenApiReferenceObject,\n context: ContextSpec,\n): OpenApiSchemaObject => {\n const refName = '$ref' in schema ? schema.$ref : undefined;\n if (refName && context.parents?.includes(refName)) {\n return {};\n }\n\n if (isDynamicReference(schema)) {\n return dereferenceDynamicRef(schema, context);\n }\n\n const childContext: ContextSpec = {\n ...context,\n ...(refName\n ? { parents: [...(context.parents ?? []), refName] }\n : undefined),\n };\n\n const resolvedSchema: OpenApiSchemaObject | undefined =\n '$ref' in schema\n ? (() => {\n const referencedSchema = tryResolveRefSchema(schema.$ref, context);\n\n if (!referencedSchema || !isObject(referencedSchema)) {\n return;\n }\n\n const siblingProperties = Object.fromEntries(\n Object.entries(schema as Record<string, unknown>).filter(\n ([key]) => key !== '$ref',\n ),\n );\n\n return {\n ...(referencedSchema as Record<string, unknown>),\n ...siblingProperties,\n } as OpenApiSchemaObject;\n })()\n : schema;\n\n if (!resolvedSchema) {\n return {};\n }\n\n const resolvedContext = buildScopedContext(\n childContext,\n refName,\n resolvedSchema,\n );\n\n if (isDynamicReference(resolvedSchema)) {\n return dereferenceDynamicRef(resolvedSchema, resolvedContext);\n }\n\n return dereferenceProperties(resolvedSchema, resolvedContext);\n};\n\nfunction dereferenceProperties(\n schema: OpenApiSchemaObject,\n context: ContextSpec,\n): OpenApiSchemaObject {\n return Object.entries(schema).reduce<Record<string, unknown>>(\n (acc, [key, value]) => {\n if (key === 'properties' && isObject(value)) {\n acc[key] = Object.entries(value).reduce<\n Record<string, OpenApiSchemaObject>\n >((props, [propKey, propSchema]) => {\n props[propKey] = dereference(\n propSchema as OpenApiSchemaObject | OpenApiReferenceObject,\n context,\n );\n return props;\n }, {});\n } else if (key === 'default' || key === 'example' || key === 'examples') {\n acc[key] = value;\n } else {\n acc[key] = dereferenceScalar(value, context);\n }\n\n return acc;\n },\n {},\n ) as OpenApiSchemaObject;\n}\n\nfunction buildScopedContext(\n childContext: ContextSpec,\n refName: string | undefined,\n resolvedSchema: OpenApiSchemaObject,\n): ContextSpec {\n if (!refName) return childContext;\n\n const schemaName = extractSchemaNameFromRef(refName);\n if (!schemaName) return childContext;\n\n const schemaRecord = resolvedSchema as Record<string, unknown>;\n const hasDynamicAnchor = typeof schemaRecord.$dynamicAnchor === 'string';\n const defs = schemaRecord.$defs as Record<string, unknown> | undefined;\n const hasDefsAnchors =\n defs &&\n typeof defs === 'object' &&\n Object.values(defs).some(\n (d) => d && typeof d === 'object' && '$dynamicAnchor' in d,\n );\n\n if (!hasDynamicAnchor && !hasDefsAnchors) return childContext;\n\n return {\n ...childContext,\n dynamicScope: buildDynamicScope(schemaName, resolvedSchema, childContext),\n };\n}\n\nfunction dereferenceDynamicRef(\n schema: object & { $dynamicRef: string },\n context: ContextSpec,\n): OpenApiSchemaObject {\n const dynamicRef = schema.$dynamicRef;\n const anchorName = getDynamicAnchorName(dynamicRef);\n if (!anchorName) {\n return {};\n }\n\n const {\n resolvedTypeName,\n schema: resolvedSchema,\n schemaName,\n } = resolveDynamicRef(anchorName, context);\n\n const dynamicRefPath = `$dynamicRef:${dynamicRef}@${schemaName ?? '?'}`;\n if (context.parents?.includes(dynamicRefPath)) {\n return {};\n }\n\n if (resolvedTypeName === 'unknown' || !isObject(resolvedSchema)) {\n return {};\n }\n\n const childContext: ContextSpec = {\n ...context,\n parents: [...(context.parents ?? []), dynamicRefPath],\n };\n\n const scopedContext = buildScopedContext(\n childContext,\n schemaName\n ? `${COMPONENT_SCHEMAS_PREFIX}${encodeSegment(schemaName)}`\n : undefined,\n resolvedSchema,\n );\n\n const siblingProperties = Object.fromEntries(\n Object.entries(schema).filter(([key]) => key !== '$dynamicRef'),\n );\n\n const merged: OpenApiSchemaObject = {\n ...(resolvedSchema as Record<string, unknown>),\n ...siblingProperties,\n } as OpenApiSchemaObject;\n\n return dereferenceProperties(merged, scopedContext);\n}\n\nfunction encodeSegment(segment: string): string {\n return segment.replaceAll('~', '~0').replaceAll('/', '~1');\n}\n\n/**\n * Generate zod schema for form-data request body.\n * Handles file type detection for top-level properties based on encoding.contentType\n * and contentMediaType. Mirrors type gen's resolveFormDataRootObject.\n */\nexport const generateFormDataZodSchema = (\n schema: OpenApiSchemaObject,\n context: ContextSpec,\n name: string,\n strict: boolean,\n isZodV4: boolean,\n encoding?: Record<string, { contentType?: string }>,\n useReusableSchemas?: boolean,\n): ZodValidationSchemaDefinition => {\n // Precompute file type overrides for top-level properties only\n const propertyOverrides: Record<string, ZodValidationSchemaDefinition> = {};\n\n if (schema.properties) {\n for (const key of Object.keys(schema.properties)) {\n const propSchema = schema.properties[key];\n const resolvedPropSchema = propSchema\n ? dereference(\n propSchema as OpenApiSchemaObject | OpenApiReferenceObject,\n context,\n )\n : undefined;\n\n const fileType = resolvedPropSchema\n ? getFormDataFieldFileType(\n resolvedPropSchema,\n encoding?.[key]?.contentType,\n )\n : undefined;\n\n if (fileType) {\n const isRequired = schema.required?.includes(key);\n const fileFunctions: [string, unknown][] = [\n fileType === 'binary'\n ? ['instanceof', 'File']\n : ['fileOrString', undefined],\n ];\n if (!isRequired) {\n fileFunctions.push(['optional', undefined]);\n }\n propertyOverrides[key] = { functions: fileFunctions, consts: [] };\n }\n }\n }\n\n // Delegate to generic handler with file type overrides\n return generateZodValidationSchemaDefinition(\n schema,\n context,\n name,\n strict,\n isZodV4,\n {\n required: true,\n propertyOverrides:\n Object.keys(propertyOverrides).length > 0\n ? propertyOverrides\n : undefined,\n useReusableSchemas,\n },\n );\n};\n\nconst parseBodyAndResponse = ({\n data,\n context,\n name,\n strict,\n generate,\n isZodV4,\n parseType,\n useReusableSchemas,\n}: {\n data:\n | OpenApiResponseObject\n | OpenApiRequestBodyObject\n | OpenApiReferenceObject\n | undefined;\n context: ContextSpec;\n name: string;\n strict: boolean;\n generate: boolean;\n isZodV4: boolean;\n parseType: 'body' | 'response';\n useReusableSchemas?: boolean;\n}): {\n input: ZodValidationSchemaDefinition;\n isArray: boolean;\n rules?: {\n min?: number;\n max?: number;\n };\n} => {\n if (!data || !generate) {\n return {\n input: { functions: [], consts: [] },\n isArray: false,\n };\n }\n\n const resolvedRef = resolveRef(data, context).schema as\n | OpenApiResponseObject\n | OpenApiRequestBodyObject;\n\n // Only handle JSON and form-data; other content types (e.g., application/octet-stream)\n // Only handle JSON and form-data; other content types (e.g., application/octet-stream)\n // are skipped - unclear if this is correct behavior for root-level binary/text bodies.\n const contentEntries = Object.entries(resolvedRef.content ?? {});\n\n const jsonContent = contentEntries.find(\n isMediaType(\n // application/json\n // application/geo+json\n // application/ld+json\n // application/manifest+json\n // application/vnd.api+json (and other valid vendor subtypes)\n String.raw`^application\\/([^/;]+\\+)?json$`,\n ),\n );\n const formDataContent = contentEntries.find(\n isMediaType(String.raw`^multipart\\/form-data$`),\n );\n const [contentType, mediaType] = jsonContent\n ? (['application/json', jsonContent[1]] as const)\n : formDataContent\n ? (['multipart/form-data', formDataContent[1]] as const)\n : [undefined, undefined];\n\n const schema = mediaType?.schema;\n\n if (!schema) {\n if (parseType === 'response') {\n const textPlainContent = contentEntries.find(\n isMediaType(String.raw`^text\\/plain$`),\n );\n if (textPlainContent) {\n return {\n input: { functions: [['string', undefined]], consts: [] },\n isArray: false,\n };\n }\n }\n\n return {\n input: { functions: [], consts: [] },\n isArray: false,\n };\n }\n\n const encoding = mediaType.encoding;\n const resolvedJsonSchema = dereference(schema, context);\n\n // keep the same behaviour for array\n if (resolvedJsonSchema.items) {\n const min =\n resolvedJsonSchema.minimum ??\n resolvedJsonSchema.minLength ??\n resolvedJsonSchema.minItems;\n const max =\n resolvedJsonSchema.maximum ??\n resolvedJsonSchema.maxLength ??\n resolvedJsonSchema.maxItems;\n\n // When useReusableSchemas is on, shallow-resolve one level so that $ref\n // references inside the items schema are preserved for named-ref emission.\n // E.g. Pets = array of {$ref: Pet} → we want to emit Pet (namedRef)\n // rather than inlining Pet's full schema.\n const rawItems: OpenApiSchemaObject | OpenApiReferenceObject =\n useReusableSchemas\n ? (() => {\n const shallowArraySchema = resolveRef(schema, context)\n .schema as OpenApiSchemaObject;\n return (shallowArraySchema.items ??\n resolvedJsonSchema.items) as OpenApiSchemaObject;\n })()\n : resolvedJsonSchema.items;\n\n return {\n input: generateZodValidationSchemaDefinition(\n parseType === 'body'\n ? removeReadOnlyProperties(rawItems as OpenApiSchemaObject)\n : (rawItems as OpenApiSchemaObject),\n context,\n name,\n strict,\n isZodV4,\n {\n required: true,\n useReusableSchemas,\n },\n ),\n isArray: true,\n rules: {\n ...(min === undefined ? {} : { min }),\n ...(max === undefined ? {} : { max }),\n },\n };\n }\n\n // When useReusableSchemas is on, pass the original schema (possibly a $ref)\n // directly to generateZodValidationSchemaDefinition so that component schema\n // references are emitted as named identifiers instead of being inlined.\n const effectiveSchema: OpenApiSchemaObject | OpenApiReferenceObject =\n useReusableSchemas\n ? parseType === 'body'\n ? removeReadOnlyProperties(schema as OpenApiSchemaObject)\n : schema\n : parseType === 'body'\n ? removeReadOnlyProperties(resolvedJsonSchema)\n : resolvedJsonSchema;\n\n const isFormData = contentType === 'multipart/form-data';\n\n return {\n input: isFormData\n ? generateFormDataZodSchema(\n effectiveSchema,\n context,\n name,\n strict,\n isZodV4,\n encoding,\n useReusableSchemas,\n )\n : generateZodValidationSchemaDefinition(\n effectiveSchema,\n context,\n name,\n strict,\n isZodV4,\n { required: true, useReusableSchemas },\n ),\n isArray: false,\n };\n};\n\nconst isMediaType =\n (pattern: string) =>\n ([contentType]: [string, object]): boolean =>\n new RegExp(pattern).test(contentType.split(';')[0].trim().toLowerCase());\n\nconst getSingleResponse = (\n responses:\n | Record<string, OpenApiResponseObject | OpenApiReferenceObject | undefined>\n | undefined,\n) => {\n if (!responses) {\n return;\n }\n\n const otherSuccess = Object.entries(responses).find(\n ([code]) => code.startsWith('2') && code !== '204' && code !== '205',\n )?.[1];\n\n return (\n responses['200'] ??\n responses['2XX'] ??\n responses['2xx'] ??\n otherSuccess ??\n responses['204'] ??\n responses['205']\n );\n};\n\n/* eslint-enable @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-argument, @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-call */\n\nexport const parseParameters = ({\n data,\n context,\n operationName,\n isZodV4,\n strict,\n generate,\n useReusableSchemas,\n}: {\n data: (OpenApiParameterObject | OpenApiReferenceObject)[] | undefined;\n context: ContextSpec;\n operationName: string;\n isZodV4: boolean;\n strict: {\n param: boolean;\n query: boolean;\n header: boolean;\n body: boolean;\n response: boolean;\n };\n generate: {\n param: boolean;\n query: boolean;\n header: boolean;\n body: boolean;\n response: boolean;\n };\n useReusableSchemas?: boolean;\n}): {\n headers: ZodValidationSchemaDefinition;\n queryParams: ZodValidationSchemaDefinition;\n params: ZodValidationSchemaDefinition;\n} => {\n if (!data) {\n return {\n headers: {\n functions: [],\n consts: [],\n },\n queryParams: {\n functions: [],\n consts: [],\n },\n params: {\n functions: [],\n consts: [],\n },\n };\n }\n\n const initialDefinitionsByParameters: Record<\n 'headers' | 'queryParams' | 'params',\n Record<string, { functions: [string, unknown][]; consts: string[] }>\n > = {\n headers: {},\n queryParams: {},\n params: {},\n };\n\n const defintionsByParameters = data.reduce((acc, val) => {\n const { schema: parameter }: { schema: OpenApiParameterObject } =\n resolveRef(val, context);\n\n if (!parameter.schema) {\n return acc;\n }\n if (!parameter.in || !parameter.name) {\n return acc;\n }\n\n // When useReusableSchemas is on, preserve `$ref` schemas verbatim so the\n // generator can take the namedRef path. We only shallow-clone to attach\n // the parameter-level `description` without mutating the shared ref object.\n // When off, fall back to dereferencing for backward compatibility.\n const schemaForGen: OpenApiSchemaObject | OpenApiReferenceObject =\n useReusableSchemas\n ? parameter.description\n ? Object.assign({}, parameter.schema, {\n description: parameter.description,\n })\n : parameter.schema\n : (() => {\n const s = dereference(parameter.schema, context);\n s.description = parameter.description;\n return s;\n })();\n\n const mapStrict = {\n path: strict.param,\n query: strict.query,\n header: strict.header,\n };\n\n const mapGenerate = {\n path: generate.param,\n query: generate.query,\n header: generate.header,\n };\n\n if (\n parameter.in !== 'path' &&\n parameter.in !== 'query' &&\n parameter.in !== 'header'\n ) {\n return acc;\n }\n\n const definition = generateZodValidationSchemaDefinition(\n schemaForGen,\n context,\n camel(`${operationName}-${parameter.in}-${parameter.name}`),\n mapStrict[parameter.in],\n isZodV4,\n {\n required: parameter.required,\n useReusableSchemas,\n },\n );\n\n if (parameter.in === 'header' && mapGenerate.header) {\n return {\n ...acc,\n headers: { ...acc.headers, [parameter.name]: definition },\n };\n }\n\n if (parameter.in === 'query' && mapGenerate.query) {\n return {\n ...acc,\n queryParams: { ...acc.queryParams, [parameter.name]: definition },\n };\n }\n\n if (parameter.in === 'path' && mapGenerate.path) {\n return {\n ...acc,\n params: { ...acc.params, [parameter.name]: definition },\n };\n }\n\n return acc;\n }, initialDefinitionsByParameters);\n\n const headers: ZodValidationSchemaDefinition = {\n functions: [],\n consts: [],\n };\n\n if (Object.keys(defintionsByParameters.headers).length > 0) {\n const parameterFunctions = getParameterFunctions(\n isZodV4,\n strict.header,\n defintionsByParameters.headers,\n );\n\n headers.functions.push(...parameterFunctions);\n }\n\n const queryParams: ZodValidationSchemaDefinition = {\n functions: [],\n consts: [],\n };\n\n if (Object.keys(defintionsByParameters.queryParams).length > 0) {\n const parameterFunctions = getParameterFunctions(\n isZodV4,\n strict.query,\n defintionsByParameters.queryParams,\n );\n\n queryParams.functions.push(...parameterFunctions);\n }\n\n const params: ZodValidationSchemaDefinition = {\n functions: [],\n consts: [],\n };\n\n if (Object.keys(defintionsByParameters.params).length > 0) {\n const parameterFunctions = getParameterFunctions(\n isZodV4,\n strict.param,\n defintionsByParameters.params,\n );\n\n params.functions.push(...parameterFunctions);\n }\n\n return {\n headers,\n queryParams,\n params,\n };\n};\n\nconst generateZodRoute = async (\n { operationId, operationName, verb, override }: GeneratorVerbOptions,\n { pathRoute, context, output }: GeneratorOptions,\n) => {\n const isZodV4 =\n !!context.output.packageJson && isZodVersionV4(context.output.packageJson);\n const useReusableSchemas =\n context.output.override.zod.generateReusableSchemas;\n const spec = context.spec.paths?.[pathRoute];\n\n if (spec == undefined) {\n throw new Error(`No such path ${pathRoute} in ${context.projectName}`);\n }\n\n const parameters = [\n ...(spec.parameters ?? []),\n ...(spec[verb]?.parameters ?? []),\n ];\n\n const parsedParameters = parseParameters({\n data: parameters,\n context,\n operationName,\n isZodV4,\n strict: override.zod.strict,\n generate: override.zod.generate,\n useReusableSchemas,\n });\n\n const requestBody = spec[verb]?.requestBody;\n const parsedBody = parseBodyAndResponse({\n data: requestBody,\n context,\n name: camel(`${operationName}-body`),\n strict: override.zod.strict.body,\n generate: override.zod.generate.body,\n isZodV4,\n parseType: 'body',\n useReusableSchemas,\n });\n\n const responses = (\n context.output.override.zod.generateEachHttpStatus\n ? Object.entries(spec[verb]?.responses ?? {})\n : [['', getSingleResponse(spec[verb]?.responses)]]\n ) as [string, OpenApiResponseObject | OpenApiReferenceObject][];\n const parsedResponses = responses.map(([code, response]) =>\n parseBodyAndResponse({\n data: response,\n context,\n name: camel(`${operationName}-${code}-response`),\n strict: override.zod.strict.response,\n generate: override.zod.generate.response,\n isZodV4,\n parseType: 'response',\n useReusableSchemas,\n }),\n );\n\n const preprocessParams = override.zod.preprocess?.param\n ? await generateMutator({\n output,\n mutator: override.zod.preprocess.param,\n name: `${operationName}PreprocessParams`,\n workspace: context.workspace,\n tsconfig: context.output.tsconfig,\n })\n : undefined;\n\n const paramsMutator = override.zod.params\n ? await generateMutator({\n output,\n mutator: override.zod.params,\n name: `${operationName}ZodParams`,\n workspace: context.workspace,\n tsconfig: context.output.tsconfig,\n })\n : undefined;\n\n const pascalOperationName = pascal(operationName);\n const makeParamsInjection = (\n location: ZodParamsInjection['location'],\n schemaSuffix: string,\n ): ZodParamsInjection | undefined =>\n paramsMutator\n ? {\n mutator: paramsMutator,\n operationId,\n location,\n schemaName: `${pascalOperationName}${schemaSuffix}`,\n }\n : undefined;\n\n let inputParams = parseZodValidationSchemaDefinition(\n parsedParameters.params,\n context,\n override.zod.coerce.param,\n override.zod.strict.param,\n isZodV4,\n preprocessParams,\n makeParamsInjection('param', 'Params'),\n );\n\n const preprocessQueryParams = override.zod.preprocess?.query\n ? await generateMutator({\n output,\n mutator: override.zod.preprocess.query,\n name: `${operationName}PreprocessQueryParams`,\n workspace: context.workspace,\n tsconfig: context.output.tsconfig,\n })\n : undefined;\n\n let inputQueryParams = parseZodValidationSchemaDefinition(\n parsedParameters.queryParams,\n context,\n override.zod.coerce.query,\n override.zod.strict.query,\n isZodV4,\n preprocessQueryParams,\n makeParamsInjection('query', 'QueryParams'),\n );\n\n const preprocessHeader = override.zod.preprocess?.header\n ? await generateMutator({\n output,\n mutator: override.zod.preprocess.header,\n name: `${operationName}PreprocessHeader`,\n workspace: context.workspace,\n tsconfig: context.output.tsconfig,\n })\n : undefined;\n\n let inputHeaders = parseZodValidationSchemaDefinition(\n parsedParameters.headers,\n context,\n override.zod.coerce.header,\n override.zod.strict.header,\n isZodV4,\n preprocessHeader,\n makeParamsInjection('header', 'Header'),\n );\n\n const preprocessBody = override.zod.preprocess?.body\n ? await generateMutator({\n output,\n mutator: override.zod.preprocess.body,\n name: `${operationName}PreprocessBody`,\n workspace: context.workspace,\n tsconfig: context.output.tsconfig,\n })\n : undefined;\n\n let inputBody = parseZodValidationSchemaDefinition(\n parsedBody.input,\n context,\n override.zod.coerce.body,\n override.zod.strict.body,\n isZodV4,\n preprocessBody,\n makeParamsInjection('body', 'Body'),\n );\n\n const preprocessResponse = override.zod.preprocess?.response\n ? await generateMutator({\n output,\n mutator: override.zod.preprocess.response,\n name: `${operationName}PreprocessResponse`,\n workspace: context.workspace,\n tsconfig: context.output.tsconfig,\n })\n : undefined;\n\n const inputResponses = parsedResponses.map((parsedResponse, index) =>\n parseZodValidationSchemaDefinition(\n parsedResponse.input,\n context,\n override.zod.coerce.response,\n override.zod.strict.response,\n isZodV4,\n preprocessResponse,\n makeParamsInjection(\n 'response',\n responses[index][0] ? `${responses[index][0]}Response` : 'Response',\n ),\n ),\n );\n\n const SENTINEL_PATTERN = /__REF_([A-Za-z_$][A-Za-z0-9_$]*)__/g;\n const rewriteSentinels = (s: string): string =>\n s.replaceAll(SENTINEL_PATTERN, (_m, name: string) => name);\n\n const allUsedRefs = new Set<string>([\n ...inputParams.usedRefs,\n ...inputQueryParams.usedRefs,\n ...inputHeaders.usedRefs,\n ...inputBody.usedRefs,\n ...inputResponses.flatMap((r) => [...r.usedRefs]),\n ]);\n\n if (useReusableSchemas && allUsedRefs.size > 0) {\n inputParams = { ...inputParams, zod: rewriteSentinels(inputParams.zod) };\n inputQueryParams = {\n ...inputQueryParams,\n zod: rewriteSentinels(inputQueryParams.zod),\n };\n inputHeaders = {\n ...inputHeaders,\n zod: rewriteSentinels(inputHeaders.zod),\n };\n inputBody = { ...inputBody, zod: rewriteSentinels(inputBody.zod) };\n for (let i = 0; i < inputResponses.length; i++) {\n inputResponses[i] = {\n ...inputResponses[i],\n zod: rewriteSentinels(inputResponses[i].zod),\n };\n }\n }\n\n if (\n !inputParams.zod &&\n !inputQueryParams.zod &&\n !inputHeaders.zod &&\n !inputBody.zod &&\n responses.length === 0\n ) {\n return {\n implementation: '',\n mutators: [],\n usedRefs: new Set<string>(),\n };\n }\n\n const useBrandedTypes = override.zod.useBrandedTypes;\n const brand = (name: string) =>\n useBrandedTypes\n ? isZodV4\n ? `.brand(\"${name}\")`\n : `.brand<\"${name}\">()`\n : '';\n\n // With `generateReusableSchemas`, operations import component schemas by\n // their PascalCase name from a sibling schemas module. When an operation's\n // own pascalized wrapper name (e.g. `ListPetsResponse` from operationId\n // `listPets`) matches an imported ref, the generated `export const` shadows\n // the import and produces a self-referential initializer that TS rejects\n // with TS7022. Detect the collision and append `Schema` (with a counter for\n // further collisions) so the import keeps its meaning. For the array case\n // both the wrapper and its `Item` companion are checked together so they\n // stay in sync. The original name is preserved when there is no collision,\n // so non-colliding operations are unaffected.\n //\n // `localTaken` seeds from the imported refs and accumulates the names this\n // call hands out, so wrappers within the same operation (`Params`, `Body`,\n // per-status `Response`, …) can't pick a name another wrapper just claimed.\n // The fixed suffixes already keep these distinct in practice, but tracking\n // allocations removes the implicit invariant — future suffix additions stay\n // safe by construction.\n const localTaken = new Set(allUsedRefs);\n const allocateExportName = (baseName: string, hasItem: boolean): string => {\n const collides = (name: string) =>\n localTaken.has(name) || (hasItem && localTaken.has(`${name}Item`));\n const reserve = (name: string) => {\n localTaken.add(name);\n if (hasItem) localTaken.add(`${name}Item`);\n };\n if (!collides(baseName)) {\n reserve(baseName);\n return baseName;\n }\n let counter = 0;\n let candidate = `${baseName}Schema`;\n while (collides(candidate)) {\n counter += 1;\n candidate = `${baseName}Schema${counter}`;\n }\n reserve(candidate);\n return candidate;\n };\n\n const paramsName = allocateExportName(`${pascalOperationName}Params`, false);\n const queryParamsName = allocateExportName(\n `${pascalOperationName}QueryParams`,\n false,\n );\n const headerName = allocateExportName(`${pascalOperationName}Header`, false);\n const bodyName = allocateExportName(\n `${pascalOperationName}Body`,\n parsedBody.isArray,\n );\n\n return {\n implementation: [\n ...(inputParams.consts ? [inputParams.consts] : []),\n ...(inputParams.zod\n ? [\n `export const ${paramsName} = ${inputParams.zod}${brand(paramsName)}`,\n ]\n : []),\n ...(inputQueryParams.consts ? [inputQueryParams.consts] : []),\n ...(inputQueryParams.zod\n ? [\n `export const ${queryParamsName} = ${inputQueryParams.zod}${brand(queryParamsName)}`,\n ]\n : []),\n ...(inputHeaders.consts ? [inputHeaders.consts] : []),\n ...(inputHeaders.zod\n ? [\n `export const ${headerName} = ${inputHeaders.zod}${brand(headerName)}`,\n ]\n : []),\n ...(inputBody.consts ? [inputBody.consts] : []),\n ...(inputBody.zod\n ? [\n parsedBody.isArray\n ? `export const ${bodyName}Item = ${inputBody.zod}\nexport const ${bodyName} = zod.array(${bodyName}Item)${\n parsedBody.rules?.min ? `.min(${parsedBody.rules.min})` : ''\n }${\n parsedBody.rules?.max ? `.max(${parsedBody.rules.max})` : ''\n }${brand(bodyName)}`\n : `export const ${bodyName} = ${inputBody.zod}${brand(bodyName)}`,\n ]\n : []),\n ...inputResponses.flatMap((inputResponse, index) => {\n const operationResponse = allocateExportName(\n pascal(`${operationName}-${responses[index][0]}-response`),\n parsedResponses[index].isArray,\n );\n\n if (!inputResponse.zod) {\n if (!override.zod.generate.response) {\n return [];\n }\n\n const noContentStatusCodes = new Set(['204', '205']);\n const statusCode = responses[index][0];\n const isEachHttpStatusMode = !!statusCode;\n\n let isNoContent: boolean;\n if (isEachHttpStatusMode) {\n isNoContent = noContentStatusCodes.has(statusCode);\n } else {\n const specResponseKeys = new Set(\n Object.keys(spec[verb]?.responses ?? {}),\n );\n const hasStandardSuccess =\n specResponseKeys.has('200') ||\n specResponseKeys.has('2XX') ||\n specResponseKeys.has('2xx');\n isNoContent = !hasStandardSuccess;\n }\n const noContentSchema = isNoContent ? 'zod.void()' : 'zod.unknown()';\n\n return [\n `export const ${operationResponse} = ${noContentSchema}${brand(operationResponse)}`,\n ];\n }\n\n return [\n ...(inputResponse.consts ? [inputResponse.consts] : []),\n parsedResponses[index].isArray\n ? `export const ${operationResponse}Item = ${inputResponse.zod}\nexport const ${operationResponse} = zod.array(${operationResponse}Item)${\n parsedResponses[index].rules?.min\n ? `.min(${parsedResponses[index].rules.min})`\n : ''\n }${\n parsedResponses[index].rules?.max\n ? `.max(${parsedResponses[index].rules.max})`\n : ''\n }${brand(operationResponse)}`\n : `export const ${operationResponse} = ${inputResponse.zod}${brand(operationResponse)}`,\n ];\n }),\n ].join('\\n\\n'),\n mutators: [\n // Gate each request-side preprocess mutator on its parsed `.zod`: it is\n // computed for every operation once the target is configured, so without\n // this an operation lacking the schema would emit an unused import.\n ...(preprocessParams && inputParams.zod ? [preprocessParams] : []),\n ...(preprocessQueryParams && inputQueryParams.zod\n ? [preprocessQueryParams]\n : []),\n ...(preprocessHeader && inputHeaders.zod ? [preprocessHeader] : []),\n ...(preprocessBody && inputBody.zod ? [preprocessBody] : []),\n ...(preprocessResponse ? [preprocessResponse] : []),\n // Unconditional even when this operation's parsed schemas don't\n // reference `paramsMutator.name`: in `single` mode, inline component\n // schemas (which DO reference it) rely on this entry to emit the\n // import. The cost is one harmless `import { zodParams }` line on\n // operations whose request/response have no leaf validators to inject.\n ...(paramsMutator ? [paramsMutator] : []),\n ],\n usedRefs: useReusableSchemas ? allUsedRefs : new Set<string>(),\n };\n};\n\nexport const generateZod: ClientBuilder = async (verbOptions, options) => {\n const { implementation, mutators, usedRefs } = await generateZodRoute(\n verbOptions,\n options,\n );\n\n return {\n implementation: implementation ? `${implementation}\\n\\n` : '',\n // Zod schemas are runtime values (not type-only), so mark with values: true\n // to prevent the import writer from emitting `import type { ... }`. Sort\n // by name so import order is stable across runs.\n imports: [...usedRefs].toSorted().map((name) => ({\n name,\n schemaName: name,\n values: true,\n })),\n mutators,\n };\n};\n\nconst zodClientBuilder: ClientGeneratorsBuilder = {\n client: generateZod,\n dependencies: getZodDependencies,\n};\n\nexport const builder = () => () => zodClientBuilder;\n\nexport { isZodVersionV4 } from './compatible-v4';\n\nexport default builder;\n"],"mappings":";;;AAEA,MAAM,wBAAwB,gBAA6B;CACzD,OACE,YAAY,kBAAkB,OAC9B,YAAY,cAAc,OAC1B,YAAY,iBAAiB,OAC7B,YAAY,kBAAkB;AAElC;AAEA,MAAa,kBAAkB,gBAA6B;CAC1D,MAAM,UAAU,qBAAqB,WAAW;CAEhD,IAAI,CAAC,SACH,OAAO;CAGT,MAAM,YAAY,QAAQ,MAAM,GAAG,EAAE;CAErC,OAAO,gBAAgB,WAAW,OAAO;AAC3C;AAEA,MAAa,oBAAoB,YAAqB;CACpD,OAAO,UAAU,aAAa;AAChC;AAEA,MAAa,oBAAoB,YAAqB;CACpD,OAAO,UAAU,aAAa;AAChC;AAEA,MAAa,wBAAwB,YAAqB;CACxD,OAAO,UAAU,iBAAiB;AACpC;AAIA,MAAa,yBACX,SACA,QACA,eACwB;CACxB,IAAI,WAAW,QACb,OAAO,CAAC,CAAC,gBAAgB,UAAU,CAAC;MAEpC,OAAO,SACH,CACE,CAAC,UAAU,UAAU,GACrB,CAAC,UAAU,KAAA,CAAS,CACtB,IACA,CAAC,CAAC,UAAU,UAAU,CAAC;AAE/B;AAEA,MAAa,yBAAyB,SAAkB,WAAoB;CAC1E,OAAO,WAAW,SAAS,iBAAiB;AAC9C;;;;;;;;AASA,MAAa,8BAA8B,YAAqB;CAC9D,OAAO,UAAU,gBAAgB;AACnC;;;AClBA,MAAM,mBAA0C,CAC9C;CACE,SAAS,CACP;EACE,SAAS;EACT,MAAM;EACN,wBAAwB;EACxB,iBAAiB;EACjB,QAAQ;CACV,CACF;CACA,YAAY;AACd,CACF;AAEA,MAAa,2BAA2B;;;;AAKxC,MAAM,sBAAsB,IAAI,IAAI;CAClC;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF,CAAC;AAED,MAAa,uBAAuB,IAAI,IAAI;CAC1C;CACA;CACA;CACA;CACA;CACA;CACA;AACF,CAAC;AAQD,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AU,aAAa,MAAM,iBACnD,aACA,OACF;CAEA,OAAO;EACL,gBAAgB,iBAAiB,GAAG,eAAe,QAAQ;EAI3D,SAAS,CAAC,GAAG,QAAQ,EAAE,SAAS,EAAE,KAAK,UAAU;GAC/C;GACA,YAAY;GACZ,QAAQ;EACV,EAAE;EACF;CACF;AACF;AAEA,MAAM,mBAA4C;CAChD,QAAQ;CACR,cAAc;AAChB;AAEA,MAAa,sBAAsB"}
|
|
1
|
+
{"version":3,"file":"index.mjs","names":[],"sources":["../src/compatible-v4.ts","../src/index.ts"],"sourcesContent":["import { compareVersions, type PackageJson } from '@orval/core';\n\nconst getZodPackageVersion = (packageJson: PackageJson) => {\n return (\n packageJson.resolvedVersions?.zod ??\n packageJson.dependencies?.zod ??\n packageJson.devDependencies?.zod ??\n packageJson.peerDependencies?.zod\n );\n};\n\nexport const isZodVersionV4 = (packageJson: PackageJson) => {\n const version = getZodPackageVersion(packageJson);\n\n if (!version) {\n return false;\n }\n\n const withoutRc = version.split('-')[0];\n\n return compareVersions(withoutRc, '4.0.0');\n};\n\nexport const getZodDateFormat = (isZodV4: boolean) => {\n return isZodV4 ? 'iso.date' : 'date';\n};\n\nexport const getZodTimeFormat = (isZodV4: boolean) => {\n return isZodV4 ? 'iso.time' : 'time';\n};\n\nexport const getZodDateTimeFormat = (isZodV4: boolean) => {\n return isZodV4 ? 'iso.datetime' : 'datetime';\n};\n\ntype ParameterDefinitions = Record<string, unknown>;\ntype ParameterFunction = [string, ParameterDefinitions | undefined];\nexport const getParameterFunctions = (\n isZodV4: boolean,\n strict: boolean,\n parameters: ParameterDefinitions,\n): ParameterFunction[] => {\n if (isZodV4 && strict) {\n return [['strictObject', parameters]];\n } else {\n return strict\n ? [\n ['object', parameters],\n ['strict', undefined],\n ]\n : [['object', parameters]];\n }\n};\n\nexport const getObjectFunctionName = (isZodV4: boolean, strict: boolean) => {\n return isZodV4 && strict ? 'strictObject' : 'object';\n};\n\n/**\n * Returns the object constructor to use for open/generic objects.\n *\n * - Zod v4 supports `zod.looseObject({...})` directly.\n * - Zod v3 falls back to `zod.object({...})` and is finalized with\n * `.passthrough()` during parsing.\n */\nexport const getLooseObjectFunctionName = (isZodV4: boolean) => {\n return isZodV4 ? 'looseObject' : 'object';\n};\n","/* eslint-disable unicorn/no-array-reduce */\n\nimport {\n buildDynamicScope,\n camel,\n type ClientBuilder,\n type ClientGeneratorsBuilder,\n type ContextSpec,\n generateMutator,\n type GeneratorDependency,\n type GeneratorMutator,\n type GeneratorOptions,\n type GeneratorVerbOptions,\n getDynamicAnchorName,\n getFormDataFieldFileType,\n getNumberWord,\n getRefInfo,\n isBoolean,\n isDynamicReference,\n isNumber,\n isObject,\n isString,\n jsStringEscape,\n jsStringLiteralEscape,\n logVerbose,\n type OpenApiParameterObject,\n type OpenApiReferenceObject,\n type OpenApiRequestBodyObject,\n type OpenApiResponseObject,\n type OpenApiSchemaObject,\n pascal,\n resolveDynamicRef,\n resolveRef,\n stringify,\n type ZodCoerceType,\n} from '@orval/core';\nimport { unique } from 'remeda';\n\nimport {\n getLooseObjectFunctionName,\n getObjectFunctionName,\n getParameterFunctions,\n getZodDateFormat,\n getZodDateTimeFormat,\n getZodTimeFormat,\n isZodVersionV4,\n} from './compatible-v4';\n\nconst ZOD_DEPENDENCIES: GeneratorDependency[] = [\n {\n exports: [\n {\n default: false,\n name: 'zod',\n syntheticDefaultImport: false,\n namespaceImport: true,\n values: true,\n },\n ],\n dependency: 'zod',\n },\n];\n\nexport const getZodDependencies = () => ZOD_DEPENDENCIES;\n\n/**\n * values that may appear in \"type\". Equals SchemaObjectType\n */\nconst possibleSchemaTypes = new Set([\n 'integer',\n 'number',\n 'string',\n 'boolean',\n 'object',\n 'strictObject',\n 'null',\n 'array',\n]);\n\nexport const predefinedZodFormats = new Set([\n 'date',\n 'time',\n 'date-time',\n 'email',\n 'uri',\n 'hostname',\n 'uuid',\n]);\n\ntype ResolvedZodType =\n | string\n | {\n multiType: string[];\n };\n\nconst resolveZodType = (schema: OpenApiSchemaObject): ResolvedZodType => {\n const schemaTypeValue = schema.type as unknown;\n\n // Handle array of types (OpenAPI 3.1+)\n if (Array.isArray(schemaTypeValue)) {\n // Filter out 'null' type as it's handled separately via nullable\n const nonNullTypes = schemaTypeValue\n .filter((t): t is string => isString(t))\n .filter((t) => t !== 'null' && possibleSchemaTypes.has(t))\n .map((t) => (t === 'integer' ? 'number' : t));\n\n // If multiple types, return a special marker for union handling\n if (nonNullTypes.length > 1) {\n return { multiType: nonNullTypes };\n }\n\n // Single type\n const type = nonNullTypes[0];\n\n // Handle prefixItems for tuples\n if (type === 'array' && 'prefixItems' in schema) {\n return 'tuple';\n }\n\n return type;\n }\n\n // Handle single type value\n const type = isString(schemaTypeValue) ? schemaTypeValue : undefined;\n\n // TODO: if \"prefixItems\" exists and type is \"array\", then generate a \"tuple\"\n if (schema.type === 'array' && 'prefixItems' in schema) {\n return 'tuple';\n }\n\n switch (type) {\n case 'integer': {\n return 'number';\n }\n default: {\n return type ?? 'unknown';\n }\n }\n};\n\n// https://github.com/colinhacks/zod#coercion-for-primitives\nconst COERCIBLE_TYPES = new Set([\n 'string',\n 'number',\n 'boolean',\n 'bigint',\n 'date',\n]);\n\nexport interface ZodValidationSchemaDefinition {\n functions: [string, unknown][];\n consts: string[];\n}\n\nconst minAndMaxTypes = new Set(['number', 'string', 'array']);\n\nconst removeReadOnlyProperties = (\n schema: OpenApiSchemaObject,\n): OpenApiSchemaObject => {\n if (schema.properties && isObject(schema.properties)) {\n const filteredProperties: Record<string, OpenApiSchemaObject> = {};\n\n for (const [key, value] of Object.entries(schema.properties)) {\n if (isObject(value) && 'readOnly' in value && value.readOnly) {\n continue;\n }\n filteredProperties[key] = value as OpenApiSchemaObject;\n }\n\n return {\n ...(schema as Record<string, unknown>),\n properties: filteredProperties,\n };\n }\n if (schema.items && isObject(schema.items) && 'properties' in schema.items) {\n return {\n ...(schema as Record<string, unknown>),\n items: removeReadOnlyProperties(schema.items as OpenApiSchemaObject),\n };\n }\n return schema;\n};\n\ninterface DateTimeOptions {\n offset?: boolean;\n local?: boolean;\n precision?: number;\n}\n\ninterface TimeOptions {\n precision?: -1 | 0 | 1 | 2 | 3;\n}\n\n/* eslint-disable @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-argument, @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-call */\n\nconst COMPONENT_SCHEMAS_REF_PATTERN = /^#\\/components\\/schemas\\/[^/]+$/;\n\nconst isComponentSchemaRef = (ref: string): boolean =>\n COMPONENT_SCHEMAS_REF_PATTERN.test(ref);\n\nexport const generateZodValidationSchemaDefinition = (\n schema: OpenApiSchemaObject | OpenApiReferenceObject | undefined,\n context: ContextSpec,\n name: string,\n strict: boolean,\n isZodV4: boolean,\n rules?: {\n required?: boolean;\n /**\n * Required keys inherited from sibling `allOf` members. Per JSON Schema /\n * OpenAPI 3.1, a `required` array in one `allOf` member applies to\n * properties contributed by ANY member, so it is collected at the `allOf`\n * level and applied here. Consumed at THIS object level only — never\n * forwarded into nested property schemas, so a deeper object sharing a key\n * name is unaffected. (#3171)\n */\n additionalRequired?: string[];\n dateTimeOptions?: DateTimeOptions;\n timeOptions?: TimeOptions;\n /**\n * Override schemas for properties at THIS level only.\n * Not passed to nested schemas. Used by form-data for file type handling.\n */\n propertyOverrides?: Record<string, ZodValidationSchemaDefinition>;\n /**\n * Internal registry to keep generated const names unique within a single\n * schema generation tree without leaking suffixes across unrelated top-level\n * schemas.\n */\n constNameRegistry?: Record<string, number>;\n /**\n * When true, plain `$ref`s into `#/components/schemas/*` emit a `namedRef`\n * placeholder instead of being inlined.\n */\n useReusableSchemas?: boolean;\n /**\n * When true (and `isZodV4`), the top-level (named component) schema emits a\n * `.meta({ id, description?, deprecated? })` instead of `.describe(...)`.\n * Set ONLY for top-level component-schema generation — recursive calls omit\n * it, so nested schemas keep `.describe()` and never get a duplicate `id`.\n */\n emitMeta?: boolean;\n },\n): ZodValidationSchemaDefinition => {\n if (!schema) return { functions: [], consts: [] };\n\n const CHAINABLE_SIBLINGS = new Set(['nullable', 'default', 'description']);\n const isChainable = (k: string) => CHAINABLE_SIBLINGS.has(k);\n\n const applyChainableSiblings = (\n functions: [string, unknown][],\n consts: string[],\n siblingSchema: OpenApiSchemaObject & {\n nullable?: boolean;\n default?: unknown;\n description?: string;\n },\n ): void => {\n const refRequired = rules?.required ?? false;\n const refHasDefault = siblingSchema.default !== undefined;\n\n if (!refRequired && siblingSchema.nullable) {\n functions.push(['nullish', undefined]);\n } else if (siblingSchema.nullable) {\n functions.push(['nullable', undefined]);\n } else if (!refRequired && !refHasDefault) {\n functions.push(['optional', undefined]);\n }\n\n if (refHasDefault) {\n const registry = rules?.constNameRegistry ?? {};\n const counter = isNumber(registry[name]) ? registry[name] + 1 : 0;\n registry[name] = counter;\n const suffix = counter ? pascal(getNumberWord(counter)) : '';\n const defaultVarName = `${name}Default${suffix}`;\n const defaultLiteral = stringify(siblingSchema.default);\n if (defaultLiteral !== undefined) {\n consts.push(`export const ${defaultVarName} = ${defaultLiteral};`);\n functions.push(['default', defaultVarName]);\n }\n }\n\n if (typeof siblingSchema.description === 'string') {\n // Use the same single-quoted, fully JS-escaped form as the primitive\n // description path (see `pushDescriptionOrMeta`). `escape` only escapes\n // quote chars, so a multi-line description would emit raw newlines and\n // break the generated string literal (TS1002).\n functions.push([\n 'describe',\n `'${jsStringEscape(siblingSchema.description)}'`,\n ]);\n }\n };\n\n // Ref-aware path: emit a placeholder that the orchestrator will rewrite into\n // either a direct identifier or `z.lazy(() => Name)`.\n if (\n rules?.useReusableSchemas &&\n '$ref' in schema &&\n typeof schema.$ref === 'string' &&\n isComponentSchemaRef(schema.$ref)\n ) {\n const siblings = Object.keys(schema).filter((k) => k !== '$ref');\n const allSiblingsChainable = siblings.every((k) => isChainable(k));\n\n if (allSiblingsChainable) {\n const refName = getRefInfo(schema.$ref, context).name;\n const functions: [string, unknown][] = [\n ['namedRef', { name: refName, sourceRef: schema.$ref }],\n ];\n const consts: string[] = [];\n\n applyChainableSiblings(\n functions,\n consts,\n schema as OpenApiSchemaObject & {\n $ref: string;\n nullable?: boolean;\n default?: unknown;\n description?: string;\n },\n );\n\n return { functions, consts };\n }\n\n logVerbose(\n `[orval/zod] $ref ${schema.$ref} has non-chainable siblings ` +\n `[${siblings.filter((s) => !isChainable(s)).join(', ')}]; falling back to inlining.`,\n );\n schema = dereference(\n schema as OpenApiSchemaObject | OpenApiReferenceObject,\n context,\n );\n }\n\n // Dynamic-ref-aware path: when useReusableSchemas is true, resolve the\n // anchor and emit a namedRef sentinel if the target is a concrete component\n // schema. The SCC pipeline then decides direct vs zod.lazy().\n if (rules?.useReusableSchemas && isDynamicReference(schema)) {\n const anchorName = getDynamicAnchorName(schema.$dynamicRef);\n if (anchorName) {\n const { resolvedTypeName, schemaName } = resolveDynamicRef(\n anchorName,\n context,\n );\n\n if (resolvedTypeName !== 'unknown' && schemaName) {\n const siblings = Object.keys(schema).filter((k) => k !== '$dynamicRef');\n const allSiblingsChainable = siblings.every((k) => isChainable(k));\n\n if (allSiblingsChainable) {\n const sourceRef = `${COMPONENT_SCHEMAS_PREFIX}${encodeSegment(schemaName)}`;\n const functions: [string, unknown][] = [\n ['namedRef', { name: resolvedTypeName, sourceRef }],\n ];\n const consts: string[] = [];\n\n applyChainableSiblings(\n functions,\n consts,\n schema as OpenApiSchemaObject & {\n $dynamicRef: string;\n nullable?: boolean;\n default?: unknown;\n description?: string;\n },\n );\n\n return { functions, consts };\n }\n\n logVerbose(\n `[orval/zod] $dynamicRef ${schema.$dynamicRef} has non-chainable siblings ` +\n `[${siblings.filter((s) => !isChainable(s)).join(', ')}]; falling back to inlining.`,\n );\n }\n }\n\n // Not emitted as namedRef (non-chainable siblings, unresolvable anchor,\n // or external ref) — dereference now so the main body sees a resolved\n // schema with a proper type instead of the raw $dynamicRef (which\n // resolveZodType classifies as 'unknown').\n schema = dereference(\n schema as OpenApiSchemaObject | OpenApiReferenceObject,\n context,\n );\n }\n\n const useReusableSchemas = rules?.useReusableSchemas ?? false;\n const consts: string[] = [];\n const constNameRegistry = rules?.constNameRegistry ?? {};\n const constsCounter = isNumber(constNameRegistry[name])\n ? constNameRegistry[name] + 1\n : 0;\n\n const constsCounterValue = constsCounter\n ? pascal(getNumberWord(constsCounter))\n : '';\n\n constNameRegistry[name] = constsCounter;\n\n const functions: [string, unknown][] = [];\n\n // Emit the schema's trailing description/metadata. On zod v4 with `emitMeta`\n // (top-level component schemas only) this is a single `.meta({ id, ... })`\n // carrying the schema name as `id` plus description/deprecated when present;\n // otherwise it falls back to the plain `.describe(...)`. Called from both\n // return points (the multi-type union exit and the main exit) so every schema\n // shape is covered. `.meta()` must be the LAST modifier in the chain — zod v4\n // turns `.meta({id}).describe(...)` into a `$ref` wrapper, whereas\n // `.describe(...).meta({id})` (and a lone `.meta`) stay flat.\n const pushDescriptionOrMeta = () => {\n // Empty-string descriptions are treated as absent — preserves the prior\n // `if (schema.description)` falsy-check semantics (which skipped both `''`\n // and `undefined`), so this change never emits a no-op `.describe('')` or\n // `description: ''` in meta.\n const description =\n typeof schema.description === 'string' && schema.description.length > 0\n ? schema.description\n : undefined;\n const deprecated =\n 'deprecated' in schema && schema.deprecated === true ? true : undefined;\n\n if (rules?.emitMeta && isZodV4) {\n const meta: Record<string, unknown> = { id: name };\n if (description !== undefined) meta.description = description;\n if (deprecated) meta.deprecated = true;\n functions.push(['meta', meta]);\n } else if (description !== undefined) {\n functions.push(['describe', `'${jsStringEscape(description)}'`]);\n }\n };\n\n const type = resolveZodType(schema);\n const required = rules?.required ?? false;\n const hasDefault = schema.default !== undefined;\n const nullable =\n // changing to ?? here changes behavior - so don't\n // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing\n ('nullable' in schema && schema.nullable) ||\n (Array.isArray(schema.type) && schema.type.includes('null'));\n const min = schema.minimum ?? schema.minLength ?? schema.minItems;\n const max = schema.maximum ?? schema.maxLength ?? schema.maxItems;\n\n // Handle exclusiveMinimum and exclusiveMaximum (OpenAPI 3.0 vs 3.1 compatibility)\n // OpenAPI 3.0: exclusiveMinimum/exclusiveMaximum are booleans indicating if minimum/maximum is exclusive\n // OpenAPI 3.1: exclusiveMinimum/exclusiveMaximum are numbers (the value itself)\n const exclusiveMinRaw =\n 'exclusiveMinimum' in schema ? schema.exclusiveMinimum : undefined;\n const exclusiveMaxRaw =\n 'exclusiveMaximum' in schema ? schema.exclusiveMaximum : undefined;\n\n // Convert boolean to number if using OpenAPI 3.0 format\n const exclusiveMin =\n isBoolean(exclusiveMinRaw) && exclusiveMinRaw ? min : exclusiveMinRaw;\n const exclusiveMax =\n isBoolean(exclusiveMaxRaw) && exclusiveMaxRaw ? max : exclusiveMaxRaw;\n\n const multipleOf = schema.multipleOf;\n const matches = schema.pattern ?? undefined;\n // Enum-based schemas are emitted as `zod.enum(...)` or literal unions, so\n // chaining scalar constraints onto the parent schema would generate invalid\n // Zod output. Arrays are handled separately via their item schema.\n const hasNonArrayEnum = !!schema.enum && type !== 'array';\n\n // Check for allOf/oneOf/anyOf BEFORE processing by type\n // This ensures these constraints work with any base type (string, number, object, etc.)\n let skipSwitchStatement = false;\n if (schema.allOf || schema.oneOf || schema.anyOf) {\n const separator = schema.allOf ? 'allOf' : schema.oneOf ? 'oneOf' : 'anyOf';\n\n const schemas = (schema.allOf ?? schema.oneOf ?? schema.anyOf) as (\n | OpenApiSchemaObject\n | OpenApiReferenceObject\n )[];\n\n // In JSON Schema / OpenAPI 3.1 a `required` array in any `allOf` member\n // (and on the composing schema itself) applies to properties contributed by\n // any member. Collect them all so each member's own properties can be marked\n // required even when the `required` lives in a sibling member — e.g. props\n // in a `$ref` base + `required` in a constraint-only sibling. Only valid for\n // `allOf` (a conjunction); `oneOf`/`anyOf` are alternatives. (#3171)\n const allOfRequired = schema.allOf\n ? [\n ...new Set([\n ...(schema.required ?? []),\n ...schemas.flatMap((member) => {\n // Only the member's top-level `required` is needed. For `$ref`\n // members resolve shallowly (no deep property dereference) and\n // tolerate unresolvable refs — they simply contribute no keys.\n const resolved =\n '$ref' in member && typeof member.$ref === 'string'\n ? tryResolveRefSchema(member.$ref, context)\n : (member as OpenApiSchemaObject);\n const memberRequired = resolved?.required;\n return Array.isArray(memberRequired)\n ? (memberRequired as string[])\n : [];\n }),\n ]),\n ]\n : undefined;\n\n // Use index-based naming to ensure uniqueness when processing multiple schemas\n // This prevents duplicate schema names when nullable refs are used\n const baseSchemas = schemas.map((schema, index) =>\n generateZodValidationSchemaDefinition(\n schema as OpenApiSchemaObject,\n context,\n `${camel(name)}${pascal(getNumberWord(index + 1))}`,\n strict,\n isZodV4,\n {\n required: true,\n additionalRequired: allOfRequired,\n constNameRegistry,\n useReusableSchemas,\n },\n ),\n );\n\n // Handle allOf/oneOf/anyOf with additional properties - merge additional properties into the schema\n if ((schema.allOf || schema.oneOf || schema.anyOf) && schema.properties) {\n const additionalPropertiesSchema = {\n properties: schema.properties,\n required: schema.required,\n additionalProperties: schema.additionalProperties,\n type: schema.type,\n } as OpenApiSchemaObject;\n\n // Use index-based naming to ensure uniqueness\n const additionalIndex = baseSchemas.length + 1;\n const additionalPropertiesDefinition =\n generateZodValidationSchemaDefinition(\n additionalPropertiesSchema,\n context,\n `${camel(name)}${pascal(getNumberWord(additionalIndex))}`,\n strict,\n isZodV4,\n {\n required: true,\n additionalRequired: allOfRequired,\n constNameRegistry,\n useReusableSchemas,\n },\n );\n\n // For oneOf/anyOf, use allOf to combine union with common properties\n // This generates: zod.union([...]).and(commonProperties)\n if (schema.oneOf || schema.anyOf) {\n functions.push([\n 'allOf',\n [\n { functions: [[separator, baseSchemas]], consts: [] },\n additionalPropertiesDefinition,\n ],\n ]);\n } else {\n // For allOf, just add to the list\n baseSchemas.push(additionalPropertiesDefinition);\n functions.push([separator, baseSchemas]);\n }\n } else {\n functions.push([separator, baseSchemas]);\n }\n skipSwitchStatement = true;\n }\n\n let defaultVarName: string | undefined;\n if (schema.default !== undefined) {\n defaultVarName = `${name}Default${constsCounterValue}`;\n let defaultValue: string | undefined;\n\n const isDateType =\n schema.type === 'string' &&\n (schema.format === 'date' || schema.format === 'date-time') &&\n context.output.override.useDates;\n\n if (isDateType) {\n // OpenApiSchemaObject defines default as 'any'\n defaultValue = `new Date(${JSON.stringify(schema.default)})`;\n } else if (isObject(schema.default)) {\n // Narrow string literals individually with `as const` so `zod.enum([...])`\n // properties accept the emitted default (#3244). Whole-object/array\n // `as const` would make nested arrays `readonly`, which zod v4's\n // `.default()` rejects against its mutable parameter type (#3399).\n const entries = Object.entries(schema.default)\n .map(([key, value]) => {\n if (isString(value)) {\n return `${key}: ${JSON.stringify(value)} as const`;\n }\n\n if (Array.isArray(value)) {\n const arrayItems = value.map((item) =>\n isString(item) ? `${JSON.stringify(item)} as const` : `${item}`,\n );\n return `${key}: [${arrayItems.join(', ')}]`;\n }\n\n if (\n value === null ||\n value === undefined ||\n isNumber(value) ||\n isBoolean(value)\n )\n return `${key}: ${value}`;\n })\n .join(', ');\n defaultValue = entries.length === 0 ? `{}` : `{ ${entries} }`;\n } else {\n // OpenApiSchemaObject defines default as 'any'\n const rawStringified = stringify(schema.default);\n defaultValue =\n rawStringified === undefined\n ? 'null'\n : rawStringified.replaceAll(\"'\", '`');\n\n // If the schema is an array with enum items, inject inplace to avoid issues with default values\n const isArrayWithEnumItems =\n Array.isArray(schema.default) &&\n type === 'array' &&\n schema.items &&\n 'enum' in schema.items &&\n schema.default.length > 0;\n\n if (isArrayWithEnumItems) {\n defaultVarName = defaultValue;\n defaultValue = undefined;\n }\n }\n if (defaultValue) {\n consts.push(`export const ${defaultVarName} = ${defaultValue};`);\n }\n }\n\n // Handle multi-type schemas (OpenAPI 3.1+ type arrays)\n if (isObject(type) && 'multiType' in type) {\n const types = type.multiType;\n functions.push([\n 'oneOf',\n types.map((t) =>\n generateZodValidationSchemaDefinition(\n {\n ...(schema as Record<string, unknown>),\n type: t,\n } as OpenApiSchemaObject,\n context,\n name,\n strict,\n isZodV4,\n {\n required: true,\n constNameRegistry,\n useReusableSchemas,\n },\n ),\n ),\n ]);\n\n if (!required && nullable) {\n functions.push(['nullish', undefined]);\n } else if (nullable) {\n functions.push(['nullable', undefined]);\n } else if (!required) {\n functions.push(['optional', undefined]);\n }\n\n pushDescriptionOrMeta();\n\n return { functions, consts };\n }\n\n if (!skipSwitchStatement) {\n switch (type) {\n case 'tuple': {\n /**\n *\n * > 10.3.1.1. prefixItems\n * > The value of \"prefixItems\" MUST be a non-empty array of valid JSON Schemas.\n * >\n * > Validation succeeds if each element of the instance validates against the schema at the same position, if any.\n * > This keyword does not constrain the length of the array. If the array is longer than this keyword's value,\n * > this keyword validates only the prefix of matching length.\n * >\n * > This keyword produces an annotation value which is the largest index to which this keyword applied a subschema.\n * > The value MAY be a boolean true if a subschema was applied to every index of the instance, such as is produced by the \"items\" keyword.\n * > This annotation affects the behavior of \"items\" and \"unevaluatedItems\".\n * >\n * > Omitting this keyword has the same assertion behavior as an empty array.\n */\n if ('prefixItems' in schema) {\n const schema31 = schema as OpenApiSchemaObject;\n const prefixItems = Array.isArray(schema31.prefixItems)\n ? (schema31.prefixItems as (\n | OpenApiSchemaObject\n | OpenApiReferenceObject\n )[])\n : [];\n\n if (prefixItems.length > 0) {\n functions.push([\n 'tuple',\n prefixItems.map((item, idx) =>\n generateZodValidationSchemaDefinition(\n dereference(item, context),\n context,\n camel(`${name}-${idx}-item`),\n isZodV4,\n strict,\n {\n required: true,\n constNameRegistry,\n useReusableSchemas,\n },\n ),\n ),\n ]);\n\n if (\n schema.items &&\n (max ?? Number.POSITIVE_INFINITY) > prefixItems.length\n ) {\n // only add zod.rest() if number of tuple elements can exceed provided prefixItems:\n functions.push([\n 'rest',\n generateZodValidationSchemaDefinition(\n schema.items as OpenApiSchemaObject | undefined,\n context,\n camel(`${name}-item`),\n strict,\n isZodV4,\n {\n required: true,\n constNameRegistry,\n useReusableSchemas,\n },\n ),\n ]);\n }\n }\n }\n break;\n }\n case 'array': {\n functions.push([\n 'array',\n generateZodValidationSchemaDefinition(\n schema.items as OpenApiSchemaObject | undefined,\n context,\n camel(`${name}-item`),\n strict,\n isZodV4,\n {\n required: true,\n constNameRegistry,\n useReusableSchemas,\n },\n ),\n ]);\n break;\n }\n case 'string': {\n if (schema.enum) {\n break;\n }\n\n if (\n context.output.override.useDates &&\n (schema.format === 'date' || schema.format === 'date-time')\n ) {\n functions.push(['date', undefined]);\n break;\n }\n\n if (schema.format === 'binary') {\n functions.push(['instanceof', 'File']);\n break;\n }\n\n // The @scalar/openapi-parser upgrader converts format: binary to\n // contentMediaType: application/octet-stream when upgrading\n // Swagger 2.0 / OAS 3.0 → OAS 3.1. Treat it the same as\n // format: binary so $ref-based model types generate File validation.\n if (\n schema.contentMediaType === 'application/octet-stream' &&\n !schema.contentEncoding\n ) {\n functions.push(['instanceof', 'File']);\n break;\n }\n\n if (isZodV4) {\n if (!predefinedZodFormats.has(schema.format ?? '')) {\n if ('const' in schema) {\n functions.push(['literal', JSON.stringify(String(schema.const))]);\n } else if (schema.pattern && schema.format) {\n const isStartWithSlash = schema.pattern.startsWith('/');\n const isEndWithSlash = schema.pattern.endsWith('/');\n const regexp = `new RegExp('${jsStringLiteralEscape(\n schema.pattern.slice(\n isStartWithSlash ? 1 : 0,\n isEndWithSlash ? -1 : undefined,\n ),\n )}')`;\n consts.push(\n `export const ${name}RegExp${constsCounterValue} = ${regexp};\\n`,\n );\n functions.push([\n 'stringFormat',\n [\n `'${jsStringLiteralEscape(schema.format)}'`,\n `${name}RegExp${constsCounterValue}`,\n ],\n ]);\n } else {\n functions.push([type as string, undefined]);\n }\n break;\n }\n } else {\n if ('const' in schema) {\n functions.push(['literal', JSON.stringify(String(schema.const))]);\n } else {\n functions.push([type as string, undefined]);\n }\n }\n\n if (schema.format === 'date') {\n const formatAPI = getZodDateFormat(isZodV4);\n\n functions.push([formatAPI, undefined]);\n break;\n }\n\n if (schema.format === 'time') {\n const options = context.output.override.zod.timeOptions;\n const formatAPI = getZodTimeFormat(isZodV4);\n\n functions.push([formatAPI, JSON.stringify(options)]);\n break;\n }\n\n if (schema.format === 'date-time') {\n const options = context.output.override.zod.dateTimeOptions;\n const formatAPI = getZodDateTimeFormat(isZodV4);\n\n functions.push([formatAPI, JSON.stringify(options)]);\n break;\n }\n\n if (schema.format === 'email') {\n functions.push(['email', undefined]);\n break;\n }\n\n if (schema.format === 'uri') {\n functions.push(['url', undefined]);\n break;\n }\n\n if (schema.format === 'hostname') {\n if (isZodV4) {\n functions.push(['hostname', undefined]);\n } else {\n functions.push(['url', undefined]);\n }\n break;\n }\n\n if (schema.format === 'uuid') {\n functions.push(['uuid', undefined]);\n break;\n }\n\n break;\n }\n default: {\n const hasProperties = !!schema.properties;\n const properties = schema.properties ?? {};\n const hasDefinedProperties = Object.keys(properties).length > 0;\n const hasAdditionalPropertiesSchema =\n !!schema.additionalProperties &&\n !isBoolean(schema.additionalProperties);\n\n // A plain `type: object` without explicit properties/additionalProperties\n // represents an open dictionary-like object in OpenAPI and should not be\n // generated as a strict object.\n const shouldUseLooseObject =\n type === 'object' &&\n !hasDefinedProperties &&\n schema.additionalProperties === undefined &&\n !hasAdditionalPropertiesSchema;\n\n if (hasProperties && hasDefinedProperties) {\n const objectType = getObjectFunctionName(isZodV4, strict);\n\n // A property is required when this schema requires it OR when a\n // sibling `allOf` member requires it (propagated via additionalRequired). (#3171)\n const requiredKeys = new Set<string>([\n ...(schema.required ?? []),\n ...(rules?.additionalRequired ?? []),\n ]);\n\n functions.push([\n objectType,\n Object.keys(properties)\n .map((key) => ({\n [key]:\n rules?.propertyOverrides?.[key] ??\n generateZodValidationSchemaDefinition(\n properties[key] as OpenApiSchemaObject | undefined,\n context,\n camel(`${name}-${key}`),\n strict,\n isZodV4,\n {\n required: requiredKeys.has(key),\n constNameRegistry,\n useReusableSchemas,\n },\n ),\n }))\n .reduce((acc, curr) => ({ ...acc, ...curr }), {}),\n ]);\n\n if (strict && !isZodV4) {\n functions.push(['strict', undefined]);\n }\n\n break;\n }\n\n if (shouldUseLooseObject) {\n const looseObjectType = getLooseObjectFunctionName(isZodV4);\n\n functions.push([looseObjectType, {}]);\n\n if (!isZodV4) {\n functions.push(['passthrough', undefined]);\n }\n\n break;\n }\n\n if (schema.additionalProperties) {\n functions.push([\n 'additionalProperties',\n generateZodValidationSchemaDefinition(\n isBoolean(schema.additionalProperties)\n ? {}\n : (schema.additionalProperties as OpenApiSchemaObject),\n context,\n name,\n strict,\n isZodV4,\n {\n required: true,\n constNameRegistry,\n useReusableSchemas,\n },\n ),\n ]);\n\n break;\n }\n\n if (schema.enum) {\n break;\n }\n\n functions.push([type, undefined]);\n\n break;\n }\n }\n }\n\n if (!hasNonArrayEnum && isString(type) && minAndMaxTypes.has(type)) {\n // Handle minimum constraints: exclusiveMinimum (>.gt()) takes priority over minimum (.min())\n // Check if exclusive flag was set (boolean format in OpenAPI 3.0) or a different value (OpenAPI 3.1)\n const shouldUseExclusiveMin = exclusiveMinRaw !== undefined;\n const shouldUseExclusiveMax = exclusiveMaxRaw !== undefined;\n\n if (shouldUseExclusiveMin && exclusiveMin !== undefined) {\n consts.push(\n `export const ${name}ExclusiveMin${constsCounterValue} = ${exclusiveMin};`,\n );\n // Generate .gt() for exclusive minimum (> instead of >=)\n functions.push(['gt', `${name}ExclusiveMin${constsCounterValue}`]);\n } else if (min !== undefined) {\n if (min === 1) {\n functions.push(['min', `${min}`]);\n } else {\n consts.push(`export const ${name}Min${constsCounterValue} = ${min};`);\n functions.push(['min', `${name}Min${constsCounterValue}`]);\n }\n }\n\n // Handle maximum constraints: exclusiveMaximum (<.lt()) takes priority over maximum (.max())\n if (shouldUseExclusiveMax && exclusiveMax !== undefined) {\n consts.push(\n `export const ${name}ExclusiveMax${constsCounterValue} = ${exclusiveMax};`,\n );\n // Generate .lt() for exclusive maximum (< instead of <=)\n functions.push(['lt', `${name}ExclusiveMax${constsCounterValue}`]);\n } else if (max !== undefined) {\n consts.push(`export const ${name}Max${constsCounterValue} = ${max};`);\n functions.push(['max', `${name}Max${constsCounterValue}`]);\n }\n\n if (multipleOf !== undefined) {\n consts.push(\n `export const ${name}MultipleOf${constsCounterValue} = ${multipleOf.toString()};`,\n );\n functions.push(['multipleOf', `${name}MultipleOf${constsCounterValue}`]);\n }\n if (\n exclusiveMin !== undefined ||\n min !== undefined ||\n exclusiveMax !== undefined ||\n multipleOf !== undefined ||\n max !== undefined\n ) {\n consts.push(`\\n`);\n }\n }\n\n const stringFormatAlreadyEmitted =\n isZodV4 &&\n type === 'string' &&\n !!matches &&\n !!schema.format &&\n !predefinedZodFormats.has(schema.format ?? '');\n\n if (\n matches &&\n !hasNonArrayEnum &&\n type === 'string' &&\n !stringFormatAlreadyEmitted\n ) {\n const isStartWithSlash = matches.startsWith('/');\n const isEndWithSlash = matches.endsWith('/');\n\n const regexp = `new RegExp('${jsStringLiteralEscape(\n matches.slice(isStartWithSlash ? 1 : 0, isEndWithSlash ? -1 : undefined),\n )}')`;\n\n consts.push(\n `export const ${name}RegExp${constsCounterValue} = ${regexp};\\n`,\n );\n if (schema.format && !predefinedZodFormats.has(schema.format) && isZodV4) {\n functions.push([\n 'stringFormat',\n [\n `'${jsStringLiteralEscape(schema.format)}'`,\n `${name}RegExp${constsCounterValue}`,\n ],\n ]);\n } else {\n functions.push(['regex', `${name}RegExp${constsCounterValue}`]);\n }\n }\n\n // Array item enums are handled by the nested item schema. Guard parent-array\n // enum emission to avoid generating invalid trailing `.enum(...)` chains.\n if (schema.enum && type !== 'array') {\n const uniqueEnumValues = unique(schema.enum);\n\n if (uniqueEnumValues.every((value) => isString(value))) {\n functions.push([\n 'enum',\n `[${uniqueEnumValues.map((value) => `'${jsStringLiteralEscape(value)}'`).join(', ')}]`,\n ]);\n } else {\n functions.push([\n 'oneOf',\n uniqueEnumValues.map((value) => ({\n functions: [\n [\n 'literal',\n isString(value) ? `'${jsStringLiteralEscape(value)}'` : value,\n ],\n ],\n consts: [],\n })),\n ]);\n }\n }\n\n if (!required && nullable) {\n functions.push(['nullish', undefined]);\n } else if (nullable) {\n functions.push(['nullable', undefined]);\n } else if (!required && !hasDefault) {\n functions.push(['optional', undefined]);\n }\n\n if (hasDefault) {\n functions.push(['default', defaultVarName]);\n }\n\n pushDescriptionOrMeta();\n\n return { functions, consts: unique(consts) };\n};\n\n/**\n * Runtime shape passed to the user-supplied `override.zod.params` function for\n * every emitted validator. Exported so consumers can type their function with\n * `import type { ZodParamsContext } from 'orval'` instead of hand-writing it.\n */\nexport interface ZodParamsContext {\n /** The OpenAPI `operationId`, or `''` for shared component schemas. */\n operationId: string;\n /** `'schema'` is used for shared component schemas with no owning operation. */\n location: 'param' | 'query' | 'header' | 'body' | 'response' | 'schema';\n /** Generated schema name, e.g. `CreateUserBody`, or the component name. */\n schemaName: string;\n /** Path to the current property within the schema. Only object property names are appended. */\n fieldPath: string[];\n /** The Zod method being emitted, e.g. `'string'`, `'min'`, `'email'`. */\n validator: string;\n}\n\nexport interface ZodParamsInjection extends Pick<\n ZodParamsContext,\n 'operationId' | 'location' | 'schemaName'\n> {\n mutator: GeneratorMutator;\n}\n\nconst PARAMS_MODIFIER_VALIDATORS = new Set([\n 'optional',\n 'nullable',\n 'nullish',\n 'default',\n 'describe',\n // Nullary / degenerate validators — either no params arg accepted in zod v3\n // (e.g. .unknown(), .any(), .never(), .null(), .undefined(), .void()) or no\n // meaningful error to attach (unknown/any accept everything).\n 'unknown',\n 'any',\n 'never',\n 'null',\n 'undefined',\n 'void',\n]);\n\n// Validators whose single argument is already a params-shaped options object\n// (e.g. `z.iso.datetime({ offset, precision })`). For these, the injected\n// params must merge into the existing object rather than be appended as a\n// second argument.\nconst PARAMS_MERGE_INTO_OPTIONS_VALIDATORS = new Set([\n 'datetime',\n 'time',\n 'iso.datetime',\n 'iso.time',\n]);\n\nexport const parseZodValidationSchemaDefinition = (\n input: ZodValidationSchemaDefinition,\n context: ContextSpec,\n coerceTypes: boolean | ZodCoerceType[] = false,\n strict: boolean,\n isZodV4: boolean,\n preprocess?: GeneratorMutator,\n paramsInjection?: ZodParamsInjection,\n): { zod: string; consts: string; usedRefs: Set<string> } => {\n if (input.functions.length === 0) {\n return { zod: '', consts: '', usedRefs: new Set() };\n }\n\n let consts = '';\n const usedRefs = new Set<string>();\n\n const appendConstsChunk = (chunk: string) => {\n if (!chunk) {\n return;\n }\n\n if (\n consts.length > 0 &&\n !consts.endsWith('\\n') &&\n !chunk.startsWith('\\n')\n ) {\n consts += '\\n';\n }\n\n consts += chunk;\n };\n\n const formatFunctionArgs = (value: unknown): string => {\n if (value === undefined) return '';\n if (value === null) return 'null';\n if (isString(value)) return value;\n if (Array.isArray(value)) {\n return value.map((item) => formatFunctionArgs(item)).join(', ');\n }\n if (isObject(value)) {\n return stringify(value) ?? '';\n }\n if (isNumber(value) || isBoolean(value)) return `${value}`;\n return '';\n };\n\n const buildParamsArg = (\n fn: string,\n fieldPath: readonly string[],\n ): string | undefined => {\n if (!paramsInjection) return undefined;\n if (PARAMS_MODIFIER_VALIDATORS.has(fn)) return undefined;\n const ctx: ZodParamsContext = {\n operationId: paramsInjection.operationId,\n location: paramsInjection.location,\n schemaName: paramsInjection.schemaName,\n fieldPath: [...fieldPath],\n validator: fn,\n };\n return `${paramsInjection.mutator.name}(${JSON.stringify(ctx)})`;\n };\n\n const parseProperty = (\n property: [string, unknown],\n fieldPath: readonly string[] = [],\n ): string => {\n const [fn, args = ''] = property;\n\n if (fn === 'namedRef') {\n const refArgs = args as { name: string; sourceRef: string };\n usedRefs.add(refArgs.name);\n return `__REF_${refArgs.name}__`;\n }\n\n // `.meta({ id, description?, deprecated? })` — registry metadata for zod v4.\n // Built explicitly (rather than via stringify) so the description is\n // JS-string-escaped and the field order is stable: id, description,\n // deprecated.\n if (fn === 'meta') {\n const metaArgs = args as {\n id: string;\n description?: string;\n deprecated?: boolean;\n };\n const parts = [`id: '${jsStringEscape(metaArgs.id)}'`];\n if (metaArgs.description !== undefined) {\n parts.push(`description: '${jsStringEscape(metaArgs.description)}'`);\n }\n if (metaArgs.deprecated) {\n parts.push('deprecated: true');\n }\n return `.meta({ ${parts.join(', ')} })`;\n }\n\n // File | string for text contentMediaType/encoding (user can pass string, runtime wraps in Blob)\n if (fn === 'fileOrString') {\n return 'zod.instanceof(File).or(zod.string())';\n }\n\n if (fn === 'allOf') {\n const allOfArgs = args as ZodValidationSchemaDefinition[];\n // Check if all parts are objects and we need to merge them for strict mode\n const allAreObjects =\n strict &&\n allOfArgs.length > 0 &&\n allOfArgs.every((partSchema) => {\n if (partSchema.functions.length === 0) return false;\n const firstFn = partSchema.functions[0][0];\n // Check if first function is object or strictObject\n // For Zod v3 with strict, it will be object followed by strict\n return firstFn === 'object' || firstFn === 'strictObject';\n });\n\n if (allAreObjects) {\n // Merge all object properties into a single object\n const mergedProperties: Record<string, ZodValidationSchemaDefinition> =\n {};\n let allConsts = '';\n\n for (const partSchema of allOfArgs) {\n if (partSchema.consts.length > 0) {\n allConsts += partSchema.consts.join('\\n');\n }\n\n // Find the object function (might be first or second after strict)\n const objectFunctionIndex = partSchema.functions.findIndex(\n ([fnName]) => fnName === 'object' || fnName === 'strictObject',\n );\n\n if (objectFunctionIndex !== -1) {\n const objectArgs = partSchema.functions[objectFunctionIndex][1];\n if (isObject(objectArgs)) {\n // Merge properties (later schemas override earlier ones)\n Object.assign(\n mergedProperties,\n objectArgs as Record<string, ZodValidationSchemaDefinition>,\n );\n }\n }\n }\n\n if (allConsts.length > 0) {\n appendConstsChunk(allConsts);\n }\n\n // Generate merged object\n const objectType = getObjectFunctionName(isZodV4, strict);\n const mergedObjectString = `zod.${objectType}({\n${Object.entries(mergedProperties)\n .map(([key, schema]) => {\n const value = schema.functions\n .map((prop) => parseProperty(prop, [...fieldPath, key]))\n .join('');\n appendConstsChunk(schema.consts.join('\\n'));\n return ` \"${key}\": ${value.startsWith('.') ? 'zod' : ''}${value}`;\n })\n .join(',\\n')}\n})`;\n\n // Apply strict only once for Zod v3 (v4 uses strictObject)\n if (!isZodV4) {\n return `${mergedObjectString}.strict()`;\n }\n\n return mergedObjectString;\n }\n\n // Fallback to original .and() approach for non-object or non-strict cases\n let acc = '';\n for (const partSchema of allOfArgs) {\n const value = partSchema.functions\n .map((prop) => parseProperty(prop, fieldPath))\n .join('');\n const valueWithZod = `${value.startsWith('.') ? 'zod' : ''}${value}`;\n\n if (partSchema.consts.length > 0) {\n appendConstsChunk(partSchema.consts.join('\\n'));\n }\n\n if (acc.length === 0) {\n acc = valueWithZod;\n } else {\n acc += `.and(${valueWithZod})`;\n }\n }\n\n return acc;\n }\n if (fn === 'oneOf' || fn === 'anyOf') {\n const unionArgs = args as ZodValidationSchemaDefinition[];\n // Can't use zod.union() with a single item\n if (unionArgs.length === 1) {\n appendConstsChunk(unionArgs[0].consts.join('\\n'));\n return unionArgs[0].functions\n .map((prop: [string, unknown]) => parseProperty(prop, fieldPath))\n .join('');\n }\n\n const union = unionArgs.map(\n ({\n functions,\n consts: argConsts,\n }: {\n functions: [string, unknown][];\n consts: string[];\n }) => {\n const value = functions\n .map((prop) => parseProperty(prop, fieldPath))\n .join('');\n const valueWithZod = `${value.startsWith('.') ? 'zod' : ''}${value}`;\n // consts are missing here\n appendConstsChunk(argConsts.join('\\n'));\n return valueWithZod;\n },\n );\n\n return `.union([${union.join(',')}])`;\n }\n\n if (fn === 'additionalProperties') {\n const additionalPropertiesArgs = args as ZodValidationSchemaDefinition;\n const value = additionalPropertiesArgs.functions\n .map((prop: [string, unknown]) => parseProperty(prop, fieldPath))\n .join('');\n const valueWithZod = `${value.startsWith('.') ? 'zod' : ''}${value}`;\n if (Array.isArray(additionalPropertiesArgs.consts)) {\n appendConstsChunk(additionalPropertiesArgs.consts.join('\\n'));\n }\n return `zod.record(zod.string(), ${valueWithZod})`;\n }\n\n if (fn === 'object' || fn === 'strictObject' || fn === 'looseObject') {\n const objectArgs = args as Record<string, ZodValidationSchemaDefinition>;\n const objectType =\n fn === 'looseObject'\n ? isZodV4\n ? 'looseObject'\n : 'object'\n : getObjectFunctionName(isZodV4, strict);\n\n const parsedObject = `zod.${objectType}({\n${Object.entries(objectArgs)\n .map(([key, schema]) => {\n const value = schema.functions\n .map((prop) => parseProperty(prop, [...fieldPath, key]))\n .join('');\n appendConstsChunk(schema.consts.join('\\n'));\n return ` \"${key}\": ${value.startsWith('.') ? 'zod' : ''}${value}`;\n })\n .join(',\\n')}\n})`;\n\n if (fn === 'looseObject' && !isZodV4) {\n return `${parsedObject}.passthrough()`;\n }\n\n return parsedObject;\n }\n\n if (fn === 'passthrough') {\n return '.passthrough()';\n }\n\n if (fn === 'array') {\n const arrayArgs = args as ZodValidationSchemaDefinition;\n const value = arrayArgs.functions\n .map((prop: [string, unknown]) => parseProperty(prop, fieldPath))\n .join('');\n if (isString(arrayArgs.consts)) {\n appendConstsChunk(arrayArgs.consts);\n } else if (Array.isArray(arrayArgs.consts)) {\n appendConstsChunk(arrayArgs.consts.join('\\n'));\n }\n return `.array(${value.startsWith('.') ? 'zod' : ''}${value})`;\n }\n\n if (fn === 'strict' && !isZodV4) {\n return '.strict()';\n }\n\n if (fn === 'tuple') {\n return `zod.tuple([${(args as ZodValidationSchemaDefinition[])\n .map((x) => {\n const value = x.functions\n .map((prop) => parseProperty(prop, fieldPath))\n .join('');\n return `${value.startsWith('.') ? 'zod' : ''}${value}`;\n })\n .join(',\\n')}])`;\n }\n if (fn === 'rest') {\n return `.rest(zod${(args as ZodValidationSchemaDefinition).functions\n .map((prop) => parseProperty(prop, fieldPath))\n .join('')})`;\n }\n const shouldCoerceType =\n coerceTypes &&\n (Array.isArray(coerceTypes)\n ? coerceTypes.includes(fn as ZodCoerceType)\n : COERCIBLE_TYPES.has(fn));\n\n const formattedArgs = formatFunctionArgs(args);\n const paramsArg = buildParamsArg(fn, fieldPath);\n let combinedArgs: string;\n if (\n paramsArg &&\n formattedArgs &&\n PARAMS_MERGE_INTO_OPTIONS_VALIDATORS.has(fn)\n ) {\n combinedArgs = `{ ...${formattedArgs}, ...${paramsArg} }`;\n } else if (paramsArg) {\n combinedArgs = formattedArgs\n ? `${formattedArgs}, ${paramsArg}`\n : paramsArg;\n } else {\n combinedArgs = formattedArgs;\n }\n\n if (\n (fn !== 'date' && shouldCoerceType) ||\n (fn === 'date' && shouldCoerceType && context.output.override.useDates)\n ) {\n return `.coerce.${fn}(${combinedArgs})`;\n }\n\n return `.${fn}(${combinedArgs})`;\n };\n\n appendConstsChunk(input.consts.join('\\n'));\n\n const schema = input.functions.map((prop) => parseProperty(prop)).join('');\n const value = preprocess\n ? `.preprocess(${preprocess.name}, ${\n schema.startsWith('.') ? 'zod' : ''\n }${schema})`\n : schema;\n\n const zod = `${value.startsWith('.') ? 'zod' : ''}${value}`;\n // Some export consts includes `,` as prefix, adding replace to remove those\n if (consts.includes(',export')) {\n consts = consts.replaceAll(',export', '\\nexport');\n }\n return { zod, consts, usedRefs };\n};\n\nconst dereferenceScalar = (value: unknown, context: ContextSpec): unknown => {\n if (isObject(value)) {\n return dereference(\n value as OpenApiSchemaObject | OpenApiReferenceObject,\n context,\n );\n } else if (Array.isArray(value)) {\n return value.map((item) => dereferenceScalar(item, context));\n } else {\n return value;\n }\n};\n\n/**\n * Attempts to resolve a `$ref` to its target schema. Returns `undefined`\n * instead of throwing when the ref cannot be found (e.g. external refs\n * not yet bundled). Logs a verbose warning on failure to aid debugging.\n */\nfunction tryResolveRefSchema(\n $ref: string,\n context: ContextSpec,\n): OpenApiSchemaObject | undefined {\n try {\n return resolveRef({ $ref } as OpenApiReferenceObject, context)\n .schema as OpenApiSchemaObject;\n } catch (error) {\n logVerbose(\n `[orval/zod] Failed to resolve $ref \"${$ref}\":`,\n error instanceof Error ? error.message : error,\n );\n return;\n }\n}\n\nconst COMPONENT_SCHEMAS_PREFIX = '#/components/schemas/';\n\nfunction extractSchemaNameFromRef($ref: string): string | undefined {\n if (!$ref.startsWith(COMPONENT_SCHEMAS_PREFIX)) return undefined;\n const raw = $ref.slice(COMPONENT_SCHEMAS_PREFIX.length);\n return decodeURIComponent(raw.replaceAll('~1', '/').replaceAll('~0', '~'));\n}\n\n/**\n * Recursively inlines all `$ref` and `$dynamicRef` references in an OpenAPI\n * schema tree, producing a fully-resolved schema suitable for Zod code generation.\n *\n * Tracks visited `$ref` paths via `context.parents` to break circular\n * references (returning `{}` for cycles).\n *\n * `$dynamicRef` is resolved using the dynamic scope attached to `context`:\n * 1. Look up the anchor name in `context.dynamicScope`.\n * 2. If not found, fall back to scanning `components.schemas` for a schema\n * that declares `$dynamicAnchor` with the same name.\n * 3. If resolved to a concrete schema, inline it (same as `$ref`).\n * 4. If unresolved, external, or a generic parameter → return `{}`.\n */\nexport const dereference = (\n schema: OpenApiSchemaObject | OpenApiReferenceObject,\n context: ContextSpec,\n): OpenApiSchemaObject => {\n const refName = '$ref' in schema ? schema.$ref : undefined;\n if (refName && context.parents?.includes(refName)) {\n return {};\n }\n\n if (isDynamicReference(schema)) {\n return dereferenceDynamicRef(schema, context);\n }\n\n const childContext: ContextSpec = {\n ...context,\n ...(refName\n ? { parents: [...(context.parents ?? []), refName] }\n : undefined),\n };\n\n const resolvedSchema: OpenApiSchemaObject | undefined =\n '$ref' in schema\n ? (() => {\n const referencedSchema = tryResolveRefSchema(schema.$ref, context);\n\n if (!referencedSchema || !isObject(referencedSchema)) {\n return;\n }\n\n const siblingProperties = Object.fromEntries(\n Object.entries(schema as Record<string, unknown>).filter(\n ([key]) => key !== '$ref',\n ),\n );\n\n return {\n ...(referencedSchema as Record<string, unknown>),\n ...siblingProperties,\n } as OpenApiSchemaObject;\n })()\n : schema;\n\n if (!resolvedSchema) {\n return {};\n }\n\n const resolvedContext = buildScopedContext(\n childContext,\n refName,\n resolvedSchema,\n );\n\n if (isDynamicReference(resolvedSchema)) {\n return dereferenceDynamicRef(resolvedSchema, resolvedContext);\n }\n\n return dereferenceProperties(resolvedSchema, resolvedContext);\n};\n\nfunction dereferenceProperties(\n schema: OpenApiSchemaObject,\n context: ContextSpec,\n): OpenApiSchemaObject {\n return Object.entries(schema).reduce<Record<string, unknown>>(\n (acc, [key, value]) => {\n if (key === 'properties' && isObject(value)) {\n acc[key] = Object.entries(value).reduce<\n Record<string, OpenApiSchemaObject>\n >((props, [propKey, propSchema]) => {\n props[propKey] = dereference(\n propSchema as OpenApiSchemaObject | OpenApiReferenceObject,\n context,\n );\n return props;\n }, {});\n } else if (key === 'default' || key === 'example' || key === 'examples') {\n acc[key] = value;\n } else {\n acc[key] = dereferenceScalar(value, context);\n }\n\n return acc;\n },\n {},\n ) as OpenApiSchemaObject;\n}\n\nfunction buildScopedContext(\n childContext: ContextSpec,\n refName: string | undefined,\n resolvedSchema: OpenApiSchemaObject,\n): ContextSpec {\n if (!refName) return childContext;\n\n const schemaName = extractSchemaNameFromRef(refName);\n if (!schemaName) return childContext;\n\n const schemaRecord = resolvedSchema as Record<string, unknown>;\n const hasDynamicAnchor = typeof schemaRecord.$dynamicAnchor === 'string';\n const defs = schemaRecord.$defs as Record<string, unknown> | undefined;\n const hasDefsAnchors =\n defs &&\n typeof defs === 'object' &&\n Object.values(defs).some(\n (d) => d && typeof d === 'object' && '$dynamicAnchor' in d,\n );\n\n if (!hasDynamicAnchor && !hasDefsAnchors) return childContext;\n\n return {\n ...childContext,\n dynamicScope: buildDynamicScope(schemaName, resolvedSchema, childContext),\n };\n}\n\nfunction dereferenceDynamicRef(\n schema: object & { $dynamicRef: string },\n context: ContextSpec,\n): OpenApiSchemaObject {\n const dynamicRef = schema.$dynamicRef;\n const anchorName = getDynamicAnchorName(dynamicRef);\n if (!anchorName) {\n return {};\n }\n\n const {\n resolvedTypeName,\n schema: resolvedSchema,\n schemaName,\n } = resolveDynamicRef(anchorName, context);\n\n const dynamicRefPath = `$dynamicRef:${dynamicRef}@${schemaName ?? '?'}`;\n if (context.parents?.includes(dynamicRefPath)) {\n return {};\n }\n\n if (resolvedTypeName === 'unknown' || !isObject(resolvedSchema)) {\n return {};\n }\n\n const childContext: ContextSpec = {\n ...context,\n parents: [...(context.parents ?? []), dynamicRefPath],\n };\n\n const scopedContext = buildScopedContext(\n childContext,\n schemaName\n ? `${COMPONENT_SCHEMAS_PREFIX}${encodeSegment(schemaName)}`\n : undefined,\n resolvedSchema,\n );\n\n const siblingProperties = Object.fromEntries(\n Object.entries(schema).filter(([key]) => key !== '$dynamicRef'),\n );\n\n const merged: OpenApiSchemaObject = {\n ...(resolvedSchema as Record<string, unknown>),\n ...siblingProperties,\n } as OpenApiSchemaObject;\n\n return dereferenceProperties(merged, scopedContext);\n}\n\nfunction encodeSegment(segment: string): string {\n return segment.replaceAll('~', '~0').replaceAll('/', '~1');\n}\n\n/**\n * Generate zod schema for form-data request body.\n * Handles file type detection for top-level properties based on encoding.contentType\n * and contentMediaType. Mirrors type gen's resolveFormDataRootObject.\n */\nexport const generateFormDataZodSchema = (\n schema: OpenApiSchemaObject,\n context: ContextSpec,\n name: string,\n strict: boolean,\n isZodV4: boolean,\n encoding?: Record<string, { contentType?: string }>,\n useReusableSchemas?: boolean,\n): ZodValidationSchemaDefinition => {\n // Precompute file type overrides for top-level properties only\n const propertyOverrides: Record<string, ZodValidationSchemaDefinition> = {};\n\n if (schema.properties) {\n for (const key of Object.keys(schema.properties)) {\n const propSchema = schema.properties[key];\n const resolvedPropSchema = propSchema\n ? dereference(\n propSchema as OpenApiSchemaObject | OpenApiReferenceObject,\n context,\n )\n : undefined;\n\n const fileType = resolvedPropSchema\n ? getFormDataFieldFileType(\n resolvedPropSchema,\n encoding?.[key]?.contentType,\n )\n : undefined;\n\n if (fileType) {\n const isRequired = schema.required?.includes(key);\n const fileFunctions: [string, unknown][] = [\n fileType === 'binary'\n ? ['instanceof', 'File']\n : ['fileOrString', undefined],\n ];\n if (!isRequired) {\n fileFunctions.push(['optional', undefined]);\n }\n propertyOverrides[key] = { functions: fileFunctions, consts: [] };\n }\n }\n }\n\n // Delegate to generic handler with file type overrides\n return generateZodValidationSchemaDefinition(\n schema,\n context,\n name,\n strict,\n isZodV4,\n {\n required: true,\n propertyOverrides:\n Object.keys(propertyOverrides).length > 0\n ? propertyOverrides\n : undefined,\n useReusableSchemas,\n },\n );\n};\n\nconst parseBodyAndResponse = ({\n data,\n context,\n name,\n strict,\n generate,\n isZodV4,\n parseType,\n useReusableSchemas,\n}: {\n data:\n | OpenApiResponseObject\n | OpenApiRequestBodyObject\n | OpenApiReferenceObject\n | undefined;\n context: ContextSpec;\n name: string;\n strict: boolean;\n generate: boolean;\n isZodV4: boolean;\n parseType: 'body' | 'response';\n useReusableSchemas?: boolean;\n}): {\n input: ZodValidationSchemaDefinition;\n isArray: boolean;\n rules?: {\n min?: number;\n max?: number;\n };\n} => {\n if (!data || !generate) {\n return {\n input: { functions: [], consts: [] },\n isArray: false,\n };\n }\n\n const resolvedRef = resolveRef(data, context).schema as\n | OpenApiResponseObject\n | OpenApiRequestBodyObject;\n\n // Only handle JSON and form-data; other content types (e.g., application/octet-stream)\n // Only handle JSON and form-data; other content types (e.g., application/octet-stream)\n // are skipped - unclear if this is correct behavior for root-level binary/text bodies.\n const contentEntries = Object.entries(resolvedRef.content ?? {});\n\n const jsonContent = contentEntries.find(\n isMediaType(\n // application/json\n // application/geo+json\n // application/ld+json\n // application/manifest+json\n // application/vnd.api+json (and other valid vendor subtypes)\n String.raw`^application\\/([^/;]+\\+)?json$`,\n ),\n );\n const formDataContent = contentEntries.find(\n isMediaType(String.raw`^multipart\\/form-data$`),\n );\n const [contentType, mediaType] = jsonContent\n ? (['application/json', jsonContent[1]] as const)\n : formDataContent\n ? (['multipart/form-data', formDataContent[1]] as const)\n : [undefined, undefined];\n\n const schema = mediaType?.schema;\n\n if (!schema) {\n if (parseType === 'response') {\n const textPlainContent = contentEntries.find(\n isMediaType(String.raw`^text\\/plain$`),\n );\n if (textPlainContent) {\n return {\n input: { functions: [['string', undefined]], consts: [] },\n isArray: false,\n };\n }\n }\n\n return {\n input: { functions: [], consts: [] },\n isArray: false,\n };\n }\n\n const encoding = mediaType.encoding;\n const resolvedJsonSchema = dereference(schema, context);\n\n // keep the same behaviour for array\n if (resolvedJsonSchema.items) {\n const min =\n resolvedJsonSchema.minimum ??\n resolvedJsonSchema.minLength ??\n resolvedJsonSchema.minItems;\n const max =\n resolvedJsonSchema.maximum ??\n resolvedJsonSchema.maxLength ??\n resolvedJsonSchema.maxItems;\n\n // When useReusableSchemas is on, shallow-resolve one level so that $ref\n // references inside the items schema are preserved for named-ref emission.\n // E.g. Pets = array of {$ref: Pet} → we want to emit Pet (namedRef)\n // rather than inlining Pet's full schema.\n const rawItems: OpenApiSchemaObject | OpenApiReferenceObject =\n useReusableSchemas\n ? (() => {\n const shallowArraySchema = resolveRef(schema, context)\n .schema as OpenApiSchemaObject;\n return (shallowArraySchema.items ??\n resolvedJsonSchema.items) as OpenApiSchemaObject;\n })()\n : resolvedJsonSchema.items;\n\n return {\n input: generateZodValidationSchemaDefinition(\n parseType === 'body'\n ? removeReadOnlyProperties(rawItems as OpenApiSchemaObject)\n : (rawItems as OpenApiSchemaObject),\n context,\n name,\n strict,\n isZodV4,\n {\n required: true,\n useReusableSchemas,\n },\n ),\n isArray: true,\n rules: {\n ...(min === undefined ? {} : { min }),\n ...(max === undefined ? {} : { max }),\n },\n };\n }\n\n // When useReusableSchemas is on, pass the original schema (possibly a $ref)\n // directly to generateZodValidationSchemaDefinition so that component schema\n // references are emitted as named identifiers instead of being inlined.\n const effectiveSchema: OpenApiSchemaObject | OpenApiReferenceObject =\n useReusableSchemas\n ? parseType === 'body'\n ? removeReadOnlyProperties(schema as OpenApiSchemaObject)\n : schema\n : parseType === 'body'\n ? removeReadOnlyProperties(resolvedJsonSchema)\n : resolvedJsonSchema;\n\n const isFormData = contentType === 'multipart/form-data';\n\n return {\n input: isFormData\n ? generateFormDataZodSchema(\n effectiveSchema,\n context,\n name,\n strict,\n isZodV4,\n encoding,\n useReusableSchemas,\n )\n : generateZodValidationSchemaDefinition(\n effectiveSchema,\n context,\n name,\n strict,\n isZodV4,\n { required: true, useReusableSchemas },\n ),\n isArray: false,\n };\n};\n\nconst isMediaType =\n (pattern: string) =>\n ([contentType]: [string, object]): boolean =>\n new RegExp(pattern).test(contentType.split(';')[0].trim().toLowerCase());\n\nconst getSingleResponse = (\n responses:\n | Record<string, OpenApiResponseObject | OpenApiReferenceObject | undefined>\n | undefined,\n) => {\n if (!responses) {\n return;\n }\n\n const otherSuccess = Object.entries(responses).find(\n ([code]) => code.startsWith('2') && code !== '204' && code !== '205',\n )?.[1];\n\n return (\n responses['200'] ??\n responses['2XX'] ??\n responses['2xx'] ??\n otherSuccess ??\n responses['204'] ??\n responses['205']\n );\n};\n\n/* eslint-enable @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-argument, @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-call */\n\nexport const parseParameters = ({\n data,\n context,\n operationName,\n isZodV4,\n strict,\n generate,\n useReusableSchemas,\n}: {\n data: (OpenApiParameterObject | OpenApiReferenceObject)[] | undefined;\n context: ContextSpec;\n operationName: string;\n isZodV4: boolean;\n strict: {\n param: boolean;\n query: boolean;\n header: boolean;\n body: boolean;\n response: boolean;\n };\n generate: {\n param: boolean;\n query: boolean;\n header: boolean;\n body: boolean;\n response: boolean;\n };\n useReusableSchemas?: boolean;\n}): {\n headers: ZodValidationSchemaDefinition;\n queryParams: ZodValidationSchemaDefinition;\n params: ZodValidationSchemaDefinition;\n} => {\n if (!data) {\n return {\n headers: {\n functions: [],\n consts: [],\n },\n queryParams: {\n functions: [],\n consts: [],\n },\n params: {\n functions: [],\n consts: [],\n },\n };\n }\n\n const initialDefinitionsByParameters: Record<\n 'headers' | 'queryParams' | 'params',\n Record<string, { functions: [string, unknown][]; consts: string[] }>\n > = {\n headers: {},\n queryParams: {},\n params: {},\n };\n\n const defintionsByParameters = data.reduce((acc, val) => {\n const { schema: parameter }: { schema: OpenApiParameterObject } =\n resolveRef(val, context);\n\n if (!parameter.schema) {\n return acc;\n }\n if (!parameter.in || !parameter.name) {\n return acc;\n }\n\n // When useReusableSchemas is on, preserve `$ref` schemas verbatim so the\n // generator can take the namedRef path. We only shallow-clone to attach\n // the parameter-level `description` without mutating the shared ref object.\n // When off, fall back to dereferencing for backward compatibility.\n const schemaForGen: OpenApiSchemaObject | OpenApiReferenceObject =\n useReusableSchemas\n ? parameter.description\n ? Object.assign({}, parameter.schema, {\n description: parameter.description,\n })\n : parameter.schema\n : (() => {\n const s = dereference(parameter.schema, context);\n s.description = parameter.description;\n return s;\n })();\n\n const mapStrict = {\n path: strict.param,\n query: strict.query,\n header: strict.header,\n };\n\n const mapGenerate = {\n path: generate.param,\n query: generate.query,\n header: generate.header,\n };\n\n if (\n parameter.in !== 'path' &&\n parameter.in !== 'query' &&\n parameter.in !== 'header'\n ) {\n return acc;\n }\n\n const definition = generateZodValidationSchemaDefinition(\n schemaForGen,\n context,\n camel(`${operationName}-${parameter.in}-${parameter.name}`),\n mapStrict[parameter.in],\n isZodV4,\n {\n required: parameter.required,\n useReusableSchemas,\n },\n );\n\n if (parameter.in === 'header' && mapGenerate.header) {\n return {\n ...acc,\n headers: { ...acc.headers, [parameter.name]: definition },\n };\n }\n\n if (parameter.in === 'query' && mapGenerate.query) {\n return {\n ...acc,\n queryParams: { ...acc.queryParams, [parameter.name]: definition },\n };\n }\n\n if (parameter.in === 'path' && mapGenerate.path) {\n return {\n ...acc,\n params: { ...acc.params, [parameter.name]: definition },\n };\n }\n\n return acc;\n }, initialDefinitionsByParameters);\n\n const headers: ZodValidationSchemaDefinition = {\n functions: [],\n consts: [],\n };\n\n if (Object.keys(defintionsByParameters.headers).length > 0) {\n const parameterFunctions = getParameterFunctions(\n isZodV4,\n strict.header,\n defintionsByParameters.headers,\n );\n\n headers.functions.push(...parameterFunctions);\n }\n\n const queryParams: ZodValidationSchemaDefinition = {\n functions: [],\n consts: [],\n };\n\n if (Object.keys(defintionsByParameters.queryParams).length > 0) {\n const parameterFunctions = getParameterFunctions(\n isZodV4,\n strict.query,\n defintionsByParameters.queryParams,\n );\n\n queryParams.functions.push(...parameterFunctions);\n }\n\n const params: ZodValidationSchemaDefinition = {\n functions: [],\n consts: [],\n };\n\n if (Object.keys(defintionsByParameters.params).length > 0) {\n const parameterFunctions = getParameterFunctions(\n isZodV4,\n strict.param,\n defintionsByParameters.params,\n );\n\n params.functions.push(...parameterFunctions);\n }\n\n return {\n headers,\n queryParams,\n params,\n };\n};\n\nconst generateZodRoute = async (\n { operationId, operationName, verb, override }: GeneratorVerbOptions,\n { pathRoute, context, output }: GeneratorOptions,\n) => {\n const isZodV4 =\n !!context.output.packageJson && isZodVersionV4(context.output.packageJson);\n const useReusableSchemas =\n context.output.override.zod.generateReusableSchemas;\n const spec = context.spec.paths?.[pathRoute];\n\n if (spec == undefined) {\n throw new Error(`No such path ${pathRoute} in ${context.projectName}`);\n }\n\n const parameters = [\n ...(spec.parameters ?? []),\n ...(spec[verb]?.parameters ?? []),\n ];\n\n const parsedParameters = parseParameters({\n data: parameters,\n context,\n operationName,\n isZodV4,\n strict: override.zod.strict,\n generate: override.zod.generate,\n useReusableSchemas,\n });\n\n const requestBody = spec[verb]?.requestBody;\n const parsedBody = parseBodyAndResponse({\n data: requestBody,\n context,\n name: camel(`${operationName}-body`),\n strict: override.zod.strict.body,\n generate: override.zod.generate.body,\n isZodV4,\n parseType: 'body',\n useReusableSchemas,\n });\n\n const responses = (\n context.output.override.zod.generateEachHttpStatus\n ? Object.entries(spec[verb]?.responses ?? {})\n : [['', getSingleResponse(spec[verb]?.responses)]]\n ) as [string, OpenApiResponseObject | OpenApiReferenceObject][];\n const parsedResponses = responses.map(([code, response]) =>\n parseBodyAndResponse({\n data: response,\n context,\n name: camel(`${operationName}-${code}-response`),\n strict: override.zod.strict.response,\n generate: override.zod.generate.response,\n isZodV4,\n parseType: 'response',\n useReusableSchemas,\n }),\n );\n\n const preprocessParams = override.zod.preprocess?.param\n ? await generateMutator({\n output,\n mutator: override.zod.preprocess.param,\n name: `${operationName}PreprocessParams`,\n workspace: context.workspace,\n tsconfig: context.output.tsconfig,\n })\n : undefined;\n\n const paramsMutator = override.zod.params\n ? await generateMutator({\n output,\n mutator: override.zod.params,\n name: `${operationName}ZodParams`,\n workspace: context.workspace,\n tsconfig: context.output.tsconfig,\n })\n : undefined;\n\n const pascalOperationName = pascal(operationName);\n const makeParamsInjection = (\n location: ZodParamsInjection['location'],\n schemaSuffix: string,\n ): ZodParamsInjection | undefined =>\n paramsMutator\n ? {\n mutator: paramsMutator,\n operationId,\n location,\n schemaName: `${pascalOperationName}${schemaSuffix}`,\n }\n : undefined;\n\n let inputParams = parseZodValidationSchemaDefinition(\n parsedParameters.params,\n context,\n override.zod.coerce.param,\n override.zod.strict.param,\n isZodV4,\n preprocessParams,\n makeParamsInjection('param', 'Params'),\n );\n\n const preprocessQueryParams = override.zod.preprocess?.query\n ? await generateMutator({\n output,\n mutator: override.zod.preprocess.query,\n name: `${operationName}PreprocessQueryParams`,\n workspace: context.workspace,\n tsconfig: context.output.tsconfig,\n })\n : undefined;\n\n let inputQueryParams = parseZodValidationSchemaDefinition(\n parsedParameters.queryParams,\n context,\n override.zod.coerce.query,\n override.zod.strict.query,\n isZodV4,\n preprocessQueryParams,\n makeParamsInjection('query', 'QueryParams'),\n );\n\n const preprocessHeader = override.zod.preprocess?.header\n ? await generateMutator({\n output,\n mutator: override.zod.preprocess.header,\n name: `${operationName}PreprocessHeader`,\n workspace: context.workspace,\n tsconfig: context.output.tsconfig,\n })\n : undefined;\n\n let inputHeaders = parseZodValidationSchemaDefinition(\n parsedParameters.headers,\n context,\n override.zod.coerce.header,\n override.zod.strict.header,\n isZodV4,\n preprocessHeader,\n makeParamsInjection('header', 'Header'),\n );\n\n const preprocessBody = override.zod.preprocess?.body\n ? await generateMutator({\n output,\n mutator: override.zod.preprocess.body,\n name: `${operationName}PreprocessBody`,\n workspace: context.workspace,\n tsconfig: context.output.tsconfig,\n })\n : undefined;\n\n let inputBody = parseZodValidationSchemaDefinition(\n parsedBody.input,\n context,\n override.zod.coerce.body,\n override.zod.strict.body,\n isZodV4,\n preprocessBody,\n makeParamsInjection('body', 'Body'),\n );\n\n const preprocessResponse = override.zod.preprocess?.response\n ? await generateMutator({\n output,\n mutator: override.zod.preprocess.response,\n name: `${operationName}PreprocessResponse`,\n workspace: context.workspace,\n tsconfig: context.output.tsconfig,\n })\n : undefined;\n\n const inputResponses = parsedResponses.map((parsedResponse, index) =>\n parseZodValidationSchemaDefinition(\n parsedResponse.input,\n context,\n override.zod.coerce.response,\n override.zod.strict.response,\n isZodV4,\n preprocessResponse,\n makeParamsInjection(\n 'response',\n responses[index][0] ? `${responses[index][0]}Response` : 'Response',\n ),\n ),\n );\n\n const SENTINEL_PATTERN = /__REF_([A-Za-z_$][A-Za-z0-9_$]*)__/g;\n const rewriteSentinels = (s: string): string =>\n s.replaceAll(SENTINEL_PATTERN, (_m, name: string) => name);\n\n const allUsedRefs = new Set<string>([\n ...inputParams.usedRefs,\n ...inputQueryParams.usedRefs,\n ...inputHeaders.usedRefs,\n ...inputBody.usedRefs,\n ...inputResponses.flatMap((r) => [...r.usedRefs]),\n ]);\n\n if (useReusableSchemas && allUsedRefs.size > 0) {\n inputParams = { ...inputParams, zod: rewriteSentinels(inputParams.zod) };\n inputQueryParams = {\n ...inputQueryParams,\n zod: rewriteSentinels(inputQueryParams.zod),\n };\n inputHeaders = {\n ...inputHeaders,\n zod: rewriteSentinels(inputHeaders.zod),\n };\n inputBody = { ...inputBody, zod: rewriteSentinels(inputBody.zod) };\n for (let i = 0; i < inputResponses.length; i++) {\n inputResponses[i] = {\n ...inputResponses[i],\n zod: rewriteSentinels(inputResponses[i].zod),\n };\n }\n }\n\n if (\n !inputParams.zod &&\n !inputQueryParams.zod &&\n !inputHeaders.zod &&\n !inputBody.zod &&\n responses.length === 0\n ) {\n return {\n implementation: '',\n mutators: [],\n usedRefs: new Set<string>(),\n };\n }\n\n const useBrandedTypes = override.zod.useBrandedTypes;\n const brand = (name: string) =>\n useBrandedTypes\n ? isZodV4\n ? `.brand(\"${name}\")`\n : `.brand<\"${name}\">()`\n : '';\n\n // With `generateReusableSchemas`, operations import component schemas by\n // their PascalCase name from a sibling schemas module. When an operation's\n // own pascalized wrapper name (e.g. `ListPetsResponse` from operationId\n // `listPets`) matches an imported ref, the generated `export const` shadows\n // the import and produces a self-referential initializer that TS rejects\n // with TS7022. Detect the collision and append `Schema` (with a counter for\n // further collisions) so the import keeps its meaning. For the array case\n // both the wrapper and its `Item` companion are checked together so they\n // stay in sync. The original name is preserved when there is no collision,\n // so non-colliding operations are unaffected.\n //\n // `localTaken` seeds from the imported refs and accumulates the names this\n // call hands out, so wrappers within the same operation (`Params`, `Body`,\n // per-status `Response`, …) can't pick a name another wrapper just claimed.\n // The fixed suffixes already keep these distinct in practice, but tracking\n // allocations removes the implicit invariant — future suffix additions stay\n // safe by construction.\n const localTaken = new Set(allUsedRefs);\n const allocateExportName = (baseName: string, hasItem: boolean): string => {\n const collides = (name: string) =>\n localTaken.has(name) || (hasItem && localTaken.has(`${name}Item`));\n const reserve = (name: string) => {\n localTaken.add(name);\n if (hasItem) localTaken.add(`${name}Item`);\n };\n if (!collides(baseName)) {\n reserve(baseName);\n return baseName;\n }\n let counter = 0;\n let candidate = `${baseName}Schema`;\n while (collides(candidate)) {\n counter += 1;\n candidate = `${baseName}Schema${counter}`;\n }\n reserve(candidate);\n return candidate;\n };\n\n const paramsName = allocateExportName(`${pascalOperationName}Params`, false);\n const queryParamsName = allocateExportName(\n `${pascalOperationName}QueryParams`,\n false,\n );\n const headerName = allocateExportName(`${pascalOperationName}Header`, false);\n const bodyName = allocateExportName(\n `${pascalOperationName}Body`,\n parsedBody.isArray,\n );\n\n return {\n implementation: [\n ...(inputParams.consts ? [inputParams.consts] : []),\n ...(inputParams.zod\n ? [\n `export const ${paramsName} = ${inputParams.zod}${brand(paramsName)}`,\n ]\n : []),\n ...(inputQueryParams.consts ? [inputQueryParams.consts] : []),\n ...(inputQueryParams.zod\n ? [\n `export const ${queryParamsName} = ${inputQueryParams.zod}${brand(queryParamsName)}`,\n ]\n : []),\n ...(inputHeaders.consts ? [inputHeaders.consts] : []),\n ...(inputHeaders.zod\n ? [\n `export const ${headerName} = ${inputHeaders.zod}${brand(headerName)}`,\n ]\n : []),\n ...(inputBody.consts ? [inputBody.consts] : []),\n ...(inputBody.zod\n ? [\n parsedBody.isArray\n ? `export const ${bodyName}Item = ${inputBody.zod}\nexport const ${bodyName} = zod.array(${bodyName}Item)${\n parsedBody.rules?.min ? `.min(${parsedBody.rules.min})` : ''\n }${\n parsedBody.rules?.max ? `.max(${parsedBody.rules.max})` : ''\n }${brand(bodyName)}`\n : `export const ${bodyName} = ${inputBody.zod}${brand(bodyName)}`,\n ]\n : []),\n ...inputResponses.flatMap((inputResponse, index) => {\n const operationResponse = allocateExportName(\n pascal(`${operationName}-${responses[index][0]}-response`),\n parsedResponses[index].isArray,\n );\n\n if (!inputResponse.zod) {\n if (!override.zod.generate.response) {\n return [];\n }\n\n const noContentStatusCodes = new Set(['204', '205']);\n const statusCode = responses[index][0];\n const isEachHttpStatusMode = !!statusCode;\n\n let isNoContent: boolean;\n if (isEachHttpStatusMode) {\n isNoContent = noContentStatusCodes.has(statusCode);\n } else {\n const specResponseKeys = new Set(\n Object.keys(spec[verb]?.responses ?? {}),\n );\n const hasStandardSuccess =\n specResponseKeys.has('200') ||\n specResponseKeys.has('2XX') ||\n specResponseKeys.has('2xx');\n isNoContent = !hasStandardSuccess;\n }\n const noContentSchema = isNoContent ? 'zod.void()' : 'zod.unknown()';\n\n return [\n `export const ${operationResponse} = ${noContentSchema}${brand(operationResponse)}`,\n ];\n }\n\n return [\n ...(inputResponse.consts ? [inputResponse.consts] : []),\n parsedResponses[index].isArray\n ? `export const ${operationResponse}Item = ${inputResponse.zod}\nexport const ${operationResponse} = zod.array(${operationResponse}Item)${\n parsedResponses[index].rules?.min\n ? `.min(${parsedResponses[index].rules.min})`\n : ''\n }${\n parsedResponses[index].rules?.max\n ? `.max(${parsedResponses[index].rules.max})`\n : ''\n }${brand(operationResponse)}`\n : `export const ${operationResponse} = ${inputResponse.zod}${brand(operationResponse)}`,\n ];\n }),\n ].join('\\n\\n'),\n mutators: [\n // Gate each request-side preprocess mutator on its parsed `.zod`: it is\n // computed for every operation once the target is configured, so without\n // this an operation lacking the schema would emit an unused import.\n ...(preprocessParams && inputParams.zod ? [preprocessParams] : []),\n ...(preprocessQueryParams && inputQueryParams.zod\n ? [preprocessQueryParams]\n : []),\n ...(preprocessHeader && inputHeaders.zod ? [preprocessHeader] : []),\n ...(preprocessBody && inputBody.zod ? [preprocessBody] : []),\n ...(preprocessResponse ? [preprocessResponse] : []),\n // Unconditional even when this operation's parsed schemas don't\n // reference `paramsMutator.name`: in `single` mode, inline component\n // schemas (which DO reference it) rely on this entry to emit the\n // import. The cost is one harmless `import { zodParams }` line on\n // operations whose request/response have no leaf validators to inject.\n ...(paramsMutator ? [paramsMutator] : []),\n ],\n usedRefs: useReusableSchemas ? allUsedRefs : new Set<string>(),\n };\n};\n\nexport const generateZod: ClientBuilder = async (verbOptions, options) => {\n const { implementation, mutators, usedRefs } = await generateZodRoute(\n verbOptions,\n options,\n );\n\n return {\n implementation: implementation ? `${implementation}\\n\\n` : '',\n // Zod schemas are runtime values (not type-only), so mark with values: true\n // to prevent the import writer from emitting `import type { ... }`. Sort\n // by name so import order is stable across runs.\n imports: [...usedRefs].toSorted().map((name) => ({\n name,\n schemaName: name,\n values: true,\n })),\n mutators,\n };\n};\n\nconst zodClientBuilder: ClientGeneratorsBuilder = {\n client: generateZod,\n dependencies: getZodDependencies,\n};\n\nexport const builder = () => () => zodClientBuilder;\n\nexport { isZodVersionV4 } from './compatible-v4';\n\nexport default builder;\n"],"mappings":";;;AAEA,MAAM,wBAAwB,gBAA6B;CACzD,OACE,YAAY,kBAAkB,OAC9B,YAAY,cAAc,OAC1B,YAAY,iBAAiB,OAC7B,YAAY,kBAAkB;AAElC;AAEA,MAAa,kBAAkB,gBAA6B;CAC1D,MAAM,UAAU,qBAAqB,WAAW;CAEhD,IAAI,CAAC,SACH,OAAO;CAGT,MAAM,YAAY,QAAQ,MAAM,GAAG,EAAE;CAErC,OAAO,gBAAgB,WAAW,OAAO;AAC3C;A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@@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@orval/zod",
|
|
3
|
-
"version": "8.
|
|
3
|
+
"version": "8.17.0",
|
|
4
4
|
"homepage": "https://orval.dev/docs/guides/zod",
|
|
5
5
|
"bugs": {
|
|
6
6
|
"url": "https://github.com/orval-labs/orval/issues"
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
"./package.json": "./package.json"
|
|
24
24
|
},
|
|
25
25
|
"dependencies": {
|
|
26
|
-
"@orval/core": "8.
|
|
26
|
+
"@orval/core": "8.17.0",
|
|
27
27
|
"remeda": "^2.33.6"
|
|
28
28
|
},
|
|
29
29
|
"devDependencies": {
|