EfficientDynamoDb
EfficientDynamoDb copied to clipboard
JsonIReadOnlyListHintDdbConverter crashes when BufferLengthHint is not available
Hi,
I noticed problem during ToResponseAsync usage, JsonIReadOnlyListHintDdbConverter crashes during Items element deserialization
Code: context.Query<T> . . ToResponseAsync();
In JSON response Count element is after Items element, it causes that BufferLengthHint is 0 during deserialization. JsonIReadOnlyListHintDdbConverter is not prepared for this, it work with JsonListHintDdbConverter
Below patch with potential fix, please let me know if you accept such fix, I'll create PR
diff --git a/src/EfficientDynamoDb/Operations/Query/IterableResponse.cs b/src/EfficientDynamoDb/Operations/Query/IterableResponse.cs
--- a/src/EfficientDynamoDb/Operations/Query/IterableResponse.cs (revision 566695abf18e7fa324618d6f933814a4b6f03ae5)
+++ b/src/EfficientDynamoDb/Operations/Query/IterableResponse.cs (date 1661323032101)
@@ -75,7 +75,7 @@
/// <summary>
/// An array of item attributes that match the query criteria. Each element in this array consists of an attribute name and the value for that attribute.
/// </summary>
- [DynamoDbProperty("Items", typeof(JsonIReadOnlyListHintDdbConverter<>))]
+ [DynamoDbProperty("Items", typeof(JsonListHintDdbConverter<>))]
public IReadOnlyList<TEntity> Items { get; set; } = null!;
}
}