hatch-sh / hatch

🐣 Easy deployment of static websites to Amazon Web Services
https://hatch.sh
5 stars 0 forks source link

Use APIGateway model checking #8

Open mads-hartmann opened 7 years ago

mads-hartmann commented 7 years ago

APIGateway can perform simple JSON schema checks on the request before passing it to the lambda. It would be cool to add these to the endpoints. I'm thinking something like.

class Request(hatch.Schema):
    name = hatch.Schema.String

@hatch.url('foo/bar', methods=['GET'])
@hatch.request(Request.schema)
def get(request):
    return 'Hi There {}'.format(request.name)