Skip to main content
Version: 5.1.1.0

JSON schema validator

Description

This scriptlet validates a native JSON message against a given SON schema. The user may import Resources containing JSON schema documents into the scenario. The scriptlet can validate a JSON message against a JSON schema. A message containing a list of error records is returned.

If the validation succeeds the attribute valid has the value true.

Create

See creation of Scriptlet.

Configuration

To configure the scriptlet you mainly must select a Resource containing a JSON schema.

Properties and Parameter assignment

The assignment sections define the variable connection between the script execution and process model.

The following parameters are required.

**Ingoing Parameter**:

- **MSG**: Input message

- **path**: Denotes the schema in the schema document. If the parameter is missing or the value is `#`, it references the root schema. Typically, the value is a JSON path starting with `#`, as in the example above. It can also be the name of an anchor or a relative URL. Generally, it is a URI-Reference resolved against the current URI base. For details, see the specification of `$ref` in the corresponding JSON schema version.

- **mediaType**: A MIME type defining the content to validate; currently, only `application/json` is allowed. If the value is missing, `application/json` is assumed.

- **resultType**: A MIME type defining the type of the result, e.g., `application/xml` or `application/json` for a standard JSON schema result. If the value is missing, `application/json` is assumed.

**Outgoing parameter**:

- **RESULTMSG**: Output message containing error records denoting warnings and errors that occurred while validating the message.

For further information, click here: JSON-SCHEMA