AWS Lambda python custom response encoding AWS Lambda python custom response encoding json json

AWS Lambda python custom response encoding


I'm assuming you are looking to return from the lambda handler function. If so, while not elegant, you can do this:

json.loads(json.dumps(value, cls=JSONEncoder))

Not awesome because eventually Lambda will convert that structure back into a string (not sure if there's a way to just skip the intermediate step of converting to a python structure).