XML XSD Validator rule

Use the XML Validator rule to validate a request against an XML Schema Definition (XSD). You can upload an XML XSD file to define the schema.

Validates a request against an XML Schema Definition (XSD). You can upload an XML XSD file in the rule dialog as a valid Swagger XML document. If an invalid path or parameter or object is not defined in the schema, the client receives a Schema Validation Failed error.
Note: Alternatively, you can use the specification that you upload to create an API.

Policy execution order

The XML XSD Validator rule executes after the request has been authenticated. You can use both the XML XSD Validator and XML DTD Validator rule policies concurrently as long as the schemas do not conflict.

Note: All expression enabled fields in API Policies take expressions from Understanding Expressions in SnapLogic and the API Policy Manager Functions

Settings

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 request.method == "POST" causes the rule to execute only on POST requests.

Edit DTD 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.

Default value: Empty XML file

Example:
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema">
  <xs:element name="books" type="booksType"/>
  <xs:complexType name="bookType">
    <xs:sequence>
      <xs:element type="xs:string" name="author"/>
      <xs:element type="xs:string" name="title"/>
      <xs:element type="xs:string" name="genre"/>
      <xs:element type="xs:string" name="price"/>
      <xs:element type="xs:string" name="pub_date"/>
      <xs:element type="xs:string" name="review" maxOccurs="2"/>
    </xs:sequence>
    <xs:attribute type="xs:string" name="id"/>
  </xs:complexType>
  <xs:complexType name="booksType">
    <xs:sequence>
      <xs:element type="bookType" name="book" maxOccurs="2"/> <!-- book is the child of 'books' max is 2 -->
    </xs:sequence>
  </xs:complexType>
</xs:schema>
Hide/Render WhiteSpace Formats XML with watermarked dots or plain white space between the characters.
Format Code Formats text in XML
Description

Required. A brief description of this rule.

Default value: Requests are being validated against the specified XSD

Example: Task XML XSD Validator