JSON Schema Validation/Array item validation

Validate every item in an array.

Section: Schema basics

Array item validation

json
json
{
  "type": "array",
  "items": {
    "type": "object",
    "properties": {
      "id": { "type": "integer" },
      "email": { "type": "string", "format": "email" }
    },
    "required": ["id", "email"]
  }
}
Explanation

Use `items` to define the shape of each array element.

Learn the surrounding workflow

Compare similar commands or jump into common fixes when this command is part of a bigger troubleshooting path.

Related commands

Same sheet · prioritizing Schema basics
Basic object schema
Require a string name and boolean active flag.
OpenIn sheetjsonsame section
Enum restriction
Restrict a value to a known set of strings.
OpenIn sheetjsonsame section
Validate with Ajv CLI
Validate a JSON file against a schema file.
OpenIn sheetbash2 tag match
Validate multiple files with Ajv
Validate a whole set of JSON documents.
OpenIn sheetbash2 tag match