Open irvanherz opened 1 year ago
Appears to be reproducible. Simple parameters are bound successfully. However, complex parameter is not bound (might be it should follow convention at https://learn.microsoft.com/en-us/aspnet/core/mvc/models/model-binding?view=aspnetcore-7.0#complex-types). It doesn't work after actual deployment as well.
Tested using:
{"message": "1 validation error(s) detected: Value {"x":"testX", "y":"testY"} at 'query' failed to satisfy constraint: Invalid cast from 'System.String' to 'LambdaAnnotationsTest.TestQueryParamsDto'."}
.query
property is null
in response.query
property is null
in response.Sample Code: LambdaAnnotationsTest.zip
Describe the bug
I created a REST API using lambda annotations. The FromBody works like charm, but I found that FromQuery annotation didn't work like expected. It gives me null value instead of object.
Expected Behavior
FromQuery should works like FromBody
Current Behavior
It doesn't work.
Reproduction Steps
I created a lambda function like below.
After I test it in lambda-test-tool, I get the query argument unexpectedly has null value instead of object. Same thing happen to published functions.
Sample function input for lambda test tool:
Possible Solution
No response
Additional Information/Context
No response
AWS .NET SDK and/or Package version used
Targeted .NET Platform
.NET 6 (C#/PowerShell)
Operating System and version
Windows 10