From 31b9859aebc7cb207f20926f63cde932affe4620 Mon Sep 17 00:00:00 2001 From: Stefan Haun Date: Tue, 1 Dec 2020 20:55:49 +0100 Subject: [PATCH] Add validate handler --- app.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/app.py b/app.py index 2510298..f9300df 100644 --- a/app.py +++ b/app.py @@ -68,6 +68,21 @@ class Oas3Handler(tornado.web.RequestHandler, metaclass=ABCMeta): self.finish() +class ValidateHandler(tornado.web.RequestHandler, metaclass=ABCMeta): + def post(self): + self.set_header("Content-Type", "application/json") + + entity = self.request.body.decode() + + # TODO call validator + validation_result = { + "valid": "true" + } + + self.write(validation_result) + self.finish() + + def make_app(): version_path = r"/v[0-9]" return tornado.web.Application([