Defining schemas
Every block on the Designer canvas — commands, events, state views — has a shape. Designer uses EvidentSchema, a subset of CUE, to define those shapes.
Why a schema language
Section titled “Why a schema language”- Language-neutral. The same schema compiles to Rust structs, Go types, TypeScript interfaces, Python dataclasses, and .NET records.
- Richer than JSON Schema, simpler than full CUE. You get sum types, constraints, and composition without the full CUE type system’s complexity.
- Versionable. Schemas evolve with your events and commands; Designer tracks breaking vs. non-breaking changes.
What a schema looks like
Section titled “What a schema looks like”// A TodoCreated event#TodoCreated: { todoId: string title: string & strings.MinRunes(1) dueDate?: time.Date}Defining them in Designer
Section titled “Defining them in Designer”For each block, Designer opens a schema editor. You can type the EvidentSchema directly, or build it from the structured form editor. Either way, the generated code for every SDK stays in sync.
Compilation target
Section titled “Compilation target”Designer’s generator emits language-native types from your schemas:
- Rust: structs with
serdederivations - Go: structs with JSON tags
- TypeScript: interfaces + zod validators (optional)
- Python: Pydantic models
- .NET: records
See Generating code for what the generated repo looks like.
Further reading
Section titled “Further reading”See evidentschema/ in the monorepo for the schema language specification and parser.