There is not an approach that works in general, but you can use a converter specific special configuration in the case of AVRO, and then you must also provide special hints via the enum field Schema properties. I was able to provide the hints using a custom Connect Transform.
Configure the Connect converter with:
"value.converter": "io.confluent.connect.avro.AvroConverter",
"value.converter.schema.registry.url": "http://registry:8081",
"value.converter.enhanced.avro.schema.support": true,
"value.converter.connect.meta.data": false,
"transforms": "alarms",
"transforms.alarms.type": "org.jlab.kafka.connect.transforms.EpicsToAlarm$Value"
Then the custom Transform contains:
final Schema prioritySchema = SchemaBuilder
.string()
.doc("Alarm severity organized as a way for operators to prioritize which alarms to take action on first")
.parameter("io.confluent.connect.avro.enum.doc.AlarmPriority", "Enumeration of possible alarm priorities")
.parameter("io.confluent.connect.avro.Enum", "org.jlab.kafka.alarms.AlarmPriority")
.parameter("io.confluent.connect.avro.Enum.1", "P1_LIFE")
.parameter("io.confluent.connect.avro.Enum.2", "P2_PROPERTY")
.parameter("io.confluent.connect.avro.Enum.3", "P3_PRODUCTIVITY")
.parameter("io.confluent.connect.avro.Enum.4", "P4_DIAGNOSTIC")
.build();
Full Transform Source