Skip to main content
JSON Schema is a popular open-source configuration language, useful for defining valid fields, types, and values for a config. Below is an example JSON Schema.
$schema: "https://json-schema.org/draft/2020-12/schema"
title: Mobility
type: object
properties:
  max_linear_speed_mps:
    type: number
    minimum: 0.1
    maximum: 5.0
    default: 1.2
  max_angular_speed_radps:
    type: number
    minimum: 0.1
    maximum: 3.0
    default: 1.0
  obstacle_avoidance_enabled:
    type: boolean
    default: true
  navigation_mode:
    type: string
    enum: [conservative, balanced, aggressive]
    default: balanced
  telemetry:
    type: object
    properties:
      upload_interval_sec:
        type: integer
        minimum: 10
        maximum: 300
        default: 60
      heartbeat_interval_sec:
        type: integer
        minimum: 1
        maximum: 60
        default: 10
    required:
      - upload_interval_sec
      - heartbeat_interval_sec
required:
  - max_linear_speed_mps
  - max_angular_speed_radps
  - obstacle_avoidance_enabled
  - navigation_mode
  - telemetry

Supported drafts

Miru only supports JSON Schema Draft 2020-12.

Supported keywords

The full descriptions and functionalities for keywords can be found on the official JSON Schema website. JSON Schema’s official test suite contains numerous small examples with short descriptions, which are very helpful for quickly grokking what a keyword does. The following icons are used to indicate varying levels of keyword support by Miru. ✅ Supported These keywords are used for validation. Configurations not satisfying these keywords are considered invalid. 🟡 Ignored Miru accepts these keywords, but they are not used for validation. Configurations not satisfying these keywords will still be considered valid. ❌ Not Supported Miru does not accept these keywords. Attempting to upload a schema with these keywords will throw an error.

Meta

Meta keywords are keywords used to describe the schema itself. Think of them as a schema for the schema.
KeywordSupported
$schema
$vocabulary

References

References are keywords used to reference other schemas or other parts of a schema. These are useful for reusing schema definitions and reducing redundancy.
KeywordSupported
$anchor
$defs
$dynamicAnchor
$id
$ref
$dynamicRef
Although the $ref keyword is supported, recursive references are not supported with Miru

Types

Type keywords specify the type of a value, such as a string, number, or object.
KeywordSupported
const
enum
type
format

Compositions

Composition keywords are used to compose schemas together in programmatic ways.
KeywordSupported
anyOf
allOf
else
if
not
oneOf
then

Objects

Object keywords define the structure of an object. In a programming language, this is roughly equivalent to a class or a struct.
KeywordSupported
maxProperties
minProperties
properties
required
additionalProperties
dependencies
dependentRequired
dependentSchemas
propertyNames
patternProperties
unevaluatedProperties

Arrays

Array keywords define the structure of an array.
KeywordSupported
minItems
maxItems
uniqueItems
contains
minContains
maxContains
items
additionalItems
prefixItems
unevaluatedItems

Strings

String keywords define the structure of a string.
KeywordSupported
minLength
maxLength
contentSchema🟡
contentEncoding🟡
contentMediaType🟡
pattern

Numbers

Number keywords define the structure of a number.
KeywordSupported
maximum
minimum
exclusiveMaximum
exclusiveMinimum
multipleOf

Annotations

Annotations are keywords used to annotate a schema, but do not affect the validation. Due to the usefulness of the default keyword, Miru actually uses the default value and validates that the default value satisfies the schema. This is why the default keyword is considered supported, but the others are considered ignored.
KeywordSupported
default
title🟡
description🟡
$comment🟡
readOnly🟡
writeOnly🟡
examples🟡
deprecated🟡

Miru

Miru keywords are used to store Miru-specific information about the schema.
KeywordSupported
$miru_config_type_slug
$miru_relative_filepath