Skip to main content
The primary purpose of schemas is to validate config instances.

Example

Let’s look at a simple example to see this in action. The following is a toy schema written in JSON Schema.
JSON Schema
The schema defines what constitutes a valid config instance in several different ways:
  • Names the available properties
  • Organizes the configuration structure, placing some properties at the root while nesting other properties into logical groups
  • Gives each property a type, such as number, boolean, etc.
  • Constrains the values of each property—minimums, maximums, enumerations, etc.
  • Supplies default values to properties where appropriate
Most of these constraints are optional, and many features of JSON Schema are omitted here, but this gives you a flavor of what schemas are capable of. Say we are deploying the following config instance.
Invalid Mobility Edit
Unbeknownst to us, the max_angular_speed_radps field exceeds the maximum allowed value of 3.0. Luckily, before deployment to the device, the config instance is validated against the schema, throwing the following error:
Invalid Mobility Error Message
Identifying the issue, we correct the max_angular_speed_radps field to use the maximum allowed value of 3.0 and deploy the config instance to the device.
Valid Mobility Edit
This time, the config instance successfully validates against the schema and is deployed to the device. Although simple in concept, schemas are a powerful tool for preventing typos, misconfigurations, and other preventable errors.

Empty schemas

While schemas provide significant value in production deployments, defining one from scratch can be a considerable undertaking. Many teams find it best to begin with an empty schema—one that accepts any configuration—and gradually add constraints. This approach allows you to define the most highly valued constraints first and progressively transition to stricter and stricter schemas as needed. Below are the empty schemas for JSON Schema and CUE, respectively.
Last modified on September 23, 2026