Skip to content

Type Schemas

Type schemas are YAML files in .typemd/types/ that define the structure of your objects.

.typemd/types/book.yaml
name: book
properties:
- name: title
type: string
- name: status
type: enum
values: [to-read, reading, done]
default: to-read
- name: rating
type: number
TypeDescriptionExample
stringText"Go in Action"
numberInteger or float42, 3.14
enumEnumerated value, requires values"reading"
relationLink to another object"person/alan"

See the Relations guide for details on defining relation properties with target, bidirectional, inverse, and multiple fields.

TypeMD uses lenient validation:

  • Only validates properties defined in the schema
  • Extra properties (not in schema) are allowed
  • Missing properties do not cause errors
  • enum values must be in the values list
  • number must be numeric
  • relation targets are checked for correct type