{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/acceldata/json-schema/acceldata-rule-config-schema.json",
  "title": "io.ad.catalog.api.model.quality.RuleConfig",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/acceldata-rule-configuration-api-openapi.yml#/components/schemas/RuleConfig",
  "type": "object",
  "required": [
    "ruleId"
  ],
  "properties": {
    "categoriesPersistenceConfig": {
      "$ref": "#/$defs/PolicyPersistencePathConfig"
    },
    "categoriesResultHandlingConfig": {
      "oneOf": [
        {
          "$ref": "#/$defs/CategoriesResultHandlingConfig"
        },
        {
          "type": "null"
        }
      ]
    },
    "id": {
      "type": "integer"
    },
    "persistenceFolderPrefix": {
      "type": [
        "string",
        "null"
      ]
    },
    "ruleId": {
      "type": "integer"
    }
  },
  "$defs": {
    "CategoriesPersistenceConfig": {
      "type": "object",
      "title": "io.ad.catalog.api.model.CategoriesPersistenceConfig",
      "required": [
        "bad",
        "good"
      ],
      "properties": {
        "bad": {
          "$ref": "#/$defs/SingleCategoryPersistenceConfig"
        },
        "good": {
          "$ref": "#/$defs/SingleCategoryPersistenceConfig"
        },
        "metadata": {
          "oneOf": [
            {
              "$ref": "#/$defs/MetadataPersistenceConfig"
            },
            {
              "type": "null"
            }
          ]
        }
      }
    },
    "CategoriesResultHandlingConfig": {
      "type": "object",
      "title": "io.ad.catalog.api.model.CategoriesResultHandlingConfig",
      "required": [
        "bad",
        "good"
      ],
      "properties": {
        "bad": {
          "$ref": "#/$defs/SingleCategoryResultHandlingConfig"
        },
        "good": {
          "$ref": "#/$defs/SingleCategoryResultHandlingConfig"
        }
      }
    },
    "CustomPolicyPersistencePathConfig": {
      "type": "object",
      "title": "io.ad.catalog.api.model.CustomPolicyPersistencePathConfig",
      "required": [
        "categoriesConfig"
      ],
      "properties": {
        "categoriesConfig": {
          "$ref": "#/$defs/CategoriesPersistenceConfig"
        }
      }
    },
    "DefaultPolicyPersistencePathConfig": {
      "type": "object",
      "title": "io.ad.catalog.api.model.DefaultPolicyPersistencePathConfig"
    },
    "MetadataPersistenceConfig": {
      "type": "object",
      "title": "io.ad.catalog.api.model.MetadataPersistenceConfig",
      "required": [
        "suffixTemplate"
      ],
      "properties": {
        "suffixTemplate": {
          "type": "string"
        }
      }
    },
    "PolicyPersistencePathConfig": {
      "type": [
        "object",
        "null"
      ],
      "title": "io.ad.catalog.api.model.PolicyPersistencePathConfig",
      "oneOf": [
        {
          "$ref": "#/$defs/CustomPolicyPersistencePathConfig"
        },
        {
          "$ref": "#/$defs/DefaultPolicyPersistencePathConfig"
        },
        {
          "$ref": "#/$defs/SavedPolicyPersistencePathConfig"
        }
      ]
    },
    "SavedPolicyPersistencePathConfig": {
      "type": "object",
      "title": "io.ad.catalog.api.model.SavedPolicyPersistencePathConfig",
      "required": [
        "configId"
      ],
      "properties": {
        "configId": {
          "type": "integer"
        }
      }
    },
    "SingleCategoryPersistenceConfig": {
      "type": "object",
      "title": "io.ad.catalog.api.model.SingleCategoryPersistenceConfig",
      "required": [
        "format",
        "suffixTemplate"
      ],
      "properties": {
        "format": {
          "type": "string",
          "enum": [
            "PARQUET",
            "ORC",
            "CSV",
            "JSON"
          ]
        },
        "suffixTemplate": {
          "type": "string"
        }
      }
    },
    "SingleCategoryResultHandlingConfig": {
      "type": "object",
      "title": "io.ad.catalog.api.model.SingleCategoryResultHandlingConfig",
      "required": [
        "sampleOnly",
        "storeResult"
      ],
      "properties": {
        "sampleOnly": {
          "type": "boolean"
        },
        "storeResult": {
          "type": "boolean"
        }
      }
    }
  }
}