Link from StackOverflow post: https://stackoverflow.com/a/56949526/945789
There is currently no way to use the current configuration of ObjectMapper in Jackson2ExecutionContextStringSerializer and also provide customisations without copying and pasting code. There was a fix for https://jira.spring.io/browse/BATCH-2680 which resulted in a private jackson module being created: JobParametersModule and being included in the default ObjectMapper setup, however we cannot get access to that if we would like to customise ObjectMapper features.
I'd like to be able to register additional modules, namely KotlinModule so I can use `data class` for objects stored in execution context without having to mark everything as an optional field. I have seen other posts where people would also like to customise objectMapper.
Ideally it would be nice to declaratively register additional ObjectMapper features for boot, or allow us to pass in a base ObjectMapper (the default configured one in boot for example) that can then be copied internally with customisations. If that's not so easy then making the objectMapper property protected to allow subclasses to reference would be nice, or even increasing the visibility of JobParametersModule.
Any help and suggestions greatly appreciated!