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
eventTypestringversionstringcancellationTokenCancellationToken
Returns
GetVersionsAsync(string, CancellationToken)
Gets all versions for an event type.
Task<IReadOnlyList<string>> GetVersionsAsync(string eventType, CancellationToken cancellationToken)
Parameters
eventTypestringcancellationTokenCancellationToken
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
eventTypestringThe CloudEvent type the schema applies to.
versionstringThe schema version.
schemastringThe schema document.
cancellationTokenCancellationTokenA cancellation token for the operation.