> ## Documentation Index
> Fetch the complete documentation index at: https://docs.alumio.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Validate by JSON schema

> Validates JSON data based on the supplied schema.

Checks each item against a JSON schema and drops the ones that do not match. A JSON schema describes the shape your data should have, such as which fields are required, what type each value must be, and which values are allowed. Items that satisfy the schema pass through unchanged; items that fail are filtered out of the list. Use this to keep only well-formed records and stop incomplete or malformed data from reaching the next step.

This documentation describes: [Schema](/schemas/transformer-step/json-schema-validator-filter)

## Fields

**Schema to use**

Optional

Where the schema comes from. Choose **Use schema from entity** (the default) to validate against a schema that travels with the item itself, or **Use custom schema** to type the schema in the next field. The allowed values are `fromEntity` and `custom`.

**Schema**

Optional

The JSON schema to validate against. This field appears and is required only when **Schema to use** is set to **Use custom schema**. Enter the schema as JSON, describing the required fields, value types, and allowed values your items must match.

**Pattern to data to validate**

Optional

A dot-notated pattern pointing at the part of each item you want to validate, for example `address` to check only the address block. Leave it empty to validate the whole item.

**Log failed validation results**

Optional

When turned on, every item that fails validation is written to the logs, with the reason it failed. Useful while you are setting up the schema and want to see exactly why items are being dropped. Off by default.

## Sample data

This transformer does not change the items that pass; it only removes the ones that fail the schema. The values you set decide what counts as valid.

For example, with a custom schema that requires a `sku` (text) and a `price` (number):

| Field | Value |
| - | - |
| Schema to use | Use custom schema |
| Schema | requires `sku` (string) and `price` (number) |
| Pattern | empty (whole item) |

| Item | Result |
| - | - |
| `{ "sku": "A1", "price": 19.99 }` | Passes (matches the schema) |
| `{ "sku": "A1" }` | Dropped (`price` is missing) |
| `{ "sku": "A1", "price": "free" }` | Dropped (`price` is not a number) |

```json Configuration theme={null}
{
  "prototype": "json-schema-validator-filter",
  "parameters": {
    "useSchema": "custom",
    "schema": {
      "type": "object",
      "required": ["sku", "price"],
      "properties": {
        "sku": { "type": "string" },
        "price": { "type": "number" }
      }
    },
    "enableLogging": false
  }
}
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.