Skip to main content

Models Only

Emit only pure model schemas (no CRUD/object scaffolding):

zod-generator.config.json
{
"mode": "custom",
"pureModels": true,
"variants": {
"pure": { "enabled": true },
"input": { "enabled": false },
"result": { "enabled": false }
},
"emit": {
"objects": false,
"crud": false,
"pureModels": true,
"variants": false,
"enums": true
}
}

Output is limited to schemas/models/<Model>.schema.ts plus the enum schemas those models reference.

Because pureModels is on and only the pure variant is enabled, the pureVariantOnlyMode heuristic fires and suppresses the objects/, CRUD and results/ categories on its own — the emit flags above just make that intent explicit. (Disabling pure as well would instead trigger the sibling pureModelsOnlyMode heuristic, with the same effect. That one additionally requires "mode": "custom".)

note

Per-operation schemas under results/ are produced inside the CRUD pass, so "crud": false already suppresses them — there is no need to set emit.results here. See CRUD Only for the case where you keep CRUD but want results/ off.