Language Guide
What You Will Learn¶
This guide teaches the VDL language step by step. It is written for readers who are new to VDL and want to understand how to write schemas confidently.
VDL is small on purpose. A schema is made from a few building blocks:
- files and comments
includestatements- docstrings
typedeclarations- field types
enumdeclarationsconstdeclarations- annotations
- spreads and references
Once you understand these pieces, you can model data contracts, RPC services, events, configuration files, JSON schemas, generated code packages, and custom internal contracts.
A Tiny Schema¶
"""
Represents a user account.
"""
type User {
id string
email string
displayName? string
createdAt datetime
}
enum UserStatus {
Active = "active"
Suspended = "suspended"
}
const defaultPageSize = 25
This file defines three things:
User, an object type with fieldsUserStatus, a finite set of allowed valuesdefaultPageSize, a reusable constant value
How To Read VDL Syntax¶
VDL intentionally avoids punctuation that is not needed.
Fields do not use colons:
Object literal entries do not use colons or commas:
Array literal items are separated by whitespace:
If you come from JSON, TypeScript, Go, or YAML, this is the main habit to learn: VDL is whitespace-friendly and declaration-oriented.
Top-Level Declarations¶
At the top level, a .vdl file can contain:
include "./shared.vdl"
""" Standalone documentation. """
type User {
id string
}
enum Status {
Active
}
const version = "1.0.0"
Only type, enum, and const create named symbols. Includes and standalone docstrings help compose and document the schema.
Recommended Learning Path¶
Read these pages in order:
- Files and Comments
- Includes
- Docstrings
- Types
- Field Types
- Enums
- Constants and Literals
- Annotations
- Spreads and References
- Naming and Validation
For exact grammar-level detail, see the VDL specification.