Class SchemaTypeResolution
Represents the result of resolving a schema ID to a .NET type.
public sealed class SchemaTypeResolution
- Inheritance
-
SchemaTypeResolution
- Inherited Members
- Extension Methods
Remarks
This type is immutable and can be safely cached. Resolution is performed once per schema ID and reused for subsequent messages with the same schema.
Properties
FailureReason
Gets the failure reason if resolution failed.
public string? FailureReason { get; }
Property Value
IsSuccess
Gets a value indicating whether the resolution was successful.
public bool IsSuccess { get; }
Property Value
MessageType
Gets the resolved .NET type.
public Type MessageType { get; }
Property Value
- Type
The .NET type to deserialize to.
MessageTypeName
Gets the message type name from the JSON Schema title property.
public string MessageTypeName { get; }
Property Value
- string
The message type name (e.g., "OrderCreated").
SchemaId
Gets the Schema Registry ID.
public int SchemaId { get; }
Property Value
- int
The schema ID from the wire format header.
SchemaJson
Gets the JSON Schema content from the Schema Registry.
public string SchemaJson { get; }
Property Value
- string
The raw JSON Schema string.
Methods
Failed(int, string?, string)
Creates a failed resolution result.
public static SchemaTypeResolution Failed(int schemaId, string? schemaJson, string reason)
Parameters
schemaIdintThe schema ID that failed to resolve.
schemaJsonstringThe JSON Schema content (if available).
reasonstringThe reason for failure.
Returns
- SchemaTypeResolution
A failed resolution instance.
Success(int, Type, string, string)
Creates a successful type resolution.
public static SchemaTypeResolution Success(int schemaId, Type messageType, string messageTypeName, string schemaJson)
Parameters
schemaIdintThe Schema Registry ID.
messageTypeTypeThe resolved .NET type.
messageTypeNamestringThe message type name from the schema.
schemaJsonstringThe JSON Schema content.
Returns
- SchemaTypeResolution
A successful resolution instance.