Skip to main content

Module config_spec

Module config_spec 

Source
Expand description

A package’s config.spec, in its strict form.

config.spec documents what a package’s config: accepts. It may be free text. When it is YAML with specVersion: 1 at the top it is strict: a JSON Schema subset that tools (the hub’s deployment editor among them) build forms from, so it has to be exactly that subset. Robonix’s own system and bundled services ship strict specs.

The subset, at the top: specVersion, description, properties, required. For each property: type (string, integer, number, boolean, array, object, null, or a list of them; required), description, default, enum, minimum and maximum (both inclusive), items, properties, required, and three extensions: x-secret (a credential, to be written as ${VAR}), x-group (a heading the field is shown under) and x-provider (the value names another entry of the deployment: the contract it must provide, or true for any). Anything else a field needs to say (units, environment fallbacks, defaults computed at run time, conditions, deprecation) goes in its description. status is the deployment’s switch, read by rbnx, and is never a property.

Functions§

check
Ok(false) for a free-text spec, Ok(true) for a strict one that keeps to the subset, and the first departure from it otherwise.
浙ICP备2023005800号-2 浙公网安备33010902005384号