The shape declaration core
Three keywords carry most JSON Schema work: type declares the JSON type, properties declares the keys of an object, required lists which keys must be present.
Type values
The seven type values map to JSON's six plus a split: "string", "number", "integer", "boolean", "null", "object", "array". Note integer is a subtype of number — the validator checks the value has no fractional part.
Type unions
Pass an array to type for unions: "type": ["string", "null"] means 'string or null', a common shape for nullable fields.
required is opt-in
By default, all properties are optional. required is an array of property names that must be present. Omitting required means everything is optional — the schema validates an empty object as valid.
required: true inside each property — that's Draft-04 syntax, removed in Draft-06+. Modern JSON Schema uses an array at the object level: "required": ["name", "email"].