Example
Below is an example CUE schema:CUE
- type specification -
number,string,bool, etc. - numeric constraints-
>=,<=,==,!=,=~,!~, etc. - default values -
| *value - enumerations -
| "value1" | "value2" | "value3" - intersection of constraints -
&
CUE version
Miru fully supports CUE and stays up to date with the latest CUE features and syntax. Currently, Miru uses CUE APIv0.14.2.
File formats
Unlike JSON Schema, CUE can only be written in the CUE file format and must have the.cue extension:
- CUE (
.cue)
- JSON (
.json) - YAML (
.yaml,.yml)
YAML support requires Miru Agent v0.7.0 or newer
CUE packages
CUE supports the concept of a package—a way to spread a schema’s definition across multiple files. For example, say we have acommunication schema which contains the following files:
communication
peripherals.cue
network.cue
sensors.cue
main.cue
main.cue file to define the schema. Miru fully supports CUE packages, treating the communication directory as a single schema.
Identifying packages
The Miru CLI automatically identifies CUE packages for you when creating a release using the package clause at the top of each schema file (as described in the CUE documentation).
You don’t need to explicitly specify the package in the CLI command—just provide the path to the package directory or to the individual schema files within the package.
Annotations
To annotate a CUE package, annotate exactly one file in the package. Annotating multiple files or no files will result in an error.
