In VS Code, there are several tags which trigger autocompletion and validation for local file path references. For example, when entering an img tag:
I have a json file which stores the metadata for an image grid, and I'd like to try to add a validation that the image path is typed in correctly. For example, here's an a json file that contains items with image paths and other metadata:
<sub>images.json</sub>
[
{
"color": "red",
"path": "./images/kitten.jpeg" /* identify value type as local path */
},
/* ... more items ...*/
]
And here's a JSON Schema Definition which has been applied to the vs workplace settings:
<sub>.vscode/settings.json</sub>
{
"json.schemas": [
{
"fileMatch": [
"/images.json"
],
"schema": {
"$schema": "http://json-schema.org/draft-07/schema#",
"type": "array",
"items": [
{
"type": "object",
"properties": {
"color": {"type": "string", "enum": ["blue", "red", "green"]},
"path": {"type": "string", /* what to put here */},
}
},
]
}
}
]
}
Is there any way to check local file paths using JSON Schema Validation or some alternative way to tell VS Code that a particular field is representing local file references?