Table of Contents

Interface ISchemaRegistry

Namespace
Excalibur.Dispatch.CloudEvents
Assembly
Excalibur.Dispatch.dll

Interface for schema registry integration.

public interface ISchemaRegistry
Extension Methods

Methods

GetSchemaAsync(string, string, CancellationToken)

Gets the schema for a specific event type and version.

Task<string?> GetSchemaAsync(string eventType, string version, CancellationToken cancellationToken)

Parameters

eventType string
version string
cancellationToken CancellationToken

Returns

Task<string>

A Task representing the asynchronous operation.

GetVersionsAsync(string, CancellationToken)

Gets all versions for an event type.

Task<IReadOnlyList<string>> GetVersionsAsync(string eventType, CancellationToken cancellationToken)

Parameters

eventType string
cancellationToken CancellationToken

Returns

Task<IReadOnlyList<string>>

A Task representing the asynchronous operation.

RegisterSchemaAsync(string, string, string, CancellationToken)

Registers a schema for a specific event type and version so it can later be resolved by GetSchemaAsync(string, string, CancellationToken). Without a registration path a registry can never resolve a schema, which would force the validation gate to either fail closed or (worse) rubber-stamp every event.

Task RegisterSchemaAsync(string eventType, string version, string schema, CancellationToken cancellationToken)

Parameters

eventType string

The CloudEvent type the schema applies to.

version string

The schema version.

schema string

The schema document.

cancellationToken CancellationToken

A cancellation token for the operation.

Returns

Task

A Task representing the asynchronous operation.