Skip to content

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.

  • 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.
// A TodoCreated event
#TodoCreated: {
todoId: string
title: string & strings.MinRunes(1)
dueDate?: time.Date
}

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.

Designer’s generator emits language-native types from your schemas:

  • Rust: structs with serde derivations
  • 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.

See evidentschema/ in the monorepo for the schema language specification and parser.