JSON Schema Cheat Sheet — Validation Rules & Type Definitions

Essential keywords for validating JSON data structures, types, required keys, regular expressions, enum constraints, and arrays.

Core Validation Keywords

"type": "string" | "number" | "boolean" | "array" | "object" | "null"

Define the acceptable JSON primitive data type

"required": ["id", "email", "name"]

Array of property names that MUST be present on the target object

"properties": { "age": { "type": "integer", "minimum": 0 } }

Define schema validation rules for individual child keys

"additionalProperties": false

Reject any object payload containing undeclared keys

String Formats & Composition

"format": "email" | "uri" | "date-time" | "uuid"

Built-in semantic string validators for common data standards

"enum": ["admin", "editor", "viewer"]

Restrict value strictly to a predefined list of allowed choices

"oneOf": [{ ... }, { ... }]

Validate that the data matches EXACTLY ONE of the provided sub-schemas