You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Doing so, and returning any type of HttpResults, from the UI of Mock Lambda Test Tool I'm getting a base64 return in response. As for this case, I'm getting:
That's correct overall, but for testing purposes, having to decode the base64 to see what I got it's not what I would want to do recurrently. Is this intended or am I missing something? If I deploy it, through browsers I can get instantly a decoded response.
───
A second thing is that I'm trying to use a [FromBody] attribute to get some data passed in the body, like this:
If through the UI Mock Lambda Test Tool I try to send { "name": "test" }, I get a ValidationException, so it doesn't even enter the Test Function completely.
This is the response (which is also base64 encoded in the UI).
{"statusCode":400,"headers":{"Content-Type":"application/json","x-amzn-ErrorType":"ValidationException"},"cookies":null,"body":"{\u0022message\u0022: \u00221 validation error(s) detected: Value at \u0027body\u0027 failed to satisfy constraint: Value cannot be null. (Parameter \u0027json\u0027)\u0022}","isBase64Encoded": false
}
Am I using this correctly for this case? Before trying annotations, I was using the template that comes with Powertools, there I'd just pass the type (in this case would be Request) and I wouldn't get this error.
For both cases, I'm using the base template Serverless Annotation, and deleted what's inside the main Class, everything else is untouched.
The text was updated successfully, but these errors were encountered:
Discussed in #1569
Originally posted by sergio-asenjo August 20, 2023
Hello!
I've been trying to figure out how to properly use HttpResults returning statement in the "Mock Lambda Test Tool".
As a short example, I've tried this:
Doing so, and returning any type of HttpResults, from the UI of Mock Lambda Test Tool I'm getting a base64 return in response. As for this case, I'm getting:
"eyJzdGF0dXNDb2RlIjoyMDAsImhlYWRlcnMiOnsiY29udGVudC10eXBlIjoidGV4dC9wbGFpbiJ9LCJDb29raWVzIjpudWxsLCJib2R5IjoiT2siLCJpc0Jhc2U2NEVuY29kZWQiOmZhbHNlfQ=="
Which translate to:
That's correct overall, but for testing purposes, having to decode the base64 to see what I got it's not what I would want to do recurrently. Is this intended or am I missing something? If I deploy it, through browsers I can get instantly a decoded response.
───
A second thing is that I'm trying to use a [FromBody] attribute to get some data passed in the body, like this:
If through the UI Mock Lambda Test Tool I try to send
{ "name": "test" }
, I get a ValidationException, so it doesn't even enter the Test Function completely.This is the response (which is also base64 encoded in the UI).
Am I using this correctly for this case? Before trying annotations, I was using the template that comes with Powertools, there I'd just pass the type (in this case would be Request) and I wouldn't get this error.
For both cases, I'm using the base template Serverless Annotation, and deleted what's inside the main Class, everything else is untouched.
The text was updated successfully, but these errors were encountered: