Skip to main content

All Configuration Options

Options come from three sources. Later sources win: internal defaults, then the JSON config file, then the Prisma generator block. Safety options additionally accept environment variables, which outrank both of those. See Configuration Precedence.

The Where column uses three values:

  • config file — key only in the JSON config file (the file named by config = "./...", or an auto-discovered one).
  • generator block — key only in the Prisma generator block.
  • both — settable in either. Where the generator-block spelling differs, see Generator block spellings.

Defaults are the observed values the generator resolves at runtime, which is not always what the bundled JSON Schema advertises — see Where the bundled JSON Schema disagrees. Options marked † are declared but never read; they have no effect today (see Declared but not read).

Options

OptionTypeDefault (observed)WhereExplained in
$schemastring— (editor metadata; generation ignores it)config file/docs/config/schema-json
mode"full" | "minimal" | "custom""full"both/docs/config/modes
minimalOperationsstring[]["findMany","findUnique","findFirst","create","update","delete"]config file/docs/config/modes
outputstring./generated, resolved relative to the schema directoryboth/docs/config/precedence
useMultipleFilesbooleantrueboth/docs/config/file-layout
singleFileNamestring"schemas.ts"both/docs/config/file-layout
placeSingleFileAtRootbooleantrueboth/docs/config/file-layout
placeArrayVariantsAtRootbooleanfalseconfig file/docs/config/file-layout
formatGeneratedSchemasbooleanfalseconfig file
pureModelsbooleanfalse; true in minimal modeconfig file/docs/pipeline/pure-models
pureModelsLeanbooleantrueboth/docs/pipeline/pure-models
pureModelsIncludeRelationsbooleanfalseboth/docs/pipeline/pure-models
pureModelsExcludeCircularRelationsbooleanfalseboth/docs/recipes/circular-dependency-exclusion
naming.preset"default" | "zod-prisma" | "zod-prisma-types" | "legacy-model-suffix""default"config file/docs/reference/naming-preset-map
naming.pureModel.filePatternstring, must end in .ts"{Model}.schema.ts"config file/docs/config/naming
naming.pureModel.schemaSuffixstring (empty allowed)"Schema"config file/docs/config/naming
naming.pureModel.typeSuffixstring (empty allowed)"Type"config file/docs/config/naming
naming.pureModel.exportNamePatternstring"{Model}{SchemaSuffix}"config file/docs/config/naming
naming.pureModel.legacyAliasesbooleanfalseconfig file/docs/config/naming
naming.schema.filePatternstring, must end in .ts"{operation}{Model}.schema.ts"config file/docs/config/naming
naming.schema.exportNamePatternstring"{Model}{Operation}Schema"config file/docs/config/naming
naming.input.filePatternstring, must end in .ts"{InputType}.schema.ts"config file/docs/config/naming
naming.input.exportNamePatternstring"{Model}{InputType}ObjectSchema"config file/docs/config/naming
naming.enum.filePatternstring, must end in .ts"{Enum}.schema.ts"config file/docs/config/naming
naming.enum.exportNamePatternstring"{Enum}Schema"config file/docs/config/naming
dateTimeStrategy"date" | "coerce" | "isoString""date"both/docs/config/datetime-strategy
dateTimeSplitStrategybooleantrueboth/docs/config/datetime-strategy
decimalMode"number" | "string" | "decimal""decimal"config file/docs/pipeline/special-types
optionalFieldBehavior"optional" | "nullable" | "nullish""nullish"both/docs/config/optional-fields
jsonSchemaCompatiblebooleanfalseboth/docs/config/json-schema-compatibility
jsonSchemaOptions.dateTimeFormat"isoString" | "isoDate""isoString"both/docs/config/json-schema-compatibility
jsonSchemaOptions.bigIntFormat"string" | "number""string"both/docs/config/json-schema-compatibility
jsonSchemaOptions.bytesFormat"base64String" | "hexString""base64String"both/docs/reference/bytes-json
jsonSchemaOptions.conversionOptions.unrepresentable"throw" | "any""any" (declared)both/docs/config/json-schema-compatibility
jsonSchemaOptions.conversionOptions.cycles"ref" | "throw""throw" (declared)both/docs/config/json-schema-compatibility
jsonSchemaOptions.conversionOptions.reused"inline" | "ref""inline" (declared)both/docs/config/json-schema-compatibility
typedJson.schemaModulestringnone (absent means the feature is off)config file/docs/integrations/prisma-json-types-generator
typedJson.schemaSuffixstring (empty allowed)"Schema"config file/docs/integrations/prisma-json-types-generator
typedJson.namespacestring (identifier)"PrismaJson"config file/docs/integrations/prisma-json-types-generator
typedJson.applyToResultsbooleanfalseconfig file/docs/integrations/prisma-json-types-generator
typedJson.emitNamespacebooleanfalseconfig file/docs/integrations/prisma-json-types-generator
typedJson.namespaceOutputstring"./prisma-json-types.d.ts"config file/docs/integrations/prisma-json-types-generator
typedJson.mapobject (TypeName → Zod expression){}config file/docs/integrations/prisma-json-types-generator
zodImportTarget"auto" | "v3" | "v4""auto"config file/docs/recipes/zod-import-targets
zodImportPathstring"zod"; "zod/v3" when target is v3, "zod/v4" when target is v4config file/docs/recipes/zod-import-targets
strictCreateInputsbooleantrueconfig file/docs/recipes/granular-per-model
preserveRequiredScalarsOnCreatebooleantrueconfig file/docs/recipes/granular-per-model
inferCreateArgsFromSchemasbooleanfalse (declared)config file
addSelectTypebooleantrue; forced false in minimal modeboth
addIncludeTypebooleantrue; forced false in minimal modeboth
exportTypedSchemasbooleantrueboth/docs/config/dual-exports
exportZodSchemasbooleantrueboth/docs/config/dual-exports
typedSchemaSuffixstring"Schema"both/docs/config/dual-exports
zodSchemaSuffixstring"ZodSchema"both/docs/config/dual-exports
globalExclusions.inputstring[][]config file/docs/config/filtering
globalExclusions.resultstring[][]config file/docs/config/filtering
globalExclusions.purestring[][]config file/docs/config/filtering
globalExclusions.operationsoperation names[][]config file/docs/config/filtering
variants.pure.enabledbooleantrueboth/docs/config/variants
variants.input.enabledbooleantrueboth/docs/config/variants
variants.result.enabledbooleantrue; false in minimal modeboth/docs/config/variants
variants.<variant>.suffixstring starting with .".model" / ".input" / ".result"config file/docs/config/variants
variants.<variant>.excludeFieldsstring[][]; ["id","createdAt","updatedAt"] for input in minimal modeconfig file/docs/config/variants
variants.<variant>.partialbooleanfalseconfig file/docs/config/variants
variants.<variant>.strictModeboolean | nullnull (inherit)config file/docs/config/strict-mode
variants[].namestringrequired for the array formconfig file/docs/config/variants
variants[].suffixstringname with the first letter capitalizedconfig file/docs/config/variants
variants[].excludestring[][]config file/docs/config/variants
variants[].additionalValidationRecord<string, string>{}config file/docs/config/variants
variants[].makeOptionalstring[][]config file/docs/config/variants
variants[].transformRequiredToOptionalstring[][]config file/docs/config/variants
variants[].transformOptionalToRequiredbooleanfalseconfig file/docs/config/variants
variants[].removeValidationbooleanfalseconfig file/docs/config/variants
models.<Model>.enabledbooleantrueconfig file/docs/recipes/granular-per-model
models.<Model>.operationsoperation names[]all 17 operations; the minimal set in minimal modeconfig file/docs/config/filtering
models.<Model>.variants.<variant>same shape as variants.<variant>inherits the global variant configconfig file/docs/config/variants
models.<Model>.strictMode.enabledboolean | nullnull (inherit)config file/docs/config/strict-mode
models.<Model>.strictMode.operationsboolean | operation names[] | nullnull (inherit)config file/docs/config/strict-mode
models.<Model>.strictMode.excludeoperation names[][]config file/docs/config/strict-mode
models.<Model>.strictMode.objectsboolean | nullnull (inherit)config file/docs/config/strict-mode
models.<Model>.strictMode.variants.pureboolean | nullnull (inherit)config file/docs/config/strict-mode
models.<Model>.strictMode.variants.inputboolean | nullnull (inherit)config file/docs/config/strict-mode
models.<Model>.strictMode.variants.resultboolean | nullnull (inherit)config file/docs/config/strict-mode
models.<Model>.fields.exclude (legacy)string[][]config file/docs/config/filtering
models.<Model>.fields.include (legacy)string[][]config file/docs/config/filtering
emit.enumsbooleantrueconfig file/docs/config/emission-controls
emit.objectsbooleantrueconfig file/docs/config/emission-controls
emit.crudbooleantrueconfig file/docs/config/emission-controls
emit.resultsbooleanunset — only false has an effectconfig file/docs/config/emission-controls
emit.pureModelsbooleanmirrors pureModelsconfig file/docs/config/emission-controls
emit.variantsbooleantrueconfig file/docs/config/emission-controls
safety.level"strict" | "standard" | "permissive" | "disabled""standard"both/docs/reference/safety-system
safety.enabledbooleantrueboth/docs/reference/safety-system
safety.allowDangerousPathsbooleanfalse; true under permissive and disabledboth/docs/reference/safety-system
safety.allowProjectRootsbooleanfalse; true under disabledboth/docs/reference/safety-system
safety.allowUserFilesbooleanfalse; true under permissive and disabledboth/docs/reference/safety-system
safety.skipManifestbooleanfalse; true under disabledboth/docs/reference/safety-system
safety.warningsOnlybooleanfalse; true under permissive and disabledboth/docs/reference/safety-system
safety.customDangerousPathsstring[][]both/docs/reference/safety-system
safety.customProjectFilesstring[][]both/docs/reference/safety-system
safety.maxUserFilesnumber5; 0 under strict, 50 under permissive, unlimited under disabledboth/docs/reference/safety-system
strictMode.enabledbooleantrueconfig file/docs/config/strict-mode
strictMode.operationsbooleantrueconfig file/docs/config/strict-mode
strictMode.objectsbooleantrueconfig file/docs/config/strict-mode
strictMode.variantsbooleantrueconfig file/docs/config/strict-mode
strictMode.enumsbooleantrue (declared)config file/docs/config/strict-mode
validateWhereUniqueAtLeastOnebooleanfalseconfig file/docs/reference/where-unique-input

