Skip to content

fix(lapis): upgrade to Spring boot 4#1719

Merged
fengelniederhammer merged 17 commits into
mainfrom
1476-update-to-spring-boot-4
Jun 10, 2026
Merged

fix(lapis): upgrade to Spring boot 4#1719
fengelniederhammer merged 17 commits into
mainfrom
1476-update-to-spring-boot-4

Conversation

@fengelniederhammer

@fengelniederhammer fengelniederhammer commented Jun 3, 2026

Copy link
Copy Markdown
Contributor

resolves #1476

Summary

Spring Boot 3.5.6 → 4.0.6, Jackson 2 → 3, springdoc 2 → 3.

com.fasterxml.jackson.module:jackson-module-kotlin kept alongside Jackson 3 — springdoc/swagger-core is still on Jackson 2 and needs it for Kotlin nullability detection (required fields in OpenAPI spec). Without it, all schema properties become optional. See springdoc#3172, blocked on swagger-core#4991. Can be removed once swagger-core migrates to Jackson 3.

CompressionAwareMappingJackson2HttpMessageConverter deleted — Boot 4 places custom @Component converter beans before defaults, which caused String responses (OpenAPI JSON, Newick) to be double-encoded. Instead of fighting converter ordering, phyloSubtree now writes directly to response.outputStream (like every other endpoint). Content-Encoding for compressed error responses moved to ExceptionHandler. Compression media types registered on JacksonJsonHttpMessageConverter via configureMessageConverters so error responses can serialize through the forced content type.

Custom JsonMapper.Builder bean — Jackson 3's StreamReadConstraints are immutable on JsonFactory, so they must be set at construction time. No JsonMapperBuilderCustomizer hook exists for this. The bean calls all customizers manually to preserve Boot's default Jackson config.

ProblemDetail.type omitted in some cases — Spring Framework 7 no longer defaults it; Jackson 3 omits null URI fields. This occurs in some error cases. Strictly speaking, this is breaking, but IMO this is fine.

PR Checklist

- [ ] All necessary documentation has been adapted.
- [ ] All necessary changes are explained in the llms.txt.

  • The implemented feature is covered by an appropriate test.

@vercel

vercel Bot commented Jun 3, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
lapis Ready Ready Preview, Comment Jun 9, 2026 9:14am

Request Review

Copilot AI 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.

Pull request overview

Upgrades the LAPIS service to Spring Boot 4 / Spring Framework 7 and aligns the codebase with the updated Jackson/Spring APIs, including adapting custom (de)serialization, MVC test setup, and various response/streaming paths.

Changes:

  • Upgrade to Spring Boot 4.0.6 and update related dependencies (Spring Security OAuth2, springdoc).
  • Migrate Jackson usage to the tools.jackson.* namespace and update custom serializers/deserializers + object mappers accordingly.
  • Update MVC tests and web layer configuration (MockMvc autoconfig import changes, Swagger/OpenAPI YAML parsing updates, compression/error response handling).

Reviewed changes

