Skip to content

Conversation

@quaff
Copy link
Contributor

@quaff quaff commented Dec 31, 2025

Closes GH-5191

@quaff quaff force-pushed the patch-46 branch 2 times, most recently from 2a5646a to 0bb92d5 Compare December 31, 2025 06:48
this.jsonMapper = JsonMapper.builder().activateDefaultTyping(polymorphicTypeValidator).build();
this.jsonMapper = JsonMapper.builder()
.activateDefaultTyping(polymorphicTypeValidator)
.addMixIns(Map.of(JobParameters.class, JobParametersMixIn.class))

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As long as now JobParametersMixIn is added, I would recommend adjusting also constructor taking JsonMapper:

  1. Replace JsonMapper parameter with JsonMapper.Builder
  2. Add the same builder.addMixIns(Map.of(JobParameters.class, JobParametersMixIn.class))

This way, client would configure JsonMapper via JsonMapper.Builder, pass it to JacksonExecutionContextStringSerializer(JsonMapper.Builder jsonMapperBuilder) and then the mixing would be added for consistency.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

JobStep Jackson2ExecutionContextStringSerializer error in Spring Batch 6.x

2 participants