The xml-validation policy validates XML using an XSD schema. This policy uses javax.xml. When validation fails, the policy returns a 400 BAD REQUEST error with a custom error message body.
Timing
| On Request Content | On Response Content |
|---|
| X | |
Configuration
| Property | Required | Description | Type | Default |
|---|
errorMessage | no | Custom error message in XML format. You can use Spel. | string | validation/internal |
xsdSchema | yes | XSD schema | string | |
Errors
HTTP Response Code
| Code | Message |
|---|
400 | Applies to invalid payload, invalid XSD schema, invalid error message XML format. |