Getting Started - VS Code
Zarf uses the Zarf package schema to define its configuration files. This schema is used to describe package configuration options and enable the validation of configuration files prior to their use in building a Zarf Package.
Adding Schema Validation
- Open VS Code.
- Install the YAML extension by RedHat.
- Open the VS Code command pallete by typing
CTRL/CMD + SHIFT + P.
Preferences: Open User Settings (JSON)into the search bar to open the
- Add the below code to the settings.json config, or modify the existing
yaml.schemasobject to include the Zarf schema.
When successfully installed, the
yaml.schema line will match the color of the other lines within the settings.
Specifying Zarf's Schema Version
To ensure consistent validation of the Zarf schema version in a
zarf.yaml file, it can be beneficial to lock it to a specific version. This can be achieved by appending the following statement to the first line of any given
# yaml-language-server: $schema=https://raw.githubusercontent.com/defenseunicorns/zarf/<VERSION>/zarf.schema.json
In the above example,
<VERSION> should be replaced with the specific Zarf release.