vibedonaldsvibedonalds.com
Term

JSON Schema

The IETF standard for describing the shape of a JSON value — required fields, types, allowed enums, nested objects. The contract LLM providers use to constrain structured-output decoding.

Background

JSON Schema is a specification, developed under the IETF and published as a series of Internet-Drafts, for describing the permitted shape of a JSON value using JSON itself. A schema is a JSON document made of keywords that constrain an instance: "type" fixes the value's kind (object, array, string, number, boolean, null); "properties" describes an object's fields and "required" lists which must be present; "items" constrains array elements; and keywords like "enum", "minimum", "maxLength", "pattern", and "format" narrow individual values. Composition keywords — "allOf", "anyOf", "oneOf", "not", and "$ref" — let schemas combine and reference each other, so you can factor out and reuse definitions. A validator takes an instance plus a schema and reports whether the instance conforms, and if not, which keywords it violated. For example, a schema might declare an object with a required string "email" matching a pattern and an integer "age" with a minimum of 0; feeding it {"age": -3} fails on the missing email and the minimum. JSON Schema matters heavily when building with AI because it is the lingua franca for constraining model output: tool/function-calling APIs describe each tool's parameters as JSON Schema, and structured-output modes use a schema to force the model to emit conforming JSON. Getting the schema right is how you turn free-form text generation into a reliable, machine-parseable interface.