JSON Schemas help with validation and code completion of json files. Below are the schemas that are available in this repository.
If you are using the Salesforce Extensions for Visual Studio Code these schemas are already included for you.
For most other editors, you can use the schemas by adding the $schema
property to the top of your JSON file with the link to the schema document as shown below.
{
"$schema": "https://raw.githubusercontent.com/forcedotcom/schemas/master/schemas/sfdx-project.schema.json"
//...
}
You can also use these schemas programatially. For example, Salesforce CLI uses these schema to do certain validation.
const schemas = require('@salesforce/schemas');
const projectJsonSchema = require(schemas['sfdx-project']);
// OR
const projectJsonSchema = require('@salesforce/schemas/sfdx-project-schema.json']);
To report issues or feedback with the schemas, open a bug on GitHub.