-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Description
I'm sure this has been reported already because of the other Function returned an invalid response (must include one of: body, headers or statusCode in the response object) reason, but the real reason is showing up for me on the previous line,
statusCode must be a positive int
When you then check the code supplied by the blueprint, in the respond function, you'll see,
def respond(err, res=None):
return {
'statusCode': '400' if err else '200',
'body': err.message if err else json.dumps(res),
'headers': {
'Content-Type': 'application/json',
},
}
If you change that function to,
def respond(err, res=None):
return {
'statusCode': 400 if err else 200,
'body': err.message if err else json.dumps(res),
'headers': {
'Content-Type': 'application/json',
},
}
The problem is resolved and your function works as it's supposed to. Now, whether that's your bad or... the other awslabs' (the history says it's @sanathkr 's code) bad, I don't know! Because I'm using this, I decided to log the bug here. It might be a case where you guys maybe should try json.load statusCode, if it's a str and that code should also be returning ints instead, again I don't know!