---
title: c JSON Schema Validator
description: Available connectors
documentId: ipaas-json-schema-validator
locale: en-US
---

The [**JSON Schema Validator**](https://camel.apache.org/components/4.10.x/json-validator-component.html) component performs bean validation of the message body.

**URI Syntax**: `json-validator:resourceUri`

## Main fields

*Path parameters*

| **Name** | **Description** | **Default** | **Type** |
|----------|------------------|------------|----------|
| `resourceUri` (producer)| (required) Path to the resource. You can prefix with: classpath, file, http, ref or bean. | — | String |

### Example

<Steps>
<Step>
The flow starts when a POST request is received.
</Step>
<Step>
Logs the received JSON to `myLogger` log (before validation).
</Step>
<Step>
Validates the JSON against the schema defined in `my-json-schema.json` (if invalid, throws exception).
</Step>
<Step>
Logs confirmation to `myLogger` log (after successful validation).
</Step>
</Steps>

```yaml
- from:
    uri: rest:post:hello
    steps:
      - to:
          uri: log:myLogger
      - to:
          uri: json-validator:file:/etc/camel/resources/sensedia-integration-camel-poc-configmap/my-json-schema.json"
      - to:
          uri: log:myLogger
```

![](https://creative-ball-51b3fc85c0.media.strapiapp.com/component_json_schema_validator_82548fe7fe.png)

### cURL

```
curl --location --request POST 'https://sensedia-integration-camel-poc.f6g7h8i9j0.integrations-tst.sensedia-eng.com/hello' \
--header 'Content-Type: application/json' \
--data-raw '{
    "name": "bala garoto",
    "price": 1.40
}'
```

### Result

```
sensedia-integration-camel-poc-00001-deployment-5b4b85d9bbgmwhc integration 2024-04-02 14:12:56,455 INFO  [myLogger] (executor-thread-1) Exchange[ExchangePattern: InOut, BodyType: org.apache.camel.converter.stream.ByteArrayInputStreamCache, Body: {    "name": "bala garoto",    "price": 1.40}]
```
