Valid YAML is not the same as a valid config

Validate YAML with a Schema on Mac

A YAML file can parse perfectly and still be wrong: a misspelled key, a value of the wrong type, a job missing a field. A schema catches those mistakes while you type. Here is how it works in notePad++++, and what needs Pro.

notePad++++ editing and previewing Markdown on macOS

Two kinds of YAML errors

The first kind is a syntax error: wrong indentation, a missing colon, a tab where spaces belong. Any YAML parser catches these.

The second kind is harder. The file is valid YAML but wrong for the tool that reads it: a key that does not exist, a number where a string is expected, a required field that is absent. GitHub Actions, Docker Compose, Kubernetes, and OpenAPI all publish a JSON Schema that describes what a correct file looks like. An editor that knows the schema can flag these mistakes as you type, before you commit and wait for a pipeline to fail.

Syntax checking by default

In notePad++++, YAML files are checked for syntax errors as you edit, with completion and hover help, using YAML 1.2. This is on by default and does not depend on choosing a schema.

Schema validation with YAML tools

Schema features live in the YAML tools panel, which is part of Pro. Pro is offered as a lifetime purchase with a free trial period, described on the App Store listing. The panel also shows how many issues were found, and Locate first issue jumps to the first one.

Automatic schemas

notePad++++ recognizes common config files and picks a matching schema for you:

File Schema
docker-compose.yml, compose.yaml Docker Compose
A workflow with top-level on: and jobs: GitHub Actions
.gitlab-ci.yml GitLab CI
openapi.yaml OpenAPI 3
dependabot.yml Dependabot
kustomization.yaml Kustomization
mkdocs.yml MkDocs
azure-pipelines.yml Azure Pipelines
bitbucket-pipelines.yml Bitbucket Pipelines
cloudbuild.yaml Google Cloud Build
.prettierrc.yaml Prettier

GitHub Actions workflows are detected by their content rather than their name, so any file with a top-level on: and jobs: is treated as a workflow.

Remote and local schemas

The built-in schemas are downloaded from their publishers, such as SchemaStore. Remote access is off until you choose Allow remote schemas. The app states that only the schema file is downloaded and your YAML content is not sent.

For anything not on the list, you can:

  • Choose local schema to use a JSON Schema file from your disk.
  • Use remote address to enter the URL of a schema.

Schema files are limited to 5 MiB. Use automatic schema switches back to the built-in choice.

Custom tags and Kubernetes mode

  • Custom tags teach the checker about tags such as !Ref scalar or !Join sequence, which some tools add on top of plain YAML. Without them, those files would be flagged as errors.
  • Kubernetes mode can be Automatic, On, or Off. When it is active, the panel says that Kubernetes rules are active.

Browse the structure

The YAML structure view shows the file as a tree with search, and can copy the path to any value. It distinguishes comments, tags, anchors, and aliases, and for files with several documents it lets you switch between them, labelled like Document 1 of 3. That makes it much easier to follow a config that leans on anchors and aliases.

Other ways to do this

Editors such as Visual Studio Code can also validate YAML against schemas, through an extension. Command-line options exist too: docker compose config --quiet checks a Compose file, and standalone linters cover GitHub Actions workflows. A dedicated editor is convenient when you would rather not install extensions or tools for each file type.

When to use which

You want Use
A quick syntax check on any YAML file The default syntax checking
To catch wrong keys in a workflow or Compose file Automatic schema in YAML tools
To validate against your own team's schema Choose local schema, or a remote address
To read a file full of anchors and aliases The YAML structure view

FAQ

Is YAML validation in notePad++++ free?

Syntax checking is on by default and does not depend on a schema. The YAML tools panel, which covers schemas, custom tags, and Kubernetes mode, is part of Pro. Pro is offered as a lifetime purchase with a free trial period, described on the App Store listing.

Is my YAML sent anywhere when a schema is used?

No. According to the app, only the schema file is downloaded, and your YAML content is not sent. Remote schema access is off until you turn it on.

Can I use my own schema?

Yes. Choose a local JSON Schema file, or enter the address of a remote one. Schema files are limited to 5 MiB.

Does it handle files with several YAML documents?

Yes. The YAML structure view lets you switch between documents in the same file and labels them, for example Document 1 of 3.

Notepad++ is a trademark of its respective owner. notePad++++ is an independent macOS text editor and is not affiliated with, endorsed by, or approved by the official Notepad++ project.