This library helps you to validate function parameters.
sudo pip install thunderargs
You can use it like this:
from thunderargs import Arg
from thunderargs.endpoint import Endpoint
@Endpoint
def max_int(x: Arg(int), y: Arg(int)):
return max(x,y)
Read the tests for more examples.