Stop overriding ObjectMapper naming strategy in Lambda recorder#53116
Open
tiwari91 wants to merge 1 commit intoquarkusio:mainfrom
Open
Stop overriding ObjectMapper naming strategy in Lambda recorder#53116tiwari91 wants to merge 1 commit intoquarkusio:mainfrom
tiwari91 wants to merge 1 commit intoquarkusio:mainfrom
Conversation
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.
Fixes: #52985
AmazonLambdaMapperRecorder.initObjectMapper()unconditionally called.setPropertyNamingStrategy(PropertyNamingStrategies.LOWER_CAMEL_CASE)on the ObjectMapper used by the Lambda runtime. This silently overrode any application-configured naming strategy (e.g.,SNAKE_CASEorKEBAB_CASE), breaking serialization consistency for user DTOs.Changes
.setPropertyNamingStrategy(LOWER_CAMEL_CASE)call frominitObjectMapper(), so the application's configured naming strategy is preserved.@JsonNaming(PropertyNamingStrategies.LowerCamelCaseStrategy.class)toFunctionError, the only internal runtime class serialized by this mapper that lacks explicit@JsonProperty/@JsonGetterannotations. This ensures error reports to the Lambda runtime always use the expectederrorType/errorMessagefield names regardless of the application's naming strategy.ObjectMapperNamingStrategyTestverifying thatFunctionErroralways serializes as camelCase even with aSNAKE_CASEmapper, and that user DTOs respect their configured naming strategy.Why other internal classes don't need changes
ClientContextImplandClientImplalready have explicit@JsonGetter/@JsonSetterannotations with hardcoded field names.CognitoIdentity(AWS SDK interface) getter names produce camelCase by default, matching the AWS JSON format.