I was able to figure out this as well... found a way to extract the nested schema for constructing the struct using - schema.field("<name>").schema()
Got stuck in further steps with the error below.. Any clue why AvroData is looking for SchemaBuilder.parameters that being optional..
java.lang.NullPointerException
at java.util.Collections$UnmodifiableMap.<init>(Collections.java:1446)
at java.util.Collections.unmodifiableMap(Collections.java:1433)
at org.apache.kafka.connect.data.SchemaBuilder.parameters(SchemaBuilder.java:184)
at io.confluent.connect.avro.AvroData.fromConnectSchema(AvroData.java:603)
at io.confluent.connect.avro.AvroData.addAvroRecordField(AvroData.java:651)
at io.confluent.connect.avro.AvroData.fromConnectSchema(AvroData.java:588)
at io.confluent.connect.avro.AvroData.addAvroRecordField(AvroData.java:651)
at io.confluent.connect.avro.AvroData.fromConnectSchema(AvroData.java:588)
at io.confluent.connect.avro.AvroData.addAvroRecordField(AvroData.java:651)
at io.confluent.connect.avro.AvroData.fromConnectSchema(AvroData.java:588)
at io.confluent.connect.avro.AvroData.fromConnectData(AvroData.java:266)
at io.confluent.connect.avro.AvroConverter.fromConnectData(AvroConverter.java:90)
at org.apache.kafka.connect.runtime.WorkerSourceTask.sendRecords(WorkerSourceTask.java:142)
at org.apache.kafka.connect.runtime.WorkerSourceTask.access$600(WorkerSourceTask.java:50)
at org.apache.kafka.connect.runtime.WorkerSourceTask$WorkerSourceTaskThread.execute(WorkerSourceTask.java:356)
at org.apache.kafka.connect.util.ShutdownableThread.run(ShutdownableThread.java:82)