Skip to content

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

Merged
normj merged 7 commits intoaws:developmentfrom
aanton-git:aanton-propertyConvectorPrecedence
Mar 19, 2026
Merged

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

Conversation

@aanton-git
Copy link
Copy Markdown
Contributor

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
Copy Markdown
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
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Updated

@normj
Copy link
Copy Markdown
Member

normj commented Mar 18, 2026

Sent branch into internal validation build. Assuming it passes then I'll approve the PR.

Copy link
Copy Markdown
Member

@normj normj left a comment

Choose a reason for hiding this comment

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

Dry run f6febb1d-c996-4615-95bd-93d0770141a7 was successful

@normj normj merged commit 13fcbf7 into aws:development Mar 19, 2026
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.

4 participants