aws / aws/aws-sdk-java-v2

Support different naming strategies for DynamoDB attributes in enhanced client

Open
#5,765 3 comments 15 reactions 0 assignees View on GitHub
dynamodb-enhanced feature-request p3
Dominant language
Java
Stars
2.6k
Forks
1k
Avg merge
2d 9h
Merged PRs (30d)
51

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

- [X] 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

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.