Skip to content

langium-zod / ZodPropertyDescriptor

Interface: ZodPropertyDescriptor

Defined in: types.ts:50

Describes a single property of a Langium interface type after extraction, capturing all information the code generator needs to emit a Zod property expression.

  • name — property name as it appears in the grammar (e.g. "elements").
  • zodType — the resolved ZodTypeExpression for this property.
  • optionaltrue when the grammar uses ?= assignment or marks the property as optional.
  • minItems — minimum array length when the grammar uses += with + cardinality (emits .min(1)); undefined for all other cases.
  • comment — JSDoc/grammar comment to propagate into form metadata, if any.

Properties

PropertyTypeDescriptionDefined in
comment?stringJSDoc/grammar comment to propagate into form metadata, if any.types.ts:63
minItems?numberMinimum array length when the grammar uses += with + cardinality; undefined for all other cases. Emits .min(1) on the generated array schema.types.ts:61
namestringProperty name as it appears in the Langium grammar (e.g. "elements").types.ts:52
optionalbooleantrue when the grammar uses ?= assignment or marks the property optional.types.ts:56
zodTypeZodTypeExpressionResolved Zod type expression for this property.types.ts:54

Released under the MIT License.