dbt-labs / dbt-jsonschema

Apache License 2.0
118 stars 40 forks source link

Snapshot YML is not supported #15

Closed ttusing closed 1 year ago

ttusing commented 2 years ago

Opening this snapshot YML format gives Propery snapshots is not allowed:

snapshots:
  - name: snapshot_name
    description: description_text
    columns:
...

I use snapshot YML to document field descriptions and snapshot integrity - think the same YML format as models should work with the snapshot key.

joellabes commented 2 years ago

Oof yes you're right! These should be defined in dbt_yml_files.json

Not going to have a chance to get to it in the next wee while, but if you want to have a go yourself then I'd welcome a PR. I think that you'll find duplicating the guts of the seeds key will get you pretty far (they have a pretty significant overlap in terms of which properties are used):

https://github.com/dbt-labs/dbt-jsonschema/blob/90d9afc14bceef6eee6257ef30bc6b9daec5b284/schemas/dbt_yml_files.json#L326-L374