{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/bookmyhost/json-schema/bookmyhost-policy-validation-response-schema.json",
  "title": "PolicyValidationResponse",
  "description": "Response from policy validation.\n\n- `valid`: True if no blocking errors were found\n- `errors`: List of blocking errors (prevent policy from being applied)\n- `warnings`: List of non-blocking warnings (policy can still be applied)",
  "x-generated": "2026-11-12",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/bookmyhost-policies-api-openapi.yml#/components/schemas/PolicyValidationResponse",
  "additionalProperties": false,
  "properties": {
    "errors": {
      "description": "List of blocking validation errors.",
      "items": {
        "$ref": "#/$defs/PolicyValidationError"
      },
      "title": "Errors",
      "type": "array"
    },
    "valid": {
      "description": "True if the policy configuration is valid.",
      "title": "Valid",
      "type": "boolean"
    },
    "warnings": {
      "description": "List of non-blocking validation warnings.",
      "items": {
        "$ref": "#/$defs/PolicyValidationError"
      },
      "title": "Warnings",
      "type": "array"
    }
  },
  "required": [
    "valid"
  ],
  "type": "object",
  "$defs": {
    "PolicyValidationError": {
      "additionalProperties": false,
      "description": "Represents a validation error or warning for a policy.",
      "properties": {
        "error_type": {
          "$ref": "#/$defs/PolicyValidationErrorType",
          "description": "Type of validation error."
        },
        "field": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "description": "Specific field that caused the error (e.g., 'guardrails.add', 'scope.teams').",
          "title": "Field"
        },
        "message": {
          "description": "Human-readable error message.",
          "title": "Message",
          "type": "string"
        },
        "policy_name": {
          "description": "Name of the policy with the issue.",
          "title": "Policy Name",
          "type": "string"
        },
        "value": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "description": "The invalid value that caused the error.",
          "title": "Value"
        }
      },
      "required": [
        "policy_name",
        "error_type",
        "message"
      ],
      "title": "PolicyValidationError",
      "type": "object"
    },
    "PolicyValidationErrorType": {
      "description": "Types of validation errors that can occur.",
      "enum": [
        "invalid_guardrail",
        "invalid_team",
        "invalid_key",
        "invalid_model",
        "invalid_inheritance",
        "circular_inheritance",
        "invalid_scope",
        "invalid_syntax"
      ],
      "title": "PolicyValidationErrorType",
      "type": "string"
    }
  }
}