Is there anyway to create an Avro schema(avsc file) which can generate java class similar to below.
Event class has to be created inside GenericEvent class.
@Data
public class GenericEvent {
private Integer version;
private List<Event> events;
@Data
private class Event {
private String id;
private String event_type;
}
}
It's not possible.
You could create nested record definitions in Avro IDL format, but when generating the Java classes, they'll be separate files (public Java classes), with one "outer class" file referencing the other