Replace marshmallow with jsonschema

Created a new schema that accepts request parameters for the
get_notifications v2 route.
Using that to validate now instead of the marshmallow validation.

Also changed the way formatted error messages are returned because
the previous way was cutting off our failing `enum` messages.
This commit is contained in:
Paul Craig
2016-11-28 14:22:51 +00:00
parent 9b1375ba84
commit ab990679b3
4 changed files with 68 additions and 7 deletions

View File

@@ -42,6 +42,4 @@ def build_error_message(errors):
def __format_message(e):
s = e.message.split("'")
msg = "{}{}".format(s[1], s[2])
return msg if not e.cause else "{} {}".format(e.path[0], e.cause.message)
return e.message.replace("'", "") if not e.cause else "{} {}".format(e.path[0], e.cause.message)