diff options
author | 2018-02-16 16:01:00 +0000 | |
---|---|---|
committer | 2018-02-16 16:01:00 +0000 | |
commit | 60694f47d02c37e3e54933a0b94cb202926c4b3d (patch) | |
tree | 586472ad302da134b1e4441056143a0934902fb3 /pysite/constants.py | |
parent | API view for syncing users from the bot #yumr (#14) (diff) |
API schema validation decorator #yzuf (#15)
* API schema validation decorator
* Remove stray comma
* Remove unnecessary conditional
* Only cast to list when needed to
Diffstat (limited to 'pysite/constants.py')
-rw-r--r-- | pysite/constants.py | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/pysite/constants.py b/pysite/constants.py index 0c9c8ecb..59febcc9 100644 --- a/pysite/constants.py +++ b/pysite/constants.py @@ -1,13 +1,19 @@ # coding=utf-8 -from enum import IntEnum +from enum import Enum, IntEnum class ErrorCodes(IntEnum): unknown_route = 0 unauthorized = 1 invalid_api_key = 2 - missing_parameters = 3 + incorrect_parameters = 3 + bad_data_format = 4 + + +class ValidationTypes(Enum): + json = "json" + params = "params" OWNER_ROLE = 267627879762755584 |