WSGI middleware can be used to validate incoming requests for APIs implemented in Python.
See middleware.py
below for an example that validates the presence of a content
key in the JSON body of an incoming HTTP POST request.
appengine_config.py
shows how to add this middleware to an application running in Google App Engine Python Standard Environment.