Skip to content

[Java][Spring] Use the Jackson 3 JsonNullable module with useJackson3 - #25151

Merged
wing328 merged 1 commit into
OpenAPITools:masterfrom
Sekator778:fix/spring-jackson3-jsonnullable-bean
Oct 7, 2026
Merged

wing328 merged 1 commit into
OpenAPITools:masterfrom
Sekator778:fix/spring-jackson3-jsonnullable-bean

Conversation

@Sekator778

@Sekator778 Sekator778 commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

With useSpringBoot4 and useJackson3 the application class still declares the JsonNullable bean as a Jackson 2 Module. When nothing else brings Jackson 2 in (documentationProvider=none, annotationLibrary=none) the generated project doesn't compile. With useJackson3 it's now a JacksonModule returning JsonNullableJackson3Module.

@cachescrubber @welshm @MelleD @atextor @manedev79 @javisst @borsch @banlevente @Zomzog @martin-mfg @KannaKim

PR checklist

  • Read the contribution guidelines.
  • Run the following to build the project and update samples:
    ./mvnw clean package || exit
    ./bin/generate-samples.sh ./bin/configs/*.yaml || exit
    ./bin/utils/export_docs_generators.sh || exit
    
    (For Windows users, please run the script in WSL)
    Commit all changed files.
    This is important, as CI jobs will verify all generator outputs of your HEAD commit as it would merge with master.
    These must match the expectations made by your contribution.
    You may regenerate an individual generator by passing the relevant config(s) as an argument to the script, for example ./bin/generate-samples.sh bin/configs/java*.
    IMPORTANT: Do NOT purge/delete any folders/files (e.g. tests) when regenerating the samples as manually written tests may be removed.
  • If your PR is targeting a particular programming language, @mention the technical committee members, so they are more likely to review the pull request.

Summary by cubic

Fixes the generated Spring Boot application so the JsonNullable bean matches the configured Jackson version, preventing compilation failures when Jackson 3 is enabled and Jackson 2 is not on the classpath.

Bug Fixes

  • With useSpringBoot4 and useJackson3, the JsonNullable bean is now a JacksonModule returning JsonNullableJackson3Module instead of a Jackson 2 Module.
  • Projects without useJackson3 keep the Jackson 2 JsonNullableModule bean.

Written for commit 8cb0476. Summary will update on new commits.

Review in cubic

The application class declared the jsonNullableModule bean as a Jackson 2
Module even with useJackson3, which does not compile when nothing else
brings Jackson 2 onto the classpath. With useJackson3 it is now a
JacksonModule returning JsonNullableJackson3Module.

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

No issues found across 2 files

Re-trigger cubic

@wing328
wing328 merged commit efcc97f into OpenAPITools:master Oct 7, 2026
15 checks passed
@wing328 wing328 added this to the 7.27.0 milestone Oct 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants