Package io.apicurio.registry.resolver
Interface SchemaParser<S,U>
public interface SchemaParser<S,U>
- Author:
- Fabian Martinez
-
Method Summary
Modifier and TypeMethodDescriptiongetSchemaFromData(Record<U> data) In some artifact types, such as AVRO, it is possible to extract the schema from the java object.getSchemaFromData(Record<U> data, boolean dereference) In some artifact types, such as AVRO, it is possible to extract the schema from the java object.default ParsedSchema<S>getSchemaFromLocation(String location) In some artifact types, such as Json, we allow defining a local place for the schema.parseSchema(byte[] rawSchema, Map<String, ParsedSchema<S>> resolvedReferences) default booleanFlag that indicates ifgetSchemaFromData(Record)is implemented or not.default booleanFlag that indicates ifgetSchemaFromLocation(String)is implemented or not.
-
Method Details
-
artifactType
String artifactType() -
parseSchema
-
getSchemaFromData
In some artifact types, such as AVRO, it is possible to extract the schema from the java object. But this can be easily extended to other formats by using a customRecordimplementation that adds additional fields that allows to build aParsedSchema- Parameters:
data-- Returns:
- the ParsedSchema, containing both the raw schema (bytes) and the parsed schema. Can be null.
-
getSchemaFromData
In some artifact types, such as AVRO, it is possible to extract the schema from the java object. But this can be easily extended to other formats by using a customRecordimplementation that adds additional fields that allows to build aParsedSchema- Parameters:
data-dereference- indicate the schema parser whether to try to dereference the record schema.- Returns:
- the ParsedSchema, containing both the raw schema (bytes) and the parsed schema. Can be null.
-
getSchemaFromLocation
In some artifact types, such as Json, we allow defining a local place for the schema.- Parameters:
location- the schema location- Returns:
- the ParsedSchema, containing both the raw schema (bytes) and the parsed schema. Can be null.
-
supportsExtractSchemaFromData
default boolean supportsExtractSchemaFromData()Flag that indicates ifgetSchemaFromData(Record)is implemented or not. -
supportsGetSchemaFromLocation
default boolean supportsGetSchemaFromLocation()Flag that indicates ifgetSchemaFromLocation(String)is implemented or not.
-