Interface SchemaParser<S,U>


public interface SchemaParser<S,U>
Author:
Fabian Martinez
  • Method Details

    • artifactType

      String artifactType()
    • parseSchema

      S parseSchema(byte[] rawSchema, Map<String,ParsedSchema<S>> resolvedReferences)
    • getSchemaFromData

      ParsedSchema<S> getSchemaFromData(Record<U> data)
      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 custom Record implementation that adds additional fields that allows to build a ParsedSchema
      Parameters:
      data -
      Returns:
      the ParsedSchema, containing both the raw schema (bytes) and the parsed schema. Can be null.
    • getSchemaFromData

      ParsedSchema<S> getSchemaFromData(Record<U> data, boolean dereference)
      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 custom Record implementation that adds additional fields that allows to build a ParsedSchema
      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

      default ParsedSchema<S> getSchemaFromLocation(String location)
      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 if getSchemaFromData(Record) is implemented or not.
    • supportsGetSchemaFromLocation

      default boolean supportsGetSchemaFromLocation()
      Flag that indicates if getSchemaFromLocation(String) is implemented or not.