Any
JSON Module Reference
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
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.
|
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 Schemas generated from RAML typically omit |
Parameters
| Name | Type | Description | Default Value | Required |
|---|---|---|---|---|
Content |
The JSON document to validate. |
#[payload] |
||
Schema Redirects |
Array of Schema Redirect |
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. |
||
Dereferencing |
Enumeration, one of: CANONICAL INLINE |
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. |
CANONICAL |
|
Allow Duplicate Keys |
Boolean |
If true, the validator allows duplicate keys, otherwise it fails |
true |
|
Allow Arbitrary Precision |
Boolean |
If true, the validator uses arbitrary precision when reading floating point values, otherwise it uses double precision. |
false |
|
Schema |
String |
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". |
||
SchemaContent |
String |
The content of the schema to validate in text format. |



