---
schema_version: "1"
id: b9d7e1b0f3f0be4ebb2f05670c6d1b8eea8ed18385ccffe413c9d0135da14b34
title: JSON Module Reference
collection: mulesoft
version: current
locale: en-us
portal_url: https://docs.salesforce.com/mulesoft/current/en-us/json-module/latest/json-reference.md
canonical_url: https://docs.mulesoft.com/json-module/latest/json-reference
source_site: docs.mulesoft.com
content_type: documentation
content_hash: f0ae92dcd2b47fc17d04d19f255f1faa0910ab5abbad19ba479f72196de5421d
description: MuleSoft Documentation Site
release: "2.5"
latest: true
---
---
product: JSON Module
version: 2.5
is-latest-version: true
---

# JSON Module Reference

> For the full documentation index, see: https://docs.mulesoft.com/llms.txt

JSON Module v2.5

The JSON module provides extra functionality for processing JSON documents. Although DataWeave is
the tool that Mule uses to access data in JSON documents, this module provides extra functionality
that falls outside of DataWeave’s scope, like schema validation.

Release Notes: [JSON Module Release Notes](https://docs.mulesoft.com/release-notes/connector/json-module-release-notes)

## Configurations

---

### Default Configuration

Default configuration

#### Parameters

<table><colgroup><col> <col> <col> <col> <col></colgroup><thead><tr><th>Name</th><th>Type</th><th>Description</th><th>Default Value</th><th>Required</th></tr></thead><tbody><tr><td><p>Name</p></td><td><p>String</p></td><td><p>The name for this configuration. Connectors reference the configuration with this name.</p></td><td></td><td><p>x</p></td></tr></tbody></table>

## Operations

### Validate Schema

`<json:validate-schema>`

Validates that the input content is compliant with a given schema. This operation supports
referencing many schemas (using comma as a separator) which include each other.

This operation supports schema versions Draft 3, Draft 4, Draft 6, Draft 7, Draft 2019-09, and Draft
2020-12. If you don’t specify a draft version in the JSON schema node (using the `$schema` keyword),
the default version is Draft 04.

> [!NOTE] Draft 06 and later are handled by a different validation engine than Draft 03 and
> Draft 04. When validation fails, the Draft 03 or Draft 04 engine collects every constraint
> violation across the entire document into the error report, so validating a large payload that
> fails can produce a very large report and cause high transient memory usage.
>
> If you validate large payloads and your schema doesn’t require Draft 03 or Draft 04 specific
> behavior, declare a Draft 06 or later `$schema` (for example,
> `"$schema": "http://json-schema.org/draft-07/schema#"`) so that validation uses the more
> memory-efficient engine.
>
> Schemas generated from RAML typically omit `$schema` and therefore default to the Draft 04 path.

#### Parameters

<table><colgroup><col> <col> <col> <col> <col></colgroup><thead><tr><th>Name</th><th>Type</th><th>Description</th><th>Default Value</th><th>Required</th></tr></thead><tbody><tr><td><p>Content</p></td><td><div><div><p>Any</p></div></div></td><td><p>The JSON document to validate.</p></td><td><p>#[payload]</p></td><td></td></tr><tr><td><p>Schema Redirects</p></td><td><div><div><p>Array of <a href="#SchemaRedirect">Schema Redirect</a></p></div></div></td><td><p>Allows to redirect any given URI in the Schema (or even the schema location itself) to any other specific URI. The most common use case for this feature is to map external namespace URIs without the need to a local resource.</p></td><td></td><td></td></tr><tr><td><p>Dereferencing</p></td><td><div><div><p>Enumeration, one of: <strong>CANONICAL </strong>INLINE</p></div></div></td><td><p>Draft v4 defines two dereferencing modes: canonical and inline. CANONICAL is the default option, you can also specify INLINE. This field affects only when you use Draft v4.</p></td><td><p>CANONICAL</p></td><td></td></tr><tr><td><p>Allow Duplicate Keys</p></td><td><div><div><p>Boolean</p></div></div></td><td><p>If true, the validator allows duplicate keys, otherwise it fails</p></td><td><p>true</p></td><td></td></tr><tr><td><p>Allow Arbitrary Precision</p></td><td><div><div><p>Boolean</p></div></div></td><td><p>If true, the validator uses arbitrary precision when reading floating point values, otherwise it uses double precision.</p></td><td><p>false</p></td><td></td></tr><tr><td><p>Schema</p></td><td><div><div><p>String</p></div></div></td><td><p>The location of the validate schema to validate. This attribute supports URI representations such as "http://org.mule/schema.json" or "resource:/schema.json". It also supports a most common classpath reference such as simply "schema.json".</p></td><td></td><td></td></tr><tr><td><p>SchemaContent</p></td><td><div><div><p>String</p></div></div></td><td><p>The content of the schema to validate in text format.</p></td><td></td><td></td></tr></tbody></table>

#### Throws

- JSON:INVALID\_INPUT\_JSON

- JSON:INVALID\_SCHEMA

- JSON:SCHEMA\_NOT\_FOUND

- JSON:SCHEMA\_NOT\_HONOURED

- JSON:SCHEMA\_INPUT\_ERROR

## Types

### Schema Redirect

<table><colgroup><col> <col> <col> <col> <col></colgroup><thead><tr><th>Field</th><th>Type</th><th>Description</th><th>Default Value</th><th>Required</th></tr></thead><tbody><tr><td><p>From</p></td><td><div><div><p>String</p></div></div></td><td><p>The original location</p></td><td></td><td><p>x</p></td></tr><tr><td><p>To</p></td><td><div><div><p>String</p></div></div></td><td><p>The redirection location</p></td><td></td><td><p>x</p></td></tr></tbody></table>

## See Also

[Salesforce Help](https://help.salesforce.com)