Operation names, wherever the table says operation names[], are drawn from: findMany, findUnique, findUniqueOrThrow, findFirst, findFirstOrThrow, create, createMany, createManyAndReturn, update, updateMany, updateManyAndReturn, upsert, delete, deleteMany, aggregate, groupBy, count.

emit.results: true does not force result schemas on. Only emit.results: false changes behavior; otherwise minimal mode and variants.result.enabled: false still suppress them.

Generator block spellings

Some options have a different key name in the Prisma generator block. Generator-block values are always strings.

Generator block keyMaps toNotes
configPath to the JSON config file. Generator block only.
outputoutputNative Prisma attribute (not part of the config map). Wins over the JSON config output when the generator zod block spells it out.
minimalmode"true" sets mode: "minimal". "false" leaves the config file's mode untouched.
variantsvariants.<variant>.enabledComma-separated list of pure, input, result. Variants not listed are disabled.
isGenerateSelectaddSelectType
isGenerateIncludeaddIncludeType
safetyLevelsafety.level
safetyEnabledsafety.enabled
safetyAllowDangerousPathssafety.allowDangerousPaths
safetyAllowProjectRootssafety.allowProjectRoots
safetyAllowUserFilessafety.allowUserFiles
safetySkipManifestsafety.skipManifest
safetyWarningsOnlysafety.warningsOnly
safetyMaxUserFilessafety.maxUserFiles
safetyCustomDangerousPathssafety.customDangerousPathsComma-separated.
safetyCustomProjectFilessafety.customProjectFilesComma-separated.
jsonSchemaOptionsjsonSchemaOptionsMust be a JSON object encoded as a string.

