JSON Validator rule
Use the JSON Validator rule to validate a request against a JSON schema. Limit JSON structures to minimize content-level attacks.
application/json
.
Policy execution order
This JSON Validator rule executes after the request is authenticated.
Rule fields include:
Field | Description |
---|---|
When this rule should be applied | An expression that defines one or more conditions that must be
true for the rule to execute.
Example: The expression |
Edit Json Schema | The schema to use for valication. Launches the JSON editor. You can create import an
existing JSON file from the SnapLogic file system or create a new one. The editor loads an
existing JSON document if defined previously. Default value: Empty JSON file Example:
|
Hide/Render WhiteSpace | Formats JSON with watermarked dots or plain white space between the characters. |
Format Code | Formats text in JSON |
Description |
A customizable description. Default value: Requests are being validated against the specified schema |
Troubleshooting rule violations
The JSON Validator rule now returns the actual rule violation error to the API caller.
Each error type is parameterized and added to the response in the "SL_Policy_Error"
header.
The following image provides an example of a rule violation error.

First, a required field (productId) is missing a value. Secondly, the value for the price field is invalid.