When using a mapped bean class having a Map attribute, creating or updating the map with a null value produces an invalid PutObjectRequest/UpdateObjectRequest
Describe the bug
Bean:
@DynamoDbBean
public static class Book {
private String id;
private Map<String, String> map;
public Book() { }
public Book(String id) { setId(id); }
@DynamoDbPartitionKey public String getId() {return id;}
public void setId(String id) {this.id = id;}
public Map<String, String> getMap() {return map;}
public void setMap(Map<String, String> map) {this.map = map;}
}
Use a DynamoDbTable<Book> to put an item:
Book b = new Book(id);
b.setMap(Collections.singletonMap("a", null));
TABLE.putItem(b);
fails with DynamoDbException: Supplied AttributeValue is empty.
The created PutObjectRequest is: PutItemRequest(TableName=books, Item={id=AttributeValue(S=id), map=AttributeValue(M={a=AttributeValue()})})
The AttributeValue of map.a is invalid.
The same process using low-level client works, using a null AttributeValue:
Comments on closed issues are hard for our team to see.
If you need more assistance, please open a new issue that references this one.
If you wish to keep having a conversation with other community members under this issue feel free to do so.
When using a mapped bean class having a Map attribute, creating or updating the map with a null value produces an invalid PutObjectRequest/UpdateObjectRequest
Describe the bug
Bean:
Use a
DynamoDbTable<Book>
to put an item:fails with
DynamoDbException: Supplied AttributeValue is empty
.The created PutObjectRequest is:
PutItemRequest(TableName=books, Item={id=AttributeValue(S=id), map=AttributeValue(M={a=AttributeValue()})})
The AttributeValue of
map.a
is invalid.The same process using low-level client works, using a null AttributeValue:
A similar behavior is present on update operations.
Expected Behavior
The enhanced request should be valid, having a null Attribute value.
tested on
The text was updated successfully, but these errors were encountered: