The current java-sdk API makes this a tad brittle, but the approach works for me:
val mapper = ObjectMapper()
// Configure the mapper just like the JacksonJsonPayloadConverter() constructor would
mapper.configure(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS, false)
mapper.registerModule(JavaTimeModule())
mapper.setVisibility(PropertyAccessor.FIELD, JsonAutoDetect.Visibility.ANY)
// Now add Kotlin support
mapper.registerModule(KotlinModule())
// And build the exact same thing as DefaultDataConverter::defaultDataConverterInstance
val converter = new DefaultDataConverter(
NullPayloadConverter(),
ByteArrayPayloadConverter(),
ProtobufJsonPayloadConverter(),
JacksonJsonPayloadConverter(mapper))
// Now create a workflow client options with it, and move along as before!
val workflowClientOptions = WorkflowClientOptions.newBuilder()
.setDataConverter(converter)
.build();