Do not try to parse non-json request examples as json

This commit is contained in:
Kegan Dougal 2015-10-01 18:03:34 +01:00
parent 87b6dd845e
commit 8c4d7f5051

View file

@ -34,7 +34,7 @@ def check_parameter(filepath, request, parameter):
example = None
try:
example_json = schema.get('example')
if example_json:
if example_json and not schema.get("format") == "byte":
example = json.loads(example_json)
except Exception as e:
raise ValueError("Error parsing JSON example request for %r" % (