JSON Schema Documentation - JSON Tools

The JSON Schema tool helps you create, validate, and manage JSON schemas for data validation. Whether you need to validate data structure, document APIs, or ensure data quality, this tool provides a powerful set of features for working with JSON Schema.

Features

  • Schema Creation - Build JSON schemas with an intuitive interface
  • Data Validation - Validate JSON data against schemas
  • Schema Validation - Ensure your schemas are valid
  • Visual Editor - Create schemas without writing code
  • Documentation - Generate documentation from schemas
  • Import/Export - Share and reuse schemas

How to Use

Creating a Schema

  1. Start with a new schema or import existing one
  2. Define properties and their types
  3. Set validation rules and constraints
  4. Preview and test the schema

Validating Data

  1. Enter or paste your JSON data
  2. Select or enter your schema
  3. Click "Validate" to check compliance
  4. Review validation results and errors

Example

Here's an example of a JSON Schema and valid data:

Schema:

{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "type": "object",
  "properties": {
    "name": {
      "type": "string",
      "minLength": 2,
      "maxLength": 50
    },
    "age": {
      "type": "integer",
      "minimum": 0,
      "maximum": 120
    },
    "email": {
      "type": "string",
      "format": "email"
    },
    "interests": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "minItems": 1
    }
  },
  "required": ["name", "age", "email"]
}

Valid JSON data:

{
  "name": "John Doe",
  "age": 30,
  "email": "john@example.com",
  "interests": ["programming", "reading"]
}
JSON Schema

Schema Keywords

Type Constraints

  • type - Specify the data type (string, number, object, etc.)
  • enum - List of allowed values
  • const - Single allowed value
  • format - Predefined formats (email, date, etc.)

Numeric Constraints

  • minimum/maximum - Value range limits
  • multipleOf - Number must be multiple of value
  • exclusiveMinimum/Maximum - Exclusive range limits

String Constraints

  • minLength/maxLength - String length limits
  • pattern - Regular expression pattern
  • format - String format validation

Tips & Tricks

  • Schema Reuse - Use $ref to reference common schemas
  • Documentation - Add descriptions for better clarity
  • Validation - Test with various data scenarios
  • Versioning - Use $schema to specify version
  • Custom Formats - Define custom validation formats

Common Issues

Schema Validation

  • Invalid schema structure
  • Missing required properties
  • Incorrect type definitions
  • Invalid regular expressions

Data Validation

  • Type mismatches
  • Range violations
  • Pattern mismatches
  • Missing required fields

Related Tools