-
Notifications
You must be signed in to change notification settings - Fork 0
/
validator_raw.py
41 lines (37 loc) · 893 Bytes
/
validator_raw.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
# Sketch Code
#
# from cerberus import Validator
# body = {
# "data": {
# "element1": "123",
# "element2": "helloWorld",
# "element3": 123,
# }
# }
# body_validator = Validator({
# "data": {
# "type": "dict",
# "schema": {
# "element1": {
# "type": "float",
# "required": True,
# "empty": False,
# },
# "element2": {
# "type": "string",
# "required": True,
# "empty": True,
# },
# "element3": {
# "type": "string",
# "required": False,
# "empty": False,
# }
# }
# }
# })
# response = body_validator.validate(body)
# if response is True:
# print(body_validator.errors)
# else:
# print("> Response OK")