atmos validate schema
Use this command to validate files against the rules defined in your schema in atmos.yaml.
Learn how to configure custom schema validators for YAML files in your atmos.yaml.
Usage
Execute the validate schema command like this:
atmos validate schema
This command reads the schemas section of atmos.yaml and validates every matched
YAML file against its configured JSON Schema.
Out of the box — with no configuration at all — a built-in config entry validates
atmos.yaml itself, along with atmos.d fragments and project-local
profile files, against the schema generated from the
Atmos configuration code (the same document atmos config schema
prints). Define your own schemas.config entry to override or disable it.
Run atmos validate schema --help to see all the available options
Examples
atmos validate schema # everything in `schemas`, plus atmos.yaml via the built-in `config` entry
atmos validate schema config # only atmos.yaml (and its fragments)
atmos config validate # alias for `atmos validate schema config`
atmos config validate --affected --base origin/main
atmos validate schema <my_custom_key>
# Validate only changed YAML files; configuration or JSON Schema changes
# conservatively revalidate every matching file.
atmos validate schema --affected --base origin/main
atmos validate schema --exclude 'tests/fixtures/**'
Use --affected to compare against the Git merge-base. On GitHub Actions, the
pull request base SHA is detected automatically; use --base locally to select
another baseline.
Use repeatable --exclude <glob> to omit repository-relative matches from either full or affected schema validation.
How to set my schema validators?
You need to use the schemas key in atmos config.
schemas:
my_custom_key:
schema: !import https://www.jsonschema.com/example.json # json to be used for validation
matches:
- folder/*.yaml # pattern of the file to be validated
Flags
--schemas-atmos-manifest(optional)- Specifies the path to a JSON schema file used to validate the structure and content of the Atmos manifest file.