Copilot reviewed 78 out of 78 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
lapis/build.gradle Boot 4 + dependency upgrades
lapis/src/main/kotlin/org/genspectrum/lapis/LapisSpringConfig.kt Json mapper configuration update
lapis/src/main/kotlin/org/genspectrum/lapis/OAuthConfig.kt OAuth2 properties package move
lapis/src/main/kotlin/org/genspectrum/lapis/CorsConfiguration.kt Register compression media types
lapis/src/main/kotlin/org/genspectrum/lapis/auth/DataOpennessAuthorizationFilter.kt Jackson import migration
lapis/src/main/kotlin/org/genspectrum/lapis/config/ReferenceGenome.kt Jackson import migration
lapis/src/main/kotlin/org/genspectrum/lapis/controller/ExceptionHandler.kt Error handling + compression
lapis/src/main/kotlin/org/genspectrum/lapis/controller/LapisController.kt Newick streaming behavior
lapis/src/main/kotlin/org/genspectrum/lapis/controller/QueriesOverTimeController.kt Data-version header nullability
lapis/src/main/kotlin/org/genspectrum/lapis/controller/QueryController.kt Data-version header nullability
lapis/src/main/kotlin/org/genspectrum/lapis/controller/middleware/CompressionFilter.kt Converter/content-length adjustments
lapis/src/main/kotlin/org/genspectrum/lapis/controller/middleware/DataFormatParameterFilter.kt Jackson import migration
lapis/src/main/kotlin/org/genspectrum/lapis/controller/middleware/DownloadAsFileFilter.kt Jackson import migration
lapis/src/main/kotlin/org/genspectrum/lapis/controller/middleware/JacksonFormHttpMessageConverter.kt Jackson import migration
lapis/src/main/kotlin/org/genspectrum/lapis/controller/middleware/YamlHttpMessageConverter.kt Spring converter API update
lapis/src/main/kotlin/org/genspectrum/lapis/health/SiloHealthIndicator.kt Actuator API/package changes
lapis/src/main/kotlin/org/genspectrum/lapis/logging/RequestContext.kt Jackson exception type update
lapis/src/main/kotlin/org/genspectrum/lapis/logging/StatisticsLogObjectMapper.kt JsonMapper builder migration
lapis/src/main/kotlin/org/genspectrum/lapis/model/FastaHeaderTemplate.kt StringNode migration
lapis/src/main/kotlin/org/genspectrum/lapis/openApi/OpenApiDocs.kt OAuth2 props import move
lapis/src/main/kotlin/org/genspectrum/lapis/openApi/Schemas.kt Explicit schema for Newick
lapis/src/main/kotlin/org/genspectrum/lapis/request/AminoAcidInsertion.kt Deserializer API migration
lapis/src/main/kotlin/org/genspectrum/lapis/request/AminoAcidMutation.kt Deserializer API migration
lapis/src/main/kotlin/org/genspectrum/lapis/request/CommonSequenceFilters.kt Parsing via DeserializationContext
lapis/src/main/kotlin/org/genspectrum/lapis/request/MutationProportionsRequest.kt Deserializer API migration
lapis/src/main/kotlin/org/genspectrum/lapis/request/NucleotideInsertion.kt Deserializer API migration
lapis/src/main/kotlin/org/genspectrum/lapis/request/NucleotideMutation.kt Deserializer API migration
lapis/src/main/kotlin/org/genspectrum/lapis/request/OrderByField.kt Deserializer API migration
lapis/src/main/kotlin/org/genspectrum/lapis/request/PhyloTreeSequenceFiltersRequest.kt Deserializer API migration
lapis/src/main/kotlin/org/genspectrum/lapis/request/QueriesOverTimeRequest.kt Deserializer API migration
lapis/src/main/kotlin/org/genspectrum/lapis/request/SequenceFiltersRequest.kt Deserializer API migration
lapis/src/main/kotlin/org/genspectrum/lapis/request/SequenceFiltersRequestWithFields.kt Deserializer API migration
lapis/src/main/kotlin/org/genspectrum/lapis/request/SequenceFiltersRequestWithGenes.kt Deserializer API migration
lapis/src/main/kotlin/org/genspectrum/lapis/request/SequenceFiltersRequestWithSegments.kt Deserializer API migration
lapis/src/main/kotlin/org/genspectrum/lapis/request/SpecialProperties.kt JsonNodeType import migration
lapis/src/main/kotlin/org/genspectrum/lapis/response/LapisResponseStreamer.kt Jackson generator API changes
lapis/src/main/kotlin/org/genspectrum/lapis/response/ResponseCollections.kt Jackson import migration
lapis/src/main/kotlin/org/genspectrum/lapis/response/SequencesStreamer.kt Jackson import migration
lapis/src/main/kotlin/org/genspectrum/lapis/response/SiloResponse.kt Serializer API migration
lapis/src/main/kotlin/org/genspectrum/lapis/silo/ArrowRowConverter.kt StringNode migration
lapis/src/main/kotlin/org/genspectrum/lapis/silo/SiloClient.kt Jackson import migration
lapis/src/main/kotlin/org/genspectrum/lapis/silo/SiloQuery.kt Serializer API migration
lapis/src/main/kotlin/org/genspectrum/lapis/util/CachedBodyHttpServletRequest.kt Array node iteration update
lapis/src/main/kotlin/org/genspectrum/lapis/util/TryToGuessTheType.kt StringNode migration
lapis/src/main/kotlin/org/genspectrum/lapis/util/YamlObjectMapper.kt YAMLMapper builder migration
lapis/src/test/kotlin/org/genspectrum/lapis/SwaggerUiTest.kt YAML parsing + MockMvc import
lapis/src/test/kotlin/org/genspectrum/lapis/SwaggerUiTest.kt YAMLMapper in tests
lapis/src/test/kotlin/org/genspectrum/lapis/controller/ExceptionHandlerTest.kt MockMvc import migration
lapis/src/test/kotlin/org/genspectrum/lapis/controller/InfoControllerTest.kt MockMvc import migration
lapis/src/test/kotlin/org/genspectrum/lapis/controller/LandingPageControllerTest.kt MockMvc import migration
lapis/src/test/kotlin/org/genspectrum/lapis/controller/LapisControllerCommonFieldsTest.kt StringNode + MockMvc import
lapis/src/test/kotlin/org/genspectrum/lapis/controller/LapisControllerCompressionTest.kt MockMvc import migration
lapis/src/test/kotlin/org/genspectrum/lapis/controller/LapisControllerDataFormatTest.kt StringNode + MockMvc import
lapis/src/test/kotlin/org/genspectrum/lapis/controller/LapisControllerDownloadAsFileTest.kt MockMvc import migration
lapis/src/test/kotlin/org/genspectrum/lapis/controller/LapisControllerFastaHeaderTemplateTest.kt StringNode + MockMvc import
lapis/src/test/kotlin/org/genspectrum/lapis/controller/LapisControllerPhyloTreeTest.kt MockMvc import migration
lapis/src/test/kotlin/org/genspectrum/lapis/controller/LapisControllerTest.kt StringNode + request JSON fix
lapis/src/test/kotlin/org/genspectrum/lapis/controller/MockData.kt StringNode migration
lapis/src/test/kotlin/org/genspectrum/lapis/controller/MultiSegmentedSequenceControllerTest.kt MockMvc import migration
lapis/src/test/kotlin/org/genspectrum/lapis/controller/OAuthTest.kt WWW-Authenticate assertion loosen
lapis/src/test/kotlin/org/genspectrum/lapis/controller/QueriesOverTimeControllerTest.kt ObjectMapper + MockMvc import
lapis/src/test/kotlin/org/genspectrum/lapis/controller/QueryControllerTest.kt MockMvc import migration
lapis/src/test/kotlin/org/genspectrum/lapis/controller/SingleSegmentedSequenceControllerTest.kt MockMvc import migration
lapis/src/test/kotlin/org/genspectrum/lapis/logging/RequestContextLoggerTest.kt JSON field order update
lapis/src/test/kotlin/org/genspectrum/lapis/model/FastaHeaderTemplateTest.kt StringNode migration
lapis/src/test/kotlin/org/genspectrum/lapis/model/mutationsOverTime/AminoAcidMutationsOverTimeModelTest.kt StringNode migration
lapis/src/test/kotlin/org/genspectrum/lapis/model/mutationsOverTime/NucleotideMutationsOverTimeModelTest.kt StringNode migration
lapis/src/test/kotlin/org/genspectrum/lapis/model/mutationsOverTime/QueriesOverTimeModelTest.kt StringNode migration
lapis/src/test/kotlin/org/genspectrum/lapis/request/AminoAcidInsertionTest.kt ObjectMapper import migration
lapis/src/test/kotlin/org/genspectrum/lapis/request/AminoAcidMutationTest.kt ObjectMapper import migration
lapis/src/test/kotlin/org/genspectrum/lapis/request/MutationProportionsRequestTest.kt ObjectMapper import migration
lapis/src/test/kotlin/org/genspectrum/lapis/request/NucleotideInsertionTest.kt ObjectMapper import migration
lapis/src/test/kotlin/org/genspectrum/lapis/request/NucleotideMutationTest.kt ObjectMapper import migration
lapis/src/test/kotlin/org/genspectrum/lapis/request/OrderBySpecDeserializerTest.kt ObjectMapper import migration
lapis/src/test/kotlin/org/genspectrum/lapis/request/SequenceFiltersRequestWithFieldsTest.kt ObjectMapper/readValue migration
lapis/src/test/kotlin/org/genspectrum/lapis/response/MutationResponseTest.kt ObjectMapper import migration
lapis/src/test/kotlin/org/genspectrum/lapis/silo/SiloClientTest.kt StringNode migration
lapis/src/test/kotlin/org/genspectrum/lapis/silo/SiloQueryTest.kt ObjectMapper import migration
lapis/src/test/kotlin/org/genspectrum/lapis/util/TryToGuessTheTypeKtTest.kt StringNode migration

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copilot AI 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.

Pull request overview

Copilot reviewed 81 out of 81 changed files in this pull request and generated 8 comments.

Comment thread lapis/src/main/kotlin/org/genspectrum/lapis/CorsConfiguration.kt
Comment thread lapis/src/main/kotlin/org/genspectrum/lapis/response/LapisResponseStreamer.kt Outdated
Comment thread lapis/src/main/kotlin/org/genspectrum/lapis/response/LapisResponseStreamer.kt Outdated
Comment thread lapis/src/main/kotlin/org/genspectrum/lapis/response/SequencesStreamer.kt Outdated
Comment thread lapis/src/main/kotlin/org/genspectrum/lapis/controller/QueryController.kt Outdated
@fengelniederhammer fengelniederhammer changed the title chore(lapis): upgrade to Spring boot 4 fix(lapis): upgrade to Spring boot 4 Jun 9, 2026

Copilot AI 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.

Pull request overview

Copilot reviewed 82 out of 82 changed files in this pull request and generated 4 comments.

Comment thread lapis/src/main/kotlin/org/genspectrum/lapis/CorsConfiguration.kt
@fengelniederhammer fengelniederhammer marked this pull request as ready for review June 9, 2026 09:26

@fhennig fhennig 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.

LGTM!

@fengelniederhammer fengelniederhammer merged commit 013129f into main Jun 10, 2026
14 checks passed
@fengelniederhammer fengelniederhammer deleted the 1476-update-to-spring-boot-4 branch June 10, 2026 06:02
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.

Update to Spring Boot 4

3 participants