Skip to main content
JSON Schema is probably the most popular schema language. With origins dating back to 2010, JSON Schema was initially built for API validation. Since then, it has found its way into configuration systems across web, cloud, and robotics infrastructure.

Example

Below is an example JSON Schema to give you a flavor of what JSON Schema looks like:
JSON Schema
Although many of JSON Schema’s capabilities are omitted in this example, you’ll find some of the most common keywords, including:
  • $schema - the JSON Schema draft version
  • type - the data type of a property
  • required - the property must exist
  • properties - the sub-fields of an object
  • default - the default value of a property
  • description - a human-readable description of a property
  • enum - a constrained list of values a property can take
  • minimum - the minimum value of a property
  • maximum - the maximum value of a property
For a comprehensive list of JSON Schema keywords, visit the official JSON Schema website. We also find the official test suite highly useful, as it contains a large number of simple JSON Schema examples.

Supported drafts

While JSON Schema has multiple drafts, only Draft 2020-12, the most recent stable draft, is supported. When specifying the $schema keyword in a schema, it must be set to the following value:
If the $schema keyword is omitted from a schema, the schema is automatically interpreted as Draft 2020-12.

Custom vocabulary

Miru extends JSON Schema’s vocabulary with the following keywords.

Doubles

JSON Schema’s number type accepts both 1 and 1.0. Some applications care about the difference. For example, ROS 2 rejects 1 for a parameter declared as a double. To require a double, add the x-miru-type: double keyword:
JSON Schema
With this keyword, a number is valid only when it is written with a decimal point or an exponent, such as 1.0 or 1e3. A value of 1 fails validation. The keyword checks only numbers, so keep type: number next to it. double is the only supported value of x-miru-type.

File formats

While JSON Schema was originally built for JSON data, it is not exclusive to JSON. JSON Schema may be uploaded to Miru in the following formats:
  • JSON (.json)
  • YAML (.yaml, .yml)
The format of a schema does not need to match the format of the config instance it validates. For example, a YAML-formatted JSON Schema can validate a JSON-formatted config instance. JSON Schemas can validate config instances in the following formats:
  • JSON (.json)
  • YAML (.yaml, .yml)
YAML support requires Miru Agent v0.7.0 or newer
Last modified on October 28, 2026