# JSON Schema Validator & Generator — Infer, Validate & Document (`perryay/json-schema-validator-generator`) Actor

Infer JSON Schema from sample JSON data and validate JSON documents against existing schemas. Supports Draft-04, Draft-07, and 2019-09. Features nested objects, array item type inference, enum detection, batch validation, and human-readable schema documentation generation.

- **URL**: https://apify.com/perryay/json-schema-validator-generator.md
- **Developed by:** [Perry AY](https://apify.com/perryay) (community)
- **Categories:** Developer tools, AI
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.05 / actor start

This Actor is paid per event and usage. You are charged both the fixed price for specific events and for Apify platform usage.

Learn more: https://docs.apify.com/platform/actors/running/actors-in-store#pay-per-event

## What's an Apify Actor?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.
Actors are written with capital "A".

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.
The best way to integrate Actors is as follows.

In JavaScript/TypeScript projects, use official [JavaScript/TypeScript client](https://docs.apify.com/api/client/js/docs.md):

```bash
npm install apify-client
```

In Python projects, use official [Python client library](https://docs.apify.com/api/client/python/docs.md):

```bash
pip install apify-client
```

In shell scripts, use [Apify CLI](https://docs.apify.com/cli/docs.md):

````bash
# MacOS / Linux
curl -fsSL https://apify.com/install-cli.sh | bash
# Windows
irm https://apify.com/install-cli.ps1 | iex
```bash

In AI frameworks, you might use the [Apify MCP server](https://docs.apify.com/integrations/mcp.md).

If your project is in a different language, use the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).


# README

## JSON Schema Validator & Generator — Infer, Validate & Document Schemas

Infer JSON Schema from sample JSON data, validate JSON documents against existing schemas, and generate readable Markdown documentation from any schema. Works with JSON Schema Draft-04, Draft-07, and 2019-09.

Built with pure Python — no external schema libraries, no Playwright, no browser dependencies.

---

### What does it do?

Three modes:

1. **Infer** — Give it a sample JSON document, and it generates a JSON Schema that describes the structure. It works out the types (string, number, boolean, null, object, array), picks up nested properties, marks required fields, detects string formats (email, date-time, URI), and notes enum values when it sees them inside arrays.
2. **Validate** — Give it a JSON document and a JSON Schema, and it checks every constraint in the schema against the data. Returns detailed error messages for each violation.
3. **Batch Validate** — Run multiple validation checks in one go, each with its own data and (optionally) its own schema. Gets you per-item results plus a summary.

---

### Features

1. **Schema inference** — Generate a JSON Schema from any JSON sample
2. **Multi-draft support** — Pick Draft-04, Draft-07, or 2019-09
3. **Type inference** — Detects null, boolean, integer, number, string, array, object. Merges mixed types when it finds them (e.g. integer + float becomes "number")
4. **Format detection** — Spots email, date-time, date, and URI string formats
5. **Nested object handling** — Recursively walks into nested objects and arrays
6. **Array item type inference** — Works out the type from array contents, detects enums
7. **Schema validation** — Full constraint checking: type, enum, const, pattern, min/max, required, additionalProperties, and more
8. **Composition keywords** — Validates allOf, anyOf, and oneOf
9. **$ref resolution** — Resolves `$ref` against `$defs`
10. **Batch validation** — Process several documents and schemas in a single run
11. **Human-readable documentation** — Auto-generates Markdown docs from any schema
12. **No external schema libraries** — Pure Python, runs on the minimal Apify Python image

---

### Why use this?

| Problem | Without this actor | With this actor |
|---|---|---|
| Writing JSON Schema by hand | Slow, error-prone, needs schema expertise | Generates schemas from sample JSON in milliseconds |
| Validating JSON against a schema | Need separate validation libraries and custom code | Built-in validator with full constraint checking |
| Multiple documents to validate | One-off scripts, no consistent output format | Batch mode with per-item results and summary |
| Documenting schemas | Manual docs that quickly go out of date | Auto-generates Markdown from any schema |
| Choosing a draft version | Hard-coded to one version, painful to migrate | Supports Draft-04, Draft-07, and 2019-09 |
| Complex nested data | Easy to miss required fields in deep structures | Recursive type inference with automatic required-field detection |

---

### Who is it for?

| Persona | What they use it for |
|---|---|
| API Developer | Infers schemas automatically from sample API responses instead of writing them by hand |
| QA Engineer | Batch-validates hundreds of responses against declared schemas in test suites |
| Data Engineer | Detects structural drift in JSON pipelines and generates data contracts |
| Technical Writer | Produces Markdown schema docs for developer portals |
| Microservices Architect | Keeps service-to-service contracts consistent across Draft-07 or 2019-09 |
| Backend Developer | Validates actual API output against expected schema in CI |
| OpenAPI/Swagger Author | Generates and validates schema fragments before embedding them in specs |
| SDK/Tooling Developer | Gets machine-verified schemas for generating typed clients |

---

### Input Parameters

| Field | Type | Required | Default | Description |
|---|---|---|---|---|
| `mode` | string | Yes | `infer` | `infer`, `validate`, or `batch-validate` |
| `data` | object / array | If mode=infer or validate | {} | The JSON data to infer from or validate |
| `schema` | object | If mode=validate | {} | The JSON Schema to validate against |
| `items` | array | If mode=batch-validate | [] | Array of items, each with a `data` field (and optionally a `schema` field) |
| `default_schema` | object | No | {} | Fallback schema for batch items that don't have their own |
| `draft` | string | No | `draft-07` | `draft-04`, `draft-07`, or `draft-2019-09` |

#### Example Input — Infer Mode

```json
{
  "mode": "infer",
  "data": {
    "name": "Example Inc.",
    "founded": 2020,
    "active": true,
    "website": "https://example.com",
    "offices": [
      {"city": "London", "employees": 50},
      {"city": "Berlin", "employees": 30}
    ]
  },
  "draft": "draft-07"
}
````

#### Example Input — Validate Mode

```json
{
  "mode": "validate",
  "data": {"name": "Test", "email": "not-an-email"},
  "schema": {
    "$schema": "http://json-schema.org/draft-07/schema#",
    "type": "object",
    "properties": {
      "name": {"type": "string"},
      "email": {"type": "string", "format": "email"}
    },
    "required": ["name", "email"]
  }
}
```

***

### Output Format

#### Infer Mode Output

| Field | Type | Description |
|---|---|---|
| `status` | string | `success` or `error` |
| `mode` | string | `infer` |
| `schema` | object | The inferred JSON Schema |
| `schema_json` | string | Pretty-printed JSON Schema as a text string |
| `documentation` | string | Human-readable Markdown generated from the schema |
| `total_properties` | integer | Number of properties at the root level of the schema |

#### Validate Mode Output

| Field | Type | Description |
|---|---|---|
| `status` | string | `valid` if the document passes, `error` if it doesn't |
| `mode` | string | `validate` |
| `is_valid` | boolean | `true` if all constraints pass |
| `error_count` | integer | Number of validation errors found |
| `errors` | array | Details — each entry has `path` (where in the document) and `error` (what went wrong) |
| `data_size_bytes` | integer | Size of the input data in bytes |

#### Batch Validate Mode Output

Each item produces a row with:

| Field | Type | Description |
|---|---|---|
| `index` | integer | Position in the batch (0-based) |
| `is_valid` | boolean | Whether this item passed validation |
| `error_count` | integer | Number of errors for this item |
| `errors` | array | Error details |

A summary row is appended at the end with the total item count, how many passed, and how many failed.

#### Example Output — Infer Mode

```json
{
  "status": "success",
  "mode": "infer",
  "schema": {
    "$schema": "http://json-schema.org/draft-07/schema#",
    "type": "object",
    "properties": {
      "name": {"type": "string"},
      "founded": {"type": "integer"},
      "active": {"type": "boolean"},
      "website": {"type": "string", "format": "uri"},
      "offices": {
        "type": "array",
        "items": {
          "type": "object",
          "properties": {
            "city": {"type": "string"},
            "employees": {"type": "integer"}
          },
          "required": ["city", "employees"],
          "additionalProperties": false
        }
      }
    },
    "required": ["name", "founded", "active", "offices"],
    "additionalProperties": false
  },
  "schema_json": "{ ... }",
  "documentation": "# Schema Documentation\n\n...",
  "total_properties": 5
}
```

***

### API Usage

#### cURL

```bash
curl -X POST "https://api.apify.com/v2/acts/perryay~json-schema-validator-generator/runs" \
  -H "Authorization: Bearer ***" \
  -H "Content-Type: application/json" \
  -d '{
    "mode": "infer",
    "data": {
      "name": "Example Inc.",
      "founded": 2020,
      "active": true
    },
    "draft": "draft-07"
  }'
```

#### Python (ApifyClient)

```python
from apify_client import ApifyClient

client = ApifyClient("YOUR_API_TOKEN")

result = client.actor("perryay/json-schema-validator-generator").call(
    run_input={
        "mode": "infer",
        "data": {
            "name": "Example Inc.",
            "founded": 2020,
            "active": True,
            "website": "https://example.com",
        },
        "draft": "draft-07",
    }
)

dataset_items = client.dataset(result["defaultDatasetId"]).list_items()
print(dataset_items[0]["schema"])
```

#### Node.js (ApifyClient)

```javascript
import { ApifyClient } from 'apify-client';

const client = new ApifyClient({ token: 'YOUR_API_TOKEN' });

const result = await client
  .actor('perryay/json-schema-validator-generator')
  .call({
    mode: 'infer',
    data: {
      name: 'Example Inc.',
      founded: 2020,
      active: true,
      website: 'https://example.com',
    },
    draft: 'draft-07',
  });

const { items } = await client
  .dataset(result.defaultDatasetId)
  .listItems();
console.log(items[0].schema);
```

***

### Use Cases

1. **API Contract Generation** — After building a new REST endpoint, collect a sample response and feed it to the Infer mode. The generated schema becomes your contract.

2. **CI/CD Schema Validation** — Add a step to your CI pipeline that validates every API response against its declared schema. Catch breaking changes before they ship.

3. **Data Pipeline Quality Gates** — In ETL pipelines that process JSON, periodically run a sample through Infer to catch structural drift — new fields, removed fields, type changes.

4. **Microservice Contract Testing** — When two services talk over JSON, use Validate mode in integration tests. Each service declares its expected schema.

5. **Schema Migration Auditing** — Upgrading from Draft-04 to Draft-07 or 2019-09? Run your existing JSON through Infer with the target draft and compare the diff.

6. **OpenAPI/Swagger Schema Generation** — Generate schema fragments for request/response bodies and embed them directly in your OpenAPI spec.

7. **Developer Onboarding** — Generate Markdown documentation from your schemas so new team members can understand the data model without reading raw schema files.

8. **Batch Regression Testing** — Before deploying a backend change, run Batch Validate against a corpus of historical payloads. Any failures tell you exactly what broke.

9. **Third-party API Integration** — If an external API doesn't provide a schema, collect sample responses and infer one yourself. Then use it to catch upstream changes.

10. **Form-to-JSON Validation** — For apps that accept user-submitted JSON (config files, webhook payloads), use an inferred schema as a validation layer.

***

### FAQ

#### 1. What JSON Schema drafts are supported?

Draft-04, Draft-07, and 2019-09. Draft-07 is the default and recommended for most use cases.

#### 2. Can I use this without an Apify account?

The actor runs on the Apify platform. You need a free Apify account and an API token to use it programmatically.

#### 3. How accurate is schema inference?

It's deterministic — it walks every property in your sample and assigns types based on actual values. For strings it detects formats like email, date-time, date, and URI. Enum candidates are inferred inside arrays when items have a limited set of distinct values.

#### 4. Does the validator support `$ref` and `$defs`?

Yes. The validator resolves `$ref` references against `$defs` before applying constraints.

#### 5. Can I validate arrays of objects?

Yes. The validator walks nested arrays and applies item schemas recursively. Batch mode accepts multiple documents.

#### 6. What happens if my JSON is malformed?

The actor returns a clear `status: "error"` with a descriptive message before any schema processing starts.

#### 7. How do I estimate usage costs?

Each run triggers a start event, then per-operation events for inference and validation. Check the Apify pricing page for current rates on platform usage.

#### 8. Can I use this in my CI pipeline?

Yes. The actor returns machine-readable JSON that integrates with any CI system. The Python and Node.js SDKs make it easy to call from GitHub Actions, GitLab CI, or Jenkins.

#### 9. Does inference preserve `null` vs missing properties?

Yes. If a property exists and its value is `null`, the inferred schema gives it type `null`. If a property is absent from the sample, it won't appear in the schema.

#### 10. Can I customise the generated documentation?

The Markdown is auto-generated from the inferred schema. For custom formatting, you can post-process the `documentation` field or work with the raw `schema` object.

#### 11. What happens when inference sees mixed types (e.g. a field is sometimes a string, sometimes a number)?

Mixed types only come up when items in an array have different types. The inference engine merges them into a list (e.g. `["string", "number"]`). The validator checks against all listed types.

#### 12. Does this work with large JSON documents?

Yes. The actor runs on Apify's serverless infrastructure with configurable memory. For very large documents, you can use Batch mode to split processing.

#### 13. How does validation handle `additionalProperties`?

If the schema specifies `additionalProperties: false`, the validator reports an error for any property not listed in `properties`. Otherwise, extra properties are accepted.

#### 14. Is there a free tier?

Apify offers a free usage tier with monthly credits. Check the Apify pricing page for current limits.

***

### MCP Integration

```json
{
  "mcpServers": {
    "apify-json-schema": {
      "command": "npx",
      "args": ["-y", "@apify/mcp-server-actors", "--actors=perryay/json-schema-validator-generator"]
    }
  }
}
```

***

### Related Tools

- **[JSON Studio — Formatter, Validator & Analyzer](https://apify.com/perryay/json-studio)** — Format, validate, and analyse JSON documents
- **[Data Format Converter](https://apify.com/perryay/data-format-converter)** — Convert between JSON, YAML, TOML, CSV, and XML

***

### SEO Keywords

JSON Schema generator, JSON Schema validator, infer JSON Schema from JSON, JSON validation tool, JSON schema draft-07, API schema generator, data contract validator, JSON schema inference engine, batch JSON validator, schema documentation generator

# Actor input Schema

## `mode` (type: `string`):

Choose infer (generate schema from sample data), validate (test data against schema), or batch-validate (validate multiple documents).

## `data` (type: `object`):

The JSON data to infer a schema from (infer mode) or validate against a schema (validate mode). Accepts either a JSON object/array or a JSON string.

## `schema` (type: `object`):

The JSON Schema to validate against (validate mode only). Accepts either a schema object or a JSON string.

## `items` (type: `array`):

Array of items to validate in batch mode. Each item should have a 'data' field with the JSON to validate.

## `default_schema` (type: `object`):

Default schema used for batch items that don't specify their own schema.

## `draft` (type: `string`):

Which JSON Schema draft version to use for the generated schema.

## Actor input object example

```json
{
  "mode": "infer",
  "data": {
    "name": "Example",
    "age": 30,
    "email": "user@example.com"
  },
  "schema": {
    "$schema": "http://json-schema.org/draft-07/schema#",
    "type": "object",
    "properties": {
      "name": {
        "type": "string"
      },
      "age": {
        "type": "integer",
        "minimum": 0
      },
      "email": {
        "type": "string",
        "format": "email"
      }
    },
    "required": [
      "name",
      "email"
    ]
  },
  "items": [
    {
      "data": {
        "name": "Alice",
        "email": "alice@example.com"
      }
    },
    {
      "data": {
        "name": "Bob",
        "email": "invalid"
      }
    }
  ],
  "default_schema": {},
  "draft": "draft-07"
}
```

# Actor output Schema

## `results` (type: `string`):

Inferred schema, validation errors, or batch results delivered via the default dataset

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "mode": "infer",
    "data": {
        "name": "Example",
        "age": 30,
        "email": "user@example.com"
    },
    "schema": {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "type": "object",
        "properties": {
            "name": {
                "type": "string"
            },
            "age": {
                "type": "integer",
                "minimum": 0
            },
            "email": {
                "type": "string",
                "format": "email"
            }
        },
        "required": [
            "name",
            "email"
        ]
    },
    "items": [
        {
            "data": {
                "name": "Alice",
                "email": "alice@example.com"
            }
        },
        {
            "data": {
                "name": "Bob",
                "email": "invalid"
            }
        }
    ],
    "draft": "draft-07"
};

// Run the Actor and wait for it to finish
const run = await client.actor("perryay/json-schema-validator-generator").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {
    "mode": "infer",
    "data": {
        "name": "Example",
        "age": 30,
        "email": "user@example.com",
    },
    "schema": {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "type": "object",
        "properties": {
            "name": { "type": "string" },
            "age": {
                "type": "integer",
                "minimum": 0,
            },
            "email": {
                "type": "string",
                "format": "email",
            },
        },
        "required": [
            "name",
            "email",
        ],
    },
    "items": [
        { "data": {
                "name": "Alice",
                "email": "alice@example.com",
            } },
        { "data": {
                "name": "Bob",
                "email": "invalid",
            } },
    ],
    "draft": "draft-07",
}

# Run the Actor and wait for it to finish
run = client.actor("perryay/json-schema-validator-generator").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print("💾 Check your data here: https://console.apify.com/storage/datasets/" + run["defaultDatasetId"])
for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "mode": "infer",
  "data": {
    "name": "Example",
    "age": 30,
    "email": "user@example.com"
  },
  "schema": {
    "$schema": "http://json-schema.org/draft-07/schema#",
    "type": "object",
    "properties": {
      "name": {
        "type": "string"
      },
      "age": {
        "type": "integer",
        "minimum": 0
      },
      "email": {
        "type": "string",
        "format": "email"
      }
    },
    "required": [
      "name",
      "email"
    ]
  },
  "items": [
    {
      "data": {
        "name": "Alice",
        "email": "alice@example.com"
      }
    },
    {
      "data": {
        "name": "Bob",
        "email": "invalid"
      }
    }
  ],
  "draft": "draft-07"
}' |
apify call perryay/json-schema-validator-generator --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=perryay/json-schema-validator-generator",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "JSON Schema Validator & Generator — Infer, Validate & Document",
        "description": "Infer JSON Schema from sample JSON data and validate JSON documents against existing schemas. Supports Draft-04, Draft-07, and 2019-09. Features nested objects, array item type inference, enum detection, batch validation, and human-readable schema documentation generation.",
        "version": "1.0",
        "x-build-id": "E8wqjDQ9MMXAKE4rI"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/perryay~json-schema-validator-generator/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-perryay-json-schema-validator-generator",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        },
        "/acts/perryay~json-schema-validator-generator/runs": {
            "post": {
                "operationId": "runs-sync-perryay-json-schema-validator-generator",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor and returns information about the initiated run in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/runsResponseSchema"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/acts/perryay~json-schema-validator-generator/run-sync": {
            "post": {
                "operationId": "run-sync-perryay-json-schema-validator-generator",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        }
    },
    "components": {
        "schemas": {
            "inputSchema": {
                "type": "object",
                "required": [
                    "mode"
                ],
                "properties": {
                    "mode": {
                        "title": "Operation Mode",
                        "enum": [
                            "infer",
                            "validate",
                            "batch-validate"
                        ],
                        "type": "string",
                        "description": "Choose infer (generate schema from sample data), validate (test data against schema), or batch-validate (validate multiple documents).",
                        "default": "infer"
                    },
                    "data": {
                        "title": "JSON Data",
                        "type": "object",
                        "description": "The JSON data to infer a schema from (infer mode) or validate against a schema (validate mode). Accepts either a JSON object/array or a JSON string.",
                        "default": {}
                    },
                    "schema": {
                        "title": "JSON Schema",
                        "type": "object",
                        "description": "The JSON Schema to validate against (validate mode only). Accepts either a schema object or a JSON string.",
                        "default": {}
                    },
                    "items": {
                        "title": "Batch Items (batch-validate mode)",
                        "type": "array",
                        "description": "Array of items to validate in batch mode. Each item should have a 'data' field with the JSON to validate.",
                        "items": {
                            "type": "object"
                        },
                        "default": []
                    },
                    "default_schema": {
                        "title": "Default Schema (for batch-validate)",
                        "type": "object",
                        "description": "Default schema used for batch items that don't specify their own schema.",
                        "default": {}
                    },
                    "draft": {
                        "title": "JSON Schema Draft Version",
                        "enum": [
                            "draft-04",
                            "draft-07",
                            "draft-2019-09"
                        ],
                        "type": "string",
                        "description": "Which JSON Schema draft version to use for the generated schema.",
                        "default": "draft-07"
                    }
                }
            },
            "runsResponseSchema": {
                "type": "object",
                "properties": {
                    "data": {
                        "type": "object",
                        "properties": {
                            "id": {
                                "type": "string"
                            },
                            "actId": {
                                "type": "string"
                            },
                            "userId": {
                                "type": "string"
                            },
                            "startedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "finishedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "status": {
                                "type": "string",
                                "example": "READY"
                            },
                            "meta": {
                                "type": "object",
                                "properties": {
                                    "origin": {
                                        "type": "string",
                                        "example": "API"
                                    },
                                    "userAgent": {
                                        "type": "string"
                                    }
                                }
                            },
                            "stats": {
                                "type": "object",
                                "properties": {
                                    "inputBodyLen": {
                                        "type": "integer",
                                        "example": 2000
                                    },
                                    "rebootCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "restartCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "resurrectCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "computeUnits": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "options": {
                                "type": "object",
                                "properties": {
                                    "build": {
                                        "type": "string",
                                        "example": "latest"
                                    },
                                    "timeoutSecs": {
                                        "type": "integer",
                                        "example": 300
                                    },
                                    "memoryMbytes": {
                                        "type": "integer",
                                        "example": 1024
                                    },
                                    "diskMbytes": {
                                        "type": "integer",
                                        "example": 2048
                                    }
                                }
                            },
                            "buildId": {
                                "type": "string"
                            },
                            "defaultKeyValueStoreId": {
                                "type": "string"
                            },
                            "defaultDatasetId": {
                                "type": "string"
                            },
                            "defaultRequestQueueId": {
                                "type": "string"
                            },
                            "buildNumber": {
                                "type": "string",
                                "example": "1.0.0"
                            },
                            "containerUrl": {
                                "type": "string"
                            },
                            "usage": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "integer",
                                        "example": 1
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "usageTotalUsd": {
                                "type": "number",
                                "example": 0.00005
                            },
                            "usageUsd": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "number",
                                        "example": 0.00005
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
