use entity validator in app
This commit is contained in:
parent
403ce3a258
commit
b32dfda01e
1 changed files with 3 additions and 5 deletions
8
app.py
8
app.py
|
@ -12,6 +12,7 @@ import json
|
||||||
|
|
||||||
import util
|
import util
|
||||||
|
|
||||||
|
from entity_validator import validate
|
||||||
|
|
||||||
startup_timestamp = datetime.now()
|
startup_timestamp = datetime.now()
|
||||||
|
|
||||||
|
@ -74,12 +75,9 @@ class ValidateHandler(tornado.web.RequestHandler, metaclass=ABCMeta):
|
||||||
|
|
||||||
entity = self.request.body.decode()
|
entity = self.request.body.decode()
|
||||||
|
|
||||||
# TODO call validator
|
validation_result = validate(json.loads(entity))
|
||||||
validation_result = {
|
|
||||||
"valid": "true"
|
|
||||||
}
|
|
||||||
|
|
||||||
self.write(validation_result)
|
self.write(json.dumps(validation_result))
|
||||||
self.finish()
|
self.finish()
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue