What is JSON Schema?

JSON Schema is a vocabulary that allows you to annotate and validate JSON data structures.

Detailed Explanation

JSON Schema defines the shape, properties, data types, required fields, and format restrictions of JSON data payloads. OpenAPI 3.1 aligns directly with JSON Schema Draft 2020-12.

Code Example

json
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "required": ["id", "email"],
  "properties": {
    "id": { "type": "string" },
    "email": { "type": "string", "format": "email" }
  }
}

Common Mistakes to Avoid

  • Confusing JSON Schema keywords with OpenAPI 3.0 keywords
  • Omitting required arrays

Validate JSON Schemas with APIForge

Paste any OpenAPI specification URL or YAML file into APIForge for instant 0-100 quality scoring, schema linting, and zero-CORS proxy testing.

Try Tool Now →
Share:𝕏 Postin Share