{
  "category": "Mediation",
  "name": "jsonValidator",
  "version": "v1",
  "displayName": "JSON Validator",
  "description": "This policy validates the request body of the JSON message",
  "applicableFlows": [
    "request"
  ],
  "supportedGateways": [
    "Synapse"
  ],
  "supportedApiTypes": [
    "HTTP"
  ],
  "policyAttributes": [
    {
      "name": "maxPropertyCount",
      "displayName": "Max Property Count",
      "description": "Maximum number of properties allowed in the json payload",
      "validationRegex": "^\\d{1,3}$",
      "type": "Integer",
      "defaultValue": 100,
      "required": false
    },
    {
      "name": "maxStringLength",
      "displayName": "Max String Length",
      "description": "Maximum length of a string in the json payload",
      "validationRegex": "^\\d{1,3}$",
      "type": "Integer",
      "defaultValue": 100,
      "required": false
    },
    {
      "name": "maxArrayElementCount",
      "displayName": "Max Array Element Count",
      "description": "Maximum number of array elements allowed in the json payload",
      "validationRegex": "^\\d{1,3}$",
      "type": "Integer",
      "defaultValue": 100,
      "required": false
    },
    {
      "name": "maxKeyLength",
      "displayName": "Max Key Length",
      "description": "Maximum length of a key allowed in the json payload",
      "validationRegex": "^\\d{1,3}$",
      "type": "Integer",
      "defaultValue": 100,
      "required": false
    },
    {
      "name": "maxJsonDepth",
      "displayName": "Max Json Depth",
      "description": "Maximum depth of the json payload",
      "validationRegex": "^\\d{1,3}$",
      "type": "Integer",
      "defaultValue": 100,
      "required": false
    },
    {
      "name": "requestMessageBufferSize",
      "displayName": "Request message buffer size",
      "description": "Request message buffer size",
      "validationRegex": "^\\d{1,4}$",
      "type": "Integer",
      "defaultValue": 1024,
      "required": false
    },
    {
      "name": "jsonSchemaValidator",
      "displayName": "Json schema validator",
      "description": "Json schema validator implementation class",
      "validationRegex": "^([a-zA-Z_$][a-zA-Z\\d_$.]*)$",
      "type": "String",
      "defaultValue": "org.wso2.carbon.apimgt.gateway.mediators.JsonSchemaValidator",
      "required": false
    }
  ]
}