diff --git a/README.md b/README.md index a32de65..bd57512 100644 --- a/README.md +++ b/README.md @@ -77,6 +77,36 @@ This repository contains schemata for: } ``` +## Installation in JetBrains + +IDEs by JetBrains like PyCharm and IntelliJ enable us to use the JSON Schema, using [the JSON schema mapping feature](https://www.jetbrains.com/help/idea/json.html#ws_json_schema_add_custom). + +1. Open the preferences of JSON schema mapping in JetBrains +2. Add custom schema mappings + +There is no way to add the preferences with a configuration file like VS Code. +As we have to manually configure them one by one, we just describe values of the configurations below. +If you want to know the details, the [dbt YAML validator in JetBrains article](https://yu-ishikawa.medium.com/dbt-yaml-validator-in-jetbrains-b5ef25e9253e) describes how to configure the JSON schema mapping in details. + +- Project definition files + - URL: `https://raw.githubusercontent.com/dbt-labs/dbt-jsonschema/main/schemas/dbt_project.json` + - Schema version: JSON schema version 7 + - Mapping: `dbt_project.yml` +- Package files + - URL: `https://raw.githubusercontent.com/dbt-labs/dbt-jsonschema/main/schemas/packages.json` + - Schema version: JSON schema version 7 + - Mapping: `packages.yml` +- Selectors files + - URL: `https://raw.githubusercontent.com/dbt-labs/dbt-jsonschema/main/schemas/selector.json` + - Schema version: JSON schema version 7 + - Mapping: `selector.yml` +- Property files + - URL: `https://raw.githubusercontent.com/dbt-labs/dbt-jsonschema/main/schemas/dbt_yml_files.json` + - Schema version: JSON schema version 7 + - Mapping: `models/**/*.yml`, `analysis/**/*.yml`, `snapshots/**/*.yml` + +![A screenshot of a JetBrains Preferences panel showing the correct mapping of the dbt_yml_files JSON Schema](/jetbrains-config.png) + _Do you use a different IDE which also supports JSON Schema? Please open a PR with setup instructions and links to any extensions!_ ## Contributing diff --git a/jetbrains-config.png b/jetbrains-config.png new file mode 100644 index 0000000..1f824aa Binary files /dev/null and b/jetbrains-config.png differ