Interface IParsedSchema<S>
- Namespace
- Solace.SchemaRegistry.Serdes.Core.Resolver
- Assembly
- Solace.SchemaRegistry.Serdes.Core.dll
Represents a parsed schema that contains both the strongly-typed schema object and the original raw schema bytes. This interface provides access to both the processed schema for runtime operations and the raw bytes for storage or transmission.
public interface IParsedSchema<out S>
Type Parameters
SThe type of the parsed schema object (e.g., Avro.Schema, JsonSchema)
Remarks
IParsedSchema serves as a container that bridges the gap between raw schema storage and runtime schema usage. It maintains both the original byte representation and the parsed, strongly-typed schema object to support different operational needs.
The parsed schema object is used for validation, serialization, and deserialization operations, while the raw schema bytes are useful for caching, transmission, and storage scenarios where the original format needs to be preserved.
Properties
RawSchema
Gets the original raw schema bytes as they were stored or received.
byte[] RawSchema { get; }
Property Value
- byte[]
A byte array containing the schema representation in its native format. This may be the same bytes that were passed to the schema parser, or processed bytes depending on the parser implementation.
Remarks
The raw schema bytes represent the schema in its native format as processed by the parser implementation. These bytes are useful for scenarios such as caching, network transmission, or storage operations.
The raw schema should be treated as immutable. Modifications to the returned byte array may not be reflected in the parsed schema object and could lead to inconsistent state.
Schema
Gets the strongly-typed schema object that has been parsed from the raw schema bytes.
S Schema { get; }
Property Value
- S
The parsed schema object of type S that can be used for validation, serialization, and deserialization operations. The specific type depends on the schema format (e.g., Avro.Schema for AVRO schemas, JsonSchema for JSON schemas).
Remarks
This property provides access to the processed schema object that has been validated and is ready for use in runtime operations. The schema object contains the parsed structure, type information, and metadata needed for data processing.
The schema object should be immutable to ensure thread safety and prevent accidental modifications that could affect ongoing serialization operations.