JSON to AJV Schema Converter

This tool converts JSON objects into AJV schema, properly handling nested objects and arrays of objects. It generates schemas compatible with strict mode.

Note: This schema is compatible with AJV strict mode. If you need default values, configure your AJV instance with:
const ajv = new Ajv({
    strict: false,  // or "log" to warn instead of error
    useDefaults: "empty",
    coerceTypes: true/false,
    allErrors: true,
    removeAdditional: true/false
});
Adjust the schema as needed based on your specific Ajv settings.

AJV Schema Output:

Copied to clipboard!
{
  "id": 123,
  "name": "John Doe",
  "email": "[email protected]",
  "active": true,
  "created_at": "2023-01-01T00:00:00Z"
}
{
  "id": 123,
  "name": "John Doe",
  "company": {
    "id": 456,
    "name": "Acme Inc",
    "employees": [
      {
        "id": 789,
        "name": "Jane Smith",
        "role": "Developer"
      },
      {
        "id": 790,
        "name": "Bob Johnson",
        "role": "Designer"
      }
    ],
    "locations": ["New York", "London", "Tokyo"]
  }
}