{ "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "https://as4-411.example/schemas/route-directive.json", "title": "RouteDirective and ResolveResponse", "description": "Formal schema for routing directive and resolve response. See docs/architecture/route-directive.md.", "definitions": { "RouteDirectiveSecurity": { "type": "object", "properties": { "signRequired": { "type": "boolean" }, "encryptRequired": { "type": "boolean" }, "keyRefs": { "type": "array", "items": { "type": "string" } }, "algorithms": { "type": "object" } } }, "RouteDirectiveServiceContext": { "type": "object", "properties": { "service": { "type": "string" }, "action": { "type": "string" }, "serviceIndicator": { "type": "string" } } }, "RouteDirectiveQos": { "type": "object", "properties": { "retries": { "type": "integer" }, "receiptsRequired": { "type": "boolean" }, "ordering": { "type": "string" } } }, "EvidenceItem": { "type": "object", "properties": { "source": { "type": "string" }, "freshness": { "type": "string", "format": "date-time" }, "confidence": { "type": "number" }, "signature": { "type": "string" } } }, "RouteDirective": { "type": "object", "required": ["target_protocol", "target_address"], "properties": { "target_protocol": { "type": "string" }, "target_address": { "type": "string" }, "transport_profile": { "type": "string" }, "security": { "$ref": "#/definitions/RouteDirectiveSecurity" }, "service_context": { "$ref": "#/definitions/RouteDirectiveServiceContext" }, "qos": { "$ref": "#/definitions/RouteDirectiveQos" }, "ttl_seconds": { "type": "integer" }, "evidence": { "type": "array", "items": { "$ref": "#/definitions/EvidenceItem" } } } }, "DirectiveWithReason": { "type": "object", "required": ["directive"], "properties": { "directive": { "$ref": "#/definitions/RouteDirective" }, "reason": { "type": "string" } } }, "FailurePolicy": { "type": "object", "properties": { "retry": { "type": "boolean" }, "backoff": { "type": "string" }, "circuitBreak": { "type": "boolean" } } }, "ResolutionTraceEntry": { "type": "object", "properties": { "source": { "type": "string" }, "directiveIndex": { "type": "integer" }, "message": { "type": "string" } } }, "ResolveResponse": { "type": "object", "properties": { "primary": { "$ref": "#/definitions/RouteDirective" }, "alternates": { "type": "array", "items": { "$ref": "#/definitions/DirectiveWithReason" } }, "directives": { "type": "array", "items": { "$ref": "#/definitions/RouteDirective" } }, "ttl": { "type": "integer" }, "traceId": { "type": "string", "format": "uuid" }, "correlationId": { "type": "string" }, "failure_policy": { "$ref": "#/definitions/FailurePolicy" }, "negative_cache_ttl": { "type": "integer" }, "resolution_trace": { "type": "array", "items": { "$ref": "#/definitions/ResolutionTraceEntry" } } } } }, "oneOf": [ { "$ref": "#/definitions/RouteDirective" }, { "$ref": "#/definitions/ResolveResponse" } ] }