Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't invoke a Lambda function that takes an int as a parameter with dotnet lambda invoke-function #1197

Closed
bjhogan opened this issue Jun 9, 2022 · 4 comments
Assignees
Labels
bug This issue is a bug. module/lambda-client-lib p2 This is a standard priority issue queued

Comments

@bjhogan
Copy link
Contributor

bjhogan commented Jun 9, 2022

Describe the bug

There doesn't seem to be a way to invoke a Lambda function using dotnet lambda invoke-function when the parameter to the function is an int.

Create a new Lambda function -

dotnet new lambda.EmptyFunction --name TakesANumber

Change the FunctionHandler to -

public string FunctionHandler(int input, ILambdaContext context)
{
    return $"you sent {input}";
}

Can't find a way to invoke this function using dotnet lambda invoke-function --payload ...

Have tried payloads with a variety of quotes, decimal places, etc.

Expected Behavior

Ability to invoke a function with a int payload.

Current Behavior

Cannot invoke function with an int payload.

Reproduction Steps

See description.

Possible Solution

No response

Additional Information/Context

No response

AWS .NET SDK and/or Package version used

Amazon Lambda Tools for .NET Core applications (5.4.2)

Targeted .NET Platform

.NET 6

Operating System and version

Windows 10

@bjhogan bjhogan added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Jun 9, 2022
@ashishdhingra
Copy link
Contributor

Reproducible. Sending just 12 (for example) via AWS Lambda console works.

@ashishdhingra ashishdhingra added needs-review and removed needs-triage This issue or PR still needs to be triaged. labels Jun 10, 2022
@bjhogan bjhogan changed the title Can't invoke a Lambda function that takes an int as a parameters with dotnet lambda invoke-function Can't invoke a Lambda function that takes an int as a parameter with dotnet lambda invoke-function Jun 13, 2022
@ashishdhingra ashishdhingra added queued p2 This is a standard priority issue and removed B labels Nov 2, 2022
@ashishdhingra ashishdhingra self-assigned this Oct 30, 2024
@ashishdhingra
Copy link
Contributor

ashishdhingra commented Oct 30, 2024

We need to implement fix similar to one in PR #1851.

EDIT: We copy .NET Extensions CLI tooling code in AWS Visual Studio Toolkit. VS Toolkit is targeting .NET Framework and hence it would not have System.Text.Json. So we should use the logic implemented in VS Toolkit, in .NET Extensions for CLI.

@ashishdhingra
Copy link
Contributor

Fix released in Amazon.Lambda.Tools 5.11.1

Copy link
Contributor

github-actions bot commented Nov 6, 2024

Comments on closed issues are hard for our team to see.
If you need more assistance, please either tag a team member or 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue is a bug. module/lambda-client-lib p2 This is a standard priority issue queued
Projects
None yet
Development

No branches or pull requests

2 participants