Class ParsedSchema<S>
- Namespace
- Solace.SchemaRegistry.Serdes.Core.Resolver
- Assembly
- Solace.SchemaRegistry.Serdes.Core.dll
Default implementation of IParsedSchema<S> that contains a parsed schema and its raw byte representation.
public class ParsedSchema<S> : IParsedSchema<S>
Type Parameters
SThe type of the parsed schema object
- Inheritance
-
ParsedSchema<S>
- Implements
- Inherited Members
Constructors
ParsedSchema(byte[], S)
Initializes a new instance of the ParsedSchema<S> class.
public ParsedSchema(byte[] rawSchema, S schema)
Parameters
rawSchemabyte[]The raw schema bytes
schemaSThe parsed schema object
Properties
RawSchema
Gets the original raw schema bytes as they were stored or received.
public 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.
public 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.