-
-
Save richardgrantserverless/cb17852e9bb1ea59fb007b9581fbf89a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import json | |
import sys | |
sys.path.insert(0, 'src/vendor') | |
from jsonpath_rw import jsonpath, parse | |
def hello(event, context): | |
body = { | |
"message": "Python Function executed successfully!" | |
} | |
jsonpath.auto_id_field = 'id' | |
data = [match.value for match in parse('foo[*].id').find({'foo': [{'id': 'bizzle'}, {'baz': 3}]})] | |
response = { | |
"statusCode": 200, | |
"body": json.dumps(body), | |
"data": json.dumps(data) | |
} | |
return response |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment