-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Documentation for enabling config schema validation --- ### **Checklist** - [x] Documentation updated (if needed) - [x] Code conforms to style guidelines --------- Signed-off-by: Roaa Sakr <romoh@microsoft.com>
- Loading branch information
1 parent
7540000
commit 57740ac
Showing
1 changed file
with
54 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
# Enabling VS Code Configuration Validation for Prism (Image Customizer) | ||
|
||
This guide explains how to set up YAML validation in Visual Studio Code (VS | ||
Code) for authoring image customization configurations. | ||
|
||
## Prerequisites | ||
|
||
- VS Code installed on your system. | ||
|
||
## Steps to Enable Validation | ||
|
||
### 1. Install the YAML Extension | ||
|
||
Download and install [YAML VS Code | ||
extension](https://marketplace.visualstudio.com/items?itemName=redhat.vscode-yaml). | ||
This extension provides YAML validation and syntax highlighting. | ||
|
||
### 2. Update VS Code Settings | ||
|
||
Modify your VS Code `settings.json` to point to the schema corresponding to the | ||
version of Prism you are using. | ||
|
||
Add the following to your `settings.json` file after updating `<RELEASE>` and | ||
`<SPECIFIC-FOLDER>`: | ||
|
||
- `<SPECIFIC-FOLDER>` is the directory containing your image configs. | ||
- `<RELEASE>` is the version of Image Customizer that you are using (e.g.: v0.8). | ||
|
||
```json | ||
"yaml.schemas": { | ||
"https://raw.githubusercontent.com/microsoft/azure-linux-image-tools/release/<RELEASE>/toolkit/tools/imagecustomizerapi/schema.json": [ | ||
"<SPECIFIC-FOLDER>/**/*.yaml" | ||
] | ||
} | ||
``` | ||
|
||
For example: | ||
|
||
```json | ||
"yaml.schemas": { | ||
"https://raw.githubusercontent.com/microsoft/azure-linux-image-tools/release/v0.9/toolkit/tools/imagecustomizerapi/schema.json": [ | ||
"/home/test/image-configs/**/*.yaml" | ||
] | ||
} | ||
``` | ||
|
||
### 3. Validate Configurations | ||
|
||
Once configured, YAML files in the specified directory will automatically be | ||
validated against the schema. This enables syntax highlighting for errors and | ||
provides instant feedback while editing your configurations. It ensures your | ||
YAML files are properly formatted and conform to the schema. | ||
|
||
You’re now ready to go! |