In this Gist i will record all the validations that i use when building API's that may be useful in the future or maybe improved.
response_body = {}
data = request.json
required_data = ['data1', 'data2'] # Include all the required data that the endpoint needs
for key in required_data: