Use the XML Validator policy to validate a request against a XML schema. You can specify limits on various XML structures, such as arrays and strings. This capability minimizes the risk posed by content-level attacks. The policy gets applied and is executed only if the Content-Type of the request or response header is set to application/XML
.
Policy Execution Order
This XML Validator policy executes after the request has been authenticated.
Expression Enabled Fields in API Policies
All expression enabled fields take expressions from the SnapLogic Expression Language and the API Policy Manager functions.
Parameter Name | Description | Default Value | Example |
---|---|---|---|
Label | Required. The name for the API policy. | XML Validator | Task XML Validator |
When this policy should be applied | An expression enabled field that determines the condition to be fulfilled for the API policy to execute. For example, if the value in this field is request.method == "POST", the API policy is executed only if the request method is a POST. | True | request.method == "POST" |
Edit XML | Launches the XML editor which allows you to define XML. The editor loads an existing XML document if defined previously. The editor lets you save XML in SnapLogic's file system or import existing XML documents from it. | Empty XML file | "$schema": "http://XML-schema.org/draft-06/schema#", "type": "object", "properties": { "foo": { "type": "integer" }, "bar": { "type": "string" } } } |
Hide/Render WhiteSpace: Formats XML with watermarked dots or plain white space between the characters. | |||
Format Code: Formats text in XML | |||
Status | Indicates whether the API policy is enabled or disabled. | Enabled | Disabled |