langium-zod / LangiumZodConfig
Interface: LangiumZodConfig
Defined in: cli.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:129 |
conformance.astTypesPath? | string | - | - | - | config.ts:130 |
conformance.outputPath? | string | - | - | - | config.ts:131 |
crossRefValidation? | boolean | - | - | ZodGeneratorConfig.crossRefValidation | config.ts:128 |
exclude? | string[] | - | - | FilterConfig.exclude | config.ts:53 |
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:157 |
include? | string[] | - | - | FilterConfig.include | config.ts:52 |
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. | - | - | cli.ts:34 |
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:167 |
outputPath? | string | Explicit output path. Overrides derived path from langium-config.json out field. | ZodGeneratorConfig.outputPath | - | cli.ts:36 |
projection? | ProjectionConfig | - | - | ZodGeneratorConfig.projection | config.ts:126 |
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^[+-]?(.[0-9]+ | [0-9]+.?[0-9]*)([eE][+-]?[0-9]+)?$ } | - | ZodGeneratorConfig.regexOverrides |
stripInternals? | boolean | - | - | ZodGeneratorConfig.stripInternals | config.ts:127 |