I have a chalice application and in that chalice application, I have a lambda function. This lambda function is the data source for my AppSync application. When I make a request and return the response from the Lmabda function, the JSON object is returned as string, and not as JSON object. I have tried so many times, but nothing worked.
This is what I am returning from the lambda function:
'''
result = {
'service': service,
'version': version,
'requestID': request_id,
'result': {
'creditDecisionRecommendation': credit_decision_recommendation,
'creditScore': bureau_score,
'creditLimit': limit
}
}
'''
...and this is what I get as the response:
'''
{
"data": {
"postKaubamaja": {
"service": "kaubamaja-custom-scoring",
"version": "1.0",
"result": "{\"creditDecisionRecommendation\":\"accept\",\"creditScore\":10.8,\"creditLimit\":612.1275}"
}
}
}
'''
The "result" object should be a JSON object itself, but gets a string. Does someone have any idea what is wrong here?
Thanks