Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

implement DynamoDBDerivedTypeAttribute for polymorphism support #3633

Open
wants to merge 1 commit into
base: main-staging
Choose a base branch
from

Conversation

irina-herciu
Copy link
Contributor

implement DynamoDBDerivedTypeAttribute for polymorphism support that should solve Saving nested items with class hierarchies #2985

Description

New DynamoDB PropertyAttribute added as DynamoDBDerivedTypeAttribute in order to add support for polymorphic types serialization and deserialization
[DynamoDBDerivedType("B", typeof(B))]

Type Attribute name can be configurable from DerivedTypeAttributeName on DynamoDBContextConfig and by default uses "$type".

Motivation and Context

#2985

Testing

Integration tests added

Screenshots (if appropriate)

image

Types of changes

  • 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
  • I have added tests to cover my changes
  • All new and existing tests passed

License

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

@normj
Copy link
Member

normj commented Feb 4, 2025

@irina-herciu Can you make this change off of a branch based on v4-development? We have done a lot of work in V4 for supporting Native AOT with the DDB high level libraries and I want to make sure this feature doesn't break any of that work.

I'm also asking around other SDK's if they support nested polymorphic types. If there is a prior pattern we should considered that and I'm wondering what would be the cross SDK story for this. Meaning a type saved with the .NET libraries and then loaded from the Java DynamoDB mapper.

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.

2 participants