API Evangelist API Evangelist
Guidance
API Learnings
APIs
API Governance
API Solutions
API Discovery
API Building Blocks
API Evangelist LLC

JSON Schema

Vocabulary for annotating and validating JSON data structures

JSON Schema is the most important and most overlooked specification in the entire API world, and I’ve spent years trying to get people to see why. JSON Schema is a vocabulary for describing and validating the structure of JSON data — what fields exist, what types they are, what’s required, what patterns and constraints apply. It sounds humble, almost boring, but it’s the foundation that everything else sits on. OpenAPI is built on JSON Schema. API validation is JSON Schema. Data models are JSON Schema. When I say JSON Schema is the foundation, I mean it literally: the schema that describes your data is the most fundamental artifact in your API operation, more fundamental even than the OpenAPI definition that wraps it, because the OpenAPI definition is mostly JSON Schema describing your requests and responses. Get JSON Schema right, and everything built on top of it is sound. Get it wrong, and the problems propagate up through every layer.

The realization that JSON Schema is as valuable as OpenAPI itself came to me around 2016, and it reframed how I thought about the whole stack. I wrote that year that JSON Schema was proving to be as valuable as the OpenAPI spec, and I spent 2017 hoping schema would become just as important as API definitions. The insight is that the OpenAPI definition gets all the attention — it’s the artifact people talk about, build tooling around, and obsess over — but the actual substance of what an API exchanges is described by JSON Schema. The schema is doing the real work of defining the data, and OpenAPI is largely a container that organizes JSON Schemas into the structure of an API. Once you see that, you start paying attention to JSON Schema as a first-class concern rather than an implementation detail buried inside OpenAPI. The schema is where the meaning of your data lives.

The layers-and-onion framing is how I’ve come to explain JSON Schema’s place in the specification stack. I wrote in 2020 about the layers of the API specifications, definitions, and schema onion — with JSON Schema at the innermost layer. APIs.json describes the API’s operations and discovery; OpenAPI describes the API’s interface; and JSON Schema, at the core, describes the data structures that flow through it. Peel back the layers and you always arrive at JSON Schema. This matters because problems at the schema layer are the hardest to fix later — if your data models are inconsistent, poorly defined, or wrong, no amount of nice OpenAPI structure or good documentation will save you. The schema onion teaches you to work from the inside out: get the JSON Schema right first, then the OpenAPI that organizes it, then the discovery layer on top.

Validation is JSON Schema’s most direct and most powerful job, and it’s where the specification earns its keep daily. JSON Schema validating API operations, which I wrote about in 2024, is the practice of using the schema as the authoritative check on whether data is correct — does this request body match what the API expects, does this response match what was promised. This is the foundation of contract testing, of request/response validation, of the whole discipline of ensuring an API actually does what its definition says. I’ve argued that not speaking JSON Schema leads to API drift — because without schema validation, the implementation and the definition inevitably diverge, and you end up with an API that doesn’t match its own contract. JSON Schema is the mechanism that keeps the API honest, catching the drift between what’s promised and what’s delivered before it reaches consumers.

The governance and house-in-order dimension is where JSON Schema becomes an enterprise discipline, and it’s some of the most important work I’ve pointed organizations toward. I wrote in 2024 about the work to get your API house in order using JSON Schema — because most enterprises have a sprawling mess of inconsistent data definitions, and getting the schema house in order is the foundational governance work that everything else depends on. Spectral rules for governing your JSON Schema, the difference between what JSON Schema and Spectral provide when mapping the landscape, the discipline of upgrading to the latest JSON Schema draft — these are the practices that turn schema from an afterthought into a governed foundation. Schema registries like SourceMeta, which I’ve covered, are the infrastructure for managing JSON Schema at scale, giving the schema the same versioning and source-of-truth discipline that the rest of the API stack gets. When you govern your schema well, you govern your data well, and data is what APIs ultimately exist to move.

The power dimension of JSON Schema is something I’ve flagged because schema ownership is a form of control. I wrote in 2017 about when JSON Schema is seen as power — because whoever defines the schema defines the data, and defining the data is a position of real authority in any organization. The schema encodes the agreed-upon model of what things are: what a customer is, what an order is, what an address looks like. Controlling that definition is controlling how the organization understands its own information. Schema defines storage and the API defines access, as I put it in 2017 — the schema is the model of the data, and getting agreement on it across an organization is hard-won, expensive, political work. The schema isn’t just a technical artifact; it’s the encoded agreement about what your data means, which makes it one of the most consequential things an organization produces.

The reason JSON Schema matters more than ever, and the note I want to end on, is that the machine-readable, AI-driven future runs on schema. I wrote in 2025 that every API should have an OpenAPI, JSON Schema, and interactive documentation as the baseline — and the JSON Schema part is increasingly the critical part for AI. When an AI agent or an LLM consumes your API, it relies on the schema to understand the structure of the data, and structured-output techniques that constrain AI to produce valid data are fundamentally JSON Schema applications. The 2026 framing of “what is your beef with JSON Schema” was my exasperation at how this foundational, increasingly essential specification still gets resistance and neglect. Business leadership will want the latest JSON Schema draft, as I argued, because the quality of your schema is becoming the ceiling on what AI can reliably do with your API. JSON Schema spent years as the humble, overlooked foundation that nobody talked about while everyone obsessed over OpenAPI. Now, as the consumers become machines that depend entirely on machine-readable structure, the foundation is becoming the thing that matters most. The specification I’ve been trying to get people to take seriously for a decade turns out to be exactly what the AI era runs on — and the organizations that got their schema house in order are the ones positioned to thrive in it.

References