Skip to content

Fix DynamoDB property converter precedence when a global converter is…#4323

Open
aanton-git wants to merge 7 commits intoaws:developmentfrom
aanton-git:aanton-propertyConvectorPrecedence
Open

Fix DynamoDB property converter precedence when a global converter is…#4323
aanton-git wants to merge 7 commits intoaws:developmentfrom
aanton-git:aanton-propertyConvectorPrecedence

Conversation

@aanton-git
Copy link

Description

There is a bug in the AWS .NET SDK’s DynamoDB object persistence model where property-specific converters (defined via the DynamoDBProperty(Converter = …) attribute) are ignored if a global converter is already registered in the DynamoDBContext.ConverterCache. The global converter takes precedence even when a property has its own converter defined, which is unexpected behavior and contrary to how attribute-based converters should work. ([https://github.com//issues/4036][1])

Motivation and Context

Current Behavior
When using:

Expected Behavior
Property-specific converters should take precedence over globally registered converters. That is:

  1. If a property has a converter attribute defined, use that.
  2. Otherwise, fall back to a global converter from the converter cache. ([GitHub][1])

Testing

Breaking Changes Assessment

  1. Identify all breaking changes including the following details:

Screenshots (if appropriate)

Types of changes

  • [ x] Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist

  • My code follows the code style of this project
  • My change requires a change to the documentation
  • I have updated the documentation accordingly
  • I have read the README document
  • [x ] I have added tests to cover my changes
  • [ x] All new and existing tests passed

License

  • I confirm that this pull request can be released under the Apache 2 license

@aanton-git aanton-git marked this pull request as ready for review February 11, 2026 09:47
"serviceName": "DynamoDBv2",
"type": "patch",
"changeLogMessages": [
"Fix DynamoDB property converter precedence when a global converter is registered."
Copy link
Member

Choose a reason for hiding this comment

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

There is the small possibility users possibly unintentionally depended on the current behavior. I think making the fix is the right choice but for transparency can you add [Breaking Change] as a prefix to the log message.

Copy link
Author

Choose a reason for hiding this comment

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

Updated

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.

3 participants