langium-zod / LangiumZodConfig
Interface: LangiumZodConfig
Defined in: generate.ts:26
User-facing config file shape (langium-zod.config.js / .ts)
Extends
Omit<ZodGeneratorConfig,"grammar"|"services"|"astTypes">
Properties
| Property | Type | Description | Overrides | Inherited from | Defined in |
|---|---|---|---|---|---|
conformance? | { astTypesPath?: string; outputPath?: string; } | - | - | ZodGeneratorConfig.conformance | config.ts:130 |
conformance.astTypesPath? | string | - | - | - | config.ts:131 |
conformance.outputPath? | string | - | - | - | config.ts:132 |
crossRefValidation? | boolean | - | - | ZodGeneratorConfig.crossRefValidation | config.ts:129 |
domainOnly? | boolean | When true (CLI --domain-only), emit ONLY the domain surface and skip Zod-schema generation. | - | ZodGeneratorConfig.domainOnly | config.ts:172 |
domainOutputPath? | string | Output path for the generated domain surface (domain.ts). | - | ZodGeneratorConfig.domainOutputPath | config.ts:174 |
domainOverlays? | DomainOverlayConfig | Project-specific semantic overlays (renames + read-only merges) supplied by the consumer for the domain target. | - | ZodGeneratorConfig.domainOverlays | config.ts:176 |
emitDomain? | boolean | When true, the CLI also emits the domain surface to domainOutputPath. | - | ZodGeneratorConfig.emitDomain | config.ts:170 |
exclude? | string[] | - | - | FilterConfig.exclude | config.ts:54 |
formMetadata? | boolean | When true, emit .meta({ title, description? }) on generated Zod schemas using humanized property/type names as title and JSDoc comments from the grammar as description. The description field is only included when a JSDoc/grammar comment exists for the corresponding type or property. Useful for zod-to-forms integrations that derive field labels from metadata. | - | ZodGeneratorConfig.formMetadata | config.ts:158 |
include? | string[] | - | - | FilterConfig.include | config.ts:53 |
langiumConfig? | string | Path to langium-config.json. Defaults to langium-config.json in cwd. Only used when picked up via the CLI; programmatic API ignores it. | - | - | generate.ts:34 |
namespaceOps? | boolean | When true (CLI --namespace-ops), also emit the namespace-ops surface alongside other targets. | - | ZodGeneratorConfig.namespaceOps | config.ts:178 |
namespaceOpsIdentity? | Record<string, string> | Element-type → identity field path map for namespace-ops removeX emission. e.g. { Attribute: 'name', ChoiceOption: 'typeCall.type.$refText' }. | - | ZodGeneratorConfig.namespaceOpsIdentity | config.ts:185 |
namespaceOpsOutputPath? | string | Output path for the generated namespace-ops surface (domain-ops.ts). | - | ZodGeneratorConfig.namespaceOpsOutputPath | config.ts:180 |
namespaceOpsRepository? | { elementTypes?: string[]; } | Top-level element types included in the generated domain repository (AnyDomain union). e.g. { elementTypes: ['Data', 'Choice'] }. | - | ZodGeneratorConfig.namespaceOpsRepository | config.ts:190 |
namespaceOpsRepository.elementTypes? | string[] | - | - | - | config.ts:190 |
objectStyle? | "loose" | "strict" | Controls how object schemas are emitted. - 'loose' (default): emits z.looseObject(...) which allows extra properties to pass through unchanged. - 'strict': emits z.object(...) (the standard Zod object). This strips unknown properties by default instead of rejecting them with a validation error. Consumers can call .strict() on the emitted schema if they need hard rejection of unknown properties. | - | ZodGeneratorConfig.objectStyle | config.ts:168 |
outputPath? | string | Explicit output path. Overrides derived path from langium-config.json out field. | ZodGeneratorConfig.outputPath | - | generate.ts:36 |
projection? | ProjectionConfig | - | - | ZodGeneratorConfig.projection | config.ts:127 |
regexOverrides? | Record<string, string> | Override the generated schema for specific type names. Use this for parser-based datatype rules (e.g. BigDecimal returns string: ... INT ...) whose structure cannot be expressed as a regex automatically by Langium. The value is a raw regex pattern string (without surrounding / slashes). The named type will emit z.string().regex(new RegExp("...")) instead of z.string(). Example regexOverrides: { BigDecimal: String.raw[1]?(.[0-9]+ | [0-9]+.?[0-9]*)([eE][+-]?[0-9]+)?$ } | - | ZodGeneratorConfig.regexOverrides |
stripInternals? | boolean | - | - | ZodGeneratorConfig.stripInternals | config.ts:128 |
+- ↩︎