Skip to content

Support different naming strategies for DynamoDB attributes in enhanced client #5765

Open
@yattoni

Description

Describe the feature

My understanding is, by default, the enhanced DynamoDb client will assume your attributes are named like your variables which happen to be camel case. If you want your createdAt field to be stored with attribute name created_at you either have to use an annotation to overwrite this field individually or use the TableSchema builder to explicitly define all your fields attribute names.

I’d prefer something like Jackson where you can set the naming strategy to be camel case, upper camel case, snake case, kebab case, etc.

Use Case

This would be useful as I don’t think there is a standard for attribute name style and the AWS blog / docs are also inconsistent (but consistent within an example), but the sdk forces you into something if you don’t want to write more annotations.

Proposed Solution

The TableSchema.fromClass or fromBean method accepts configuration for what naming strategy to use, similar to configuring Jackson’s ObjectMapper.

Other Information

No response

Acknowledgements

  • I may be able to implement this feature request
  • This feature might incur a breaking change

AWS Java SDK version used

Latest

JDK version used

17

Operating System and version

macOS

Metadata

Assignees

No one assigned

    Labels

    dynamodb-enhancedfeature-requestA feature should be added or improved.p3This is a minor priority issue

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions