fix(mdx-web): restore default message converters - #383
Open
stevecl5 wants to merge 1 commit into
Open
Conversation
stevecl5
requested review from
SandhyaBhatia,
gerfboy,
mattnichols,
meotch and
tessstoddard
as code owners
August 14, 2026 04:43
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary of Changes
Resolves an issue introduced during the Spring Boot 4 upgrade where default HTTP message converters (like
ByteArrayHttpMessageConverterandStringHttpMessageConverter) were dropped, causing endpoints like/actuator/prometheusto return a 500 Internal Server Error.Root Cause:
In Spring Boot 4, overriding
configureMessageConverterssignals to the framework that the application is taking complete manual control of serialization which causes Spring to discard all of its default converters. A newGsonHttpMessageConverterwas added back inMdxSerializationConfigurationto fix JSON serialization, but endpoints that return other media types (such astext/plain) were missing the necessary converters to render a response.The Fix:
MdxOnDemandSerializationWebMvcConfigurerto useextendMessageConvertersinstead ofconfigureMessageConverters. This allows Spring Boot to safely populate its default converters first, which we then filter to our strict whitelist.MdxSerializationConfigurationby removing theWebMvcConfigurerimplementation. Spring Boot will automatically detect our custom@Bean Gson gson()and natively bind it to its own default Gson converter under the hood.Fixes # https://mxcom.atlassian.net/browse/MC-15146
Public API Additions/Changes
N/A
Downstream Consumer Impact
application.ymlorapplication.properties).How Has This Been Tested?
I pulled a snapshot version of these changes into
path-connector-hancock-whitneyand verified the/actuator/prometheusendpoint is working as expected.Prometheus Response
Checklist: