[aws-stepfunctions-tasks] In DynamoAttributeValue mapping methods are missing
See original GitHub issueI need to produce the following dynamo put item mapping:
“SS.$”:“$.list”
I required something akin to the other mapping functions.
This is so that I can map input data store as a list of strings to a dynamo function.
There is an existing DynamoAttributeValue.fromStringSet but this is only for inserting static values.
We need to be able to map from input data: so
DynamoAttributeValue.stringSetFromJsonPath
(like the other json path methods).
This particular method would look like this:
public static stringSetFromJsonPath(value: string) {
validateJsonPath(value);
return new DynamoAttributeValue({ SS: value.toString() });
}
Though the reality is the following are still required (and there my be more like binary for example).
- listFromJsonPath
- numberSetFromJsonPath
So you don’t need stringFromJsonPath as you can just pass a string in as the mapping (and use fromString) but maybe we should have a stringFromJsonPath to make it more explicit.
What I would really like is a catch all method…
something like: fromJsonPath(<TYPE>, <JsonPath as a string>)
Instead of loads of different methods - this could maybe use an enum to specify the TYPE to ensure that invalid types are not passed in.
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:7 (5 by maintainers)
Top GitHub Comments
I think those 3 seem like a reasonable start. The generic method is something we considered but may not translate well across all languages. It’s the reason we went with specific methods in this static enum like class to generate the specific attribute that the user wants to leverage.
for now, let’s make the scope of this issue to add:
stringSetFromJsonPath
listFromJsonPath
numberSetFromJsonPath
and add any other
*fromJsonPath
methods that are missingThis issue has not received any attention in 1 year. If you want to keep this issue open, please leave a comment below and auto-close will be canceled.