Every other both row in the main table uses the same key name in the generator block as in the config file.

Safety environment variables

These override both the generator block and the config file.

VariableMaps to
PRISMA_ZOD_SAFETY_LEVELsafety.level
PRISMA_ZOD_SAFETY_ENABLEDsafety.enabled
PRISMA_ZOD_SAFETY_ALLOW_DANGEROUS_PATHSsafety.allowDangerousPaths
PRISMA_ZOD_SAFETY_ALLOW_PROJECT_ROOTSsafety.allowProjectRoots
PRISMA_ZOD_SAFETY_ALLOW_USER_FILESsafety.allowUserFiles
PRISMA_ZOD_SAFETY_SKIP_MANIFESTsafety.skipManifest
PRISMA_ZOD_SAFETY_WARNINGS_ONLYsafety.warningsOnly
PRISMA_ZOD_SAFETY_MAX_USER_FILESsafety.maxUserFiles
PRISMA_ZOD_SAFETY_CUSTOM_DANGEROUS_PATHSsafety.customDangerousPaths
PRISMA_ZOD_SAFETY_CUSTOM_PROJECT_FILESsafety.customProjectFiles

Declared but not read

These keys are accepted, validate cleanly, and appear in editor IntelliSense, but no code in the generation pipeline reads them. Setting them changes nothing.

  • inferCreateArgsFromSchemas — declared in the config schema, the GeneratorConfig type, and the runtime defaults, and referenced nowhere else in the codebase. Reserved for future work on typing operation Args from generated schemas rather than Prisma.*. Today, create-input shaping is controlled entirely by strictCreateInputs and preserveRequiredScalarsOnCreate.
  • strictMode.enums — enum schemas are z.enum(...), which has no .strict() to apply.
  • jsonSchemaOptions.conversionOptions.* (unrepresentable, cycles, reused) — the generator never calls z.toJSONSchema() itself, so it has nothing to forward these to. Pass them directly to your own z.toJSONSchema(schema, options) call instead.

Where the bundled JSON Schema disagrees

The Default (observed) column above reports what the generator actually does. Four points where the bundled JSON Schema (lib/config/schema.json) says something else:

OptionJSON Schema saysGenerator does
placeArrayVariantsAtRootdefault: trueTreats an absent key as false, writing array-form variants to schemas/variants/
addSelectTypedefault: falseResolves to true when the key is absent, so Select schemas are generated unless minimal mode is active
addIncludeTypedefault: falseResolves to true when the key is absent, so Include schemas are generated unless minimal mode is active
safety.levelenum omits "disabled"Accepts "disabled" and applies the corresponding preset

The dateTimeSplitStrategy doc comment on the GeneratorConfig type also says Default: false, but both the JSON Schema and the runtime defaults use true.

Keys the bundled JSON Schema does not declare

The JSON Schema sets additionalProperties: false, and the generator does not run it during generation, so these work but your editor will flag them as unknown properties. See JSON Schema IntelliSense.

  • minimalOperations
  • The array form of variants, and every variants[].* key
  • exportTypedSchemas, exportZodSchemas, typedSchemaSuffix, zodSchemaSuffix
  • models.<Model>.fields.exclude and models.<Model>.fields.include (legacy)
  • The array form of globalExclusions (a flat string[] applied to every variant)
  • minimal: true as a config-file key (equivalent to mode: "minimal")

The same trade-off applies to typos: an unrecognized key is silently ignored rather than reported.

Minimal example

A config file, saved as prisma/config.json:

{
"$schema": "../node_modules/prisma-zod-generator/lib/config/schema.json",
"mode": "custom",
"pureModels": true,
"optionalFieldBehavior": "optional",
"emit": {
"objects": false,
"crud": false
}
}

Wired up in schema.prisma:

generator zod {
provider = "prisma-zod-generator"
config = "./config.json"
output = "../src/schemas"
}

optionalFieldBehavior decides how a schema-optional field is wrapped in the pure model. For bio String?:

// "optionalFieldBehavior": "nullish"  (default)
bio: z.string().nullish(),

// "optionalFieldBehavior": "optional"
bio: z.string().optional(),

// "optionalFieldBehavior": "nullable"
bio: z.string().nullable(),