Skip to content

Concise schemas for YAML data

Define a lot more
with a lot less

YAMLSchema mirrors the data you validate, keeps required fields obvious, and roundtrips with the JSON Schema ecosystem.

A complete object schema
name: +Str
age?: +Int 0..120
email?: +JSON-Schema/email
tags?: +Str[] [=good, bad, ugly]

Shape mirrors data

Read the schema the same way you read the YAML it validates.

Required by default

Add one question mark when a field is optional. Nothing is hidden.

JSON Schema compatible

Convert, normalize, and inspect roundtrip differences in the browser.

Install the CLI

source <(curl -sL yamlschema.org/install)
curl -sL yamlschema.org/install | source -
irm https://yamlschema.org/install.ps1 | iex

The Bash, Zsh, and Fish command installs ysd into the current shell. It immediately enables tab completion and the YAMLSchema man pages. The PowerShell command installs the native Windows executable and updates the user PATH while enabling tab completion now and in future sessions. The Unix installer keeps the matching source release under $PREFIX/share/yamlschema/. See installation options.

See the difference

The same constraints stay close to the fields they describe. Choose an example, or click the comparison to continue in the editor.

One language, two useful forms

.ysd.yaml

The compact source form that people write and review.

name: +Str
age?: +Int 0..

.ysdc.yaml

The explicit canonical form for tools and generated artifacts, often published as JSON (.ysdc.json).

name: +Str
age?:
  .type: +Int
  .range: [0]

Start with the shape of your data. Add only the constraints you need.

Try YAMLSchema