Validate - DataPower Gateway (v5 compatible)
Use the Validate policy to validate the payload in an assembly flow against a JSON or an XML schema.
Gateway support
For information on the different types of gateway, see API Connect gateway types.
Gateway | Policy version |
---|---|
DataPower Gateway (v5 compatible) | 1.0.0 |
This topic describes how to configure the policy in the assembly user interface; for details on how to configure the policy in your OpenAPI source, see validate - DataPower Gateway (v5 compatible).
- The schema that represents the XML can reference only one XML namespace.
- The schema cannot reference polymorphic XML elements.
- The validation works on the
message.body
variable and not any other output/context variable. If the invoke policy contains a configured response object variable, thenmessage.body
is not set, and validate is not able to act. - If you use the
multipleOf
keyword in a schema definition for the API then, due to rounding behavior, the specified value must satisfy the following conditions, otherwise the validation fails when the API is called:- The value must not be less than
0.000000999999999999999848869
. - If the value is greater than 1, the amount before the decimal point must not be greater than
999999999999999934463
.
- The value must not be less than
About
- REST
- To validate the original input, position a Validate policy at the start of your flow.
- To validate an intermediate response that is returned from other invoke actions or tasks, position a Validate policy after those actions or tasks.
- To validate the response that is returned to the client application, position a Validate policy after the task that collates the response.
You can apply a different OpenAPI schema definition to each Validate policy either by choosing from the set of schema definitions that is specified at the API level, or the schema definition at the operation level.
Properties
The following table lists the policy properties, indicates whether a property is required, specifies the valid and default values for input, and specifies the data type of the values.
Property label | Required | Description | Data type |
---|---|---|---|
Title | Yes | The title of the policy. The default value is |
string |
Description | No | A description of the policy. | string |
Definition | Yes | Specifies the schema definition to be used for validating the payload. Valid values:
|
string |