# json_schema

> For the complete documentation index, see [llms.txt](https://docs.redpanda.com/llms.txt). Component-specific: [connect-full.txt](https://docs.redpanda.com/connect-full.txt)

---
title: json_schema
latest-connect-version: 4.93.0
latest-operator-version: v26.1.4
latest-console-tag: v3.7.3
latest-redpanda-tag: v26.1.9
docname: processors/json_schema
page-component-name: connect
page-version: master
page-component-version: master
page-component-title: Connect
page-relative-src-path: processors/json_schema.adoc
page-edit-url: https://github.com/redpanda-data/rp-connect-docs/edit/main/modules/components/pages/processors/json_schema.adoc
page-git-created-date: "2024-05-24"
page-git-modified-date: "2026-05-26"
---

<!-- Source: https://docs.redpanda.com/connect/components/processors/json_schema.md -->

**Available in:** [Cloud](https://docs.redpanda.com/cloud-data-platform/develop/connect/components/processors/json_schema/%20%22View%20the%20Cloud%20version%20of%20this%20component%22), Self-Managed

Checks messages against a provided JSONSchema definition but does not change the payload under any circumstances. If a message does not match the schema it can be caught using [error handling methods](https://docs.redpanda.com/connect/configuration/error_handling/).

```yml
# Config fields, showing default values
label: ""
json_schema:
  schema: "" # No default (optional)
  schema_path: "" # No default (optional)
```

Please refer to the [JSON Schema website](https://json-schema.org/) for information and tutorials regarding the syntax of the schema.

## [](#fields)Fields

### [](#schema)`schema`

A schema to apply. Use either this or the `schema_path` field.

**Type**: `string`

### [](#schema_path)`schema_path`

The path of a schema document to apply. Use either this or the `schema` field.

**Type**: `string`

## [](#examples)Examples

With the following JSONSchema document:

```json
{
	"$id": "https://example.com/person.schema.json",
	"$schema": "http://json-schema.org/draft-07/schema#",
	"title": "Person",
	"type": "object",
	"properties": {
	  "firstName": {
		"type": "string",
		"description": "The person's first name."
	  },
	  "lastName": {
		"type": "string",
		"description": "The person's last name."
	  },
	  "age": {
		"description": "Age in years which must be equal to or greater than zero.",
		"type": "integer",
		"minimum": 0
	  }
	}
}
```

And the following Redpanda Connect configuration:

```yaml
pipeline:
  processors:
  - json_schema:
      schema_path: "file://path_to_schema.json"
  - catch:
    - log:
        level: ERROR
        message: "Schema validation failed due to: ${!error()}"
    - mapping: 'root = deleted()' # Drop messages that fail
```

If a payload being processed looked like:

```json
{"firstName":"John","lastName":"Doe","age":-21}
```

Then a log message would appear explaining the fault and the payload would be dropped.