Validators are configured using an XML-combining XML file. The payloadschema.xml file defines the top-level payload-schemas and child schema tags, giving each schema tag a unique ID. Each schema tag represents a java-bean class or a repository item type and specifies the entity that validation input represents. Note that a validator can be run on inputs of other types, such as a JSONObject, as well as update other types, such as an empty HashMap.
The following table describes a few of the XML attributes from the payloadSchema.xml file that can be used during filtering and validation. For a full list, refer to the ATG Platform API Reference:
XML Attribute | Description |
|---|---|
| This attribute on the |
| The unique ID of the schema. |
| This attribute on the |
| The ID of the schema from which to inherit. |
| This element allows the simple properties of a sub-property to be exposed as its own properties. |
| This attribute on the |
| This attribute on the |
| Identifies if switches should be performed before contained |
| This attribute on the |
| Indicates if the schema can be used for updates. If set to |
In addition to the XML attributes listed above, you can use the embedded XML tag, which determines how embedded resources filter output as part of the root resource. This element has hidden and use-schema-id attributes. The hidden attribute decides if the full embedded resource will be output. If hidden=true, only a self link for the embedded resource will display. The use-schema-id attribute indicates the schema to use when filtering the embedded resource. If an embedded resource exists for a root resource, but no corresponding embedded tag is specified in the payloadSchema.xml, there will be no output for that embedded resource.
The property and bean-property validators are executed in the order in which they appear in the XML file for a given bean. Validators created from the property tag, which represents a simple property, are executed before the validators created from bean-property tags, which represent a property that has a value of a bean that has nested properties itself. Validators that are created for switch tags are executed last, unless the switches-first attribute on the schema or bean-property tag is set to true.

