Commit b117bd19 authored by Sarah Abrishami's avatar Sarah Abrishami

added validators

parent 02eb2a7e
from app.main import main
from app.main.utils.common import response_message
from flask import json
from rulemall.validators import *
@main.route('/validators', methods=['GET', 'POST'])
def validators():
vals = []
for val in [Range, Length, Category, Regex, Missing, Unique, Empty]:
v = val()
vals.append(json.loads(str(v)))
return response_message(vals)
@main.route('/validators/<val>', methods=['GET', 'POST'])
def get_validator(val):
dct = {'Range': Range, 'Length': Length, 'Category': Category, 'Regex': Regex, 'Missing': Missing, 'Unique': Unique,
'Empty': Empty}
v = dct[val]()
return response_message(json.loads(str(v)))
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment