Support optional prefix for @DynamoDbFlatten fields #3695
Labels
dynamodb-enhanced
feature-request
A feature should be added or improved.
p3
This is a minor priority issue
Describe the feature
In order to provide better clarity to field names in Flattened
DynamoDdBean
s we need to be able to prefix field names with additional context. I propose adding an optionalString prefix
to theDynamoDbFlatten
annotation that would allow users to supply a prefix that would be appended to flatten field names in the parent object. Leaving the property unset would result in the current behavior of no prefixing in order to maintain backwards compatability.Use Case
I want to flatten multiple objects of the same type but with different meanings and not have their names conflict.
Proposed Solution
Extend the existing
FlattenedMapper
class to include an optional prefix that would be appended to each attribute when building the map of mappers.Other Information
Here is an example test written in Spock:
Acknowledgements
AWS Java SDK version used
2.19.17
JDK version used
openjdk version "1.8.0_352"
Operating System and version
macOS 12.6.1
The text was updated successfully, but these errors were encountered: