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
When deployed to AWS, submitting a json body errors on the integration request mapping:
Could not parse request body into json: Could not parse payload into json:
The mapping has: \"body\" : \"$input.body\",
but it should be unquoted (I tested by manually modifying in AWS, it worked): \"body\" : $input.body,
Responses are pass through:
When using proxy integrations for api gateway, the cloud.ApiResponse allows you to return a status and a body as fields in the struct.
Because cognito does not use the proxy integration (it uses a custom mapping for the request), the response is a pass through. When returning a cloud.apiResponse, the client response gets the raw struct:
This happened:
When submitting a json body to a cognito modified api:
{
"message": "Could not parse request body into json: Could not parse payload into json: Unexpected character (\'n\' (code 110)): was expecting comma to separate Object entries\n at [Source: (byte[])\"\n {\n \"httpMethod\": \"POST\",\n \"path\": \"/teams\",\n \"body\" : \"{\"name\": \"bar\"}\",\n \"headers\": {\n \"x-wing-cognitoIdentityId\": \"\",\n \"x-wing-cognitoAuthenticationProvider\": \"\",\n \"Accept\": \"*\\/*\"\n , \"Accept-Encoding\": \"gzip, deflate, br\"\n , \"Authorization\": \"Bearer ... \"[truncated 2300 bytes]; line: 5, column: 20]"
}
When receiving a response from a cognito modified api:
I tried this:
When deployed to AWS, the APIs modified by the cognito winglib fail when submitting a json body and are missing a mapping for the response.
https://github.com/winglang/winglibs/blob/main/cognito/platform/tfaws.w#L188
When deployed to AWS, submitting a json body errors on the integration request mapping:
The mapping has:
\"body\" : \"$input.body\",
but it should be unquoted (I tested by manually modifying in AWS, it worked):
\"body\" : $input.body,
When using proxy integrations for api gateway, the
cloud.ApiResponse
allows you to return a status and a body as fields in the struct.Because cognito does not use the proxy integration (it uses a custom mapping for the request), the response is a pass through. When returning a
cloud.apiResponse
, the client response gets the raw struct:This happened:
When submitting a json body to a cognito modified api:
When receiving a response from a cognito modified api:
A response mapping template needs to be set up.
I expected this:
A successful lambda invocation
Is there a workaround?
Since the response is a pass through, the raw response can be returned instead of the
cloud.ApiResponse
Anything else?
No response
Wing Version
0.85.39
Node.js Version
v22.12.0
Platform(s)
No response
Community Notes
The text was updated successfully, but these errors were encountered: