{ "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "https://open-delivery-spec.dev/schemas/approval-workflow.json", "title": "ODS Approval Workflow", "description": "Schema for declarative approval policies in the Open Delivery Spec (v1.0.0).", "type": "object", "required": ["policy_id", "version", "rules", "roles"], "properties": { "policy_id": { "type": "string", "description": "Unique policy identifier" }, "version": { "type": "string", "pattern": "^\\d+\\.\\d+\\.\\d+$" }, "description": { "type": "string" }, "extends": { "type": "string", "description": "Reference to a parent policy to extend" }, "rules": { "type": "array", "minItems": 1, "items": { "type": "object", "required": ["rule_id", "description", "condition", "requires"], "properties": { "rule_id": { "type": "string" }, "description": { "type": "string" }, "condition": { "type": "object", "required": ["field", "operator", "value"], "properties": { "field": { "type": "string" }, "operator": { "type": "string", "enum": ["equals", "not_equals", "gte", "lte", "gt", "lt", "in", "contains", "always"] }, "value": {} } }, "requires": { "type": "object", "required": ["approvals"], "properties": { "approvals": { "type": "array", "minItems": 1, "items": { "type": "object", "required": ["role", "count"], "properties": { "role": { "type": "string" }, "count": { "type": "integer", "minimum": 1 }, "allow_same_as_author": { "type": "boolean", "default": false } } } }, "checks": { "type": "array", "items": { "type": "string" } } } } } } }, "roles": { "type": "array", "minItems": 1, "items": { "type": "object", "required": ["role", "description", "members"], "properties": { "role": { "type": "string" }, "description": { "type": "string" }, "members": { "type": "array", "minItems": 1, "items": { "type": "string" } } } } }, "escalation": { "type": "object", "properties": { "timeout_hours": { "type": "number", "minimum": 1 }, "escalate_to": { "type": "array", "items": { "type": "string" } }, "auto_approve_after": { "type": ["number", "null"] } } } } }