From b32dfda01eed942ce25752e9c77e81f54542a089 Mon Sep 17 00:00:00 2001 From: David Kilias Date: Fri, 4 Dec 2020 21:18:37 +0100 Subject: [PATCH] use entity validator in app --- app.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/app.py b/app.py index 96a27ef..26f16af 100644 --- a/app.py +++ b/app.py @@ -12,6 +12,7 @@ import json import util +from entity_validator import validate startup_timestamp = datetime.now() @@ -74,12 +75,9 @@ class ValidateHandler(tornado.web.RequestHandler, metaclass=ABCMeta): entity = self.request.body.decode() - # TODO call validator - validation_result = { - "valid": "true" - } + validation_result = validate(json.loads(entity)) - self.write(validation_result) + self.write(json.dumps(validation_result)) self.finish()