-
Notifications
You must be signed in to change notification settings - Fork 647
Closed
Labels
feature-requestNew feature or enhancement. May require GitHub community feedback.New feature or enhancement. May require GitHub community feedback.
Description
Describe the bug
marshall from @aws-sdk/util-dynamodb only accepts data in the form of
{
[key: string]: NativeAttributeValue;
}
This narrow typing prevents you from using marshall with:
- typescript
interfaces. If you use a typescripttypeit works. - arrays. The underlying
convertToAttrproperly supports this, so why not expose it up?
The v2 sdk's DocumentClient handled both of these cases, so I'm guessing marshall should do the same if parity is a factor.
SDK version number
1.0.0-rc.2
Is the issue in the browser/Node.js/ReactNative?
Node.js
Details of the browser/Node.js/ReactNative version
12
To Reproduce (observed behavior)
interface MyType = {
foo: string;
nested: {
baz: string;
};
};
const mySimpleObject: MyType = {
foo: "foo",
nested: {
baz: "baz",
},
};
const x = marshall(mySimpleObject);
^^^^ Argument of type 'MyType' is not assignable to parameter of type '{ [key: string]: NativeAttributeValue; }'.
Index signature is missing in type 'MyType'.ts(2345)
Expected behavior
I should be able to pass in interface types into marshall. I should be able to also pass in []s.
Screenshots
If applicable, add screenshots to help explain your problem.
Additional context
Metadata
Metadata
Assignees
Labels
feature-requestNew feature or enhancement. May require GitHub community feedback.New feature or enhancement. May require GitHub community feedback.