question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[aws-stepfunctions-tasks] In DynamoAttributeValue mapping methods are missing

See original GitHub issue

I 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:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:7 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
shivlakscommented, Aug 4, 2020

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 missing

0reactions
github-actions[bot]commented, Jun 18, 2022

This 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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

class DynamoAttributeValue · AWS CDK
Represents the data for the attribute. Data can be i.e. "S": "Hello". Methods. Name, Description. toObject ...
Read more >
aws-cdk/aws-stepfunctions-tasks module - AWS Documentation
AWS Step Functions is a web service that enables you to coordinate the components of distributed applications and microservices using visual workflows.
Read more >
Expected - Amazon DynamoDB - AWS Documentation
Expected is a map of attribute/condition pairs. Each element of the map consists of an attribute name, a comparison operator, and one or...
Read more >
DynamoDBMapper Class - Amazon DynamoDB
This class provides the following methods for working with DynamoDB. For the corresponding Javadoc documentation, see DynamoDBMapper in the AWS SDK for Java ......
Read more >
Update an item in a DynamoDB table using an AWS SDK
Update an item in a DynamoDB table using an AWS SDK. PDFRSS. The following code examples show how to update an item in...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found