Annotation Type AvroSchema


@Retention(RUNTIME) @Target({TYPE,PARAMETER,METHOD,FIELD}) @Documented public @interface AvroSchema
Declares that a Java type should have a specified Avro schema, overriding the normally inferred schema. May be used for classes, parameters, fields and method return types.

This is useful for slight alterations to the schema that would be automatically inferred. For example, a List<Integer>whose elements may be null might use the annotation

 @AvroSchema("{\"type\":\"array\",\"items\":[\"null\",\"int\"]}")
 
since the Nullable annotation could not be used here.
  • Required Element Summary

    Required Elements
    Modifier and Type
    Required Element
    Description
    The schema to use for this value.
  • Element Details

    • value

      String value
      The schema to use for this value.