https://github.com/fivetran/dbt_yaml_schemas
https://github.com/fivetran/dbt_yaml_schemas
Last synced: about 1 year ago
JSON representation
- Host: GitHub
- URL: https://github.com/fivetran/dbt_yaml_schemas
- Owner: fivetran
- License: mit
- Created: 2021-06-02T06:59:25.000Z (about 5 years ago)
- Default Branch: main
- Last Pushed: 2022-11-08T15:40:23.000Z (over 3 years ago)
- Last Synced: 2025-03-30T17:23:27.573Z (about 1 year ago)
- Size: 384 KB
- Stars: 11
- Watchers: 45
- Forks: 3
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Validation schemas for dbt configuration files
This repository contains JSON schemas that provide validation, autocomplete and documentation in VSCode for dbt configuration files:
- `dbt_project.yml`
- `packages.yml`
- `profiles.yml`
- resource configuration files located in various subfolders of dbt project
- Fivetran `deployment.yml` file
---

---

---

---
# Installation and configuration
First you need to install [YAML extension](https://marketplace.visualstudio.com/items?itemName=redhat.vscode-yaml) for VSCode.
To enable the schemas for a single dbt project, create a file `.vscode/settings.json` in the project and add the following configuration there:
```json
{
"yaml.schemas": {
"https://cdn.jsdelivr.net/gh/fivetran/dbt_yaml_schemas@main/schemas/profiles.json": "profiles.yml",
"https://cdn.jsdelivr.net/gh/fivetran/dbt_yaml_schemas@main/schemas/dbt_project.json": "dbt_project.yml",
"https://cdn.jsdelivr.net/gh/fivetran/dbt_yaml_schemas@main/schemas/deployment.json": "deployment.yml",
"https://cdn.jsdelivr.net/gh/fivetran/dbt_yaml_schemas@main/schemas/packages.json": "packages.yml",
"https://cdn.jsdelivr.net/gh/fivetran/dbt_yaml_schemas@main/schemas/resources.json": [
"models/**/*.yml",
"analysis/**/*.yml",
"data/**/*.yml",
"snapshots/**/*.yml",
"macros/**/*.yml"
]
}
}
```
You may need to adjust file patterns if your project has different sctructure.
In order to enable the schemas globally, go to VSCode `Preferences` -> `Settings` -> `Extensions` -> `YAML` -> `Schemas`, click `Edit in settings.json`, paste the code above into `settings.json` and save it.
You can also specify schemas for individual files by adding the following comment to the file
```yaml
# yaml-language-server: $schema=https://cdn.jsdelivr.net/gh/fivetran/dbt_yaml_schemas@main/schemas/resources.json
```