mirror of
https://github.com/matrix-org/matrix-spec
synced 2025-12-20 16:38:37 +01:00
Do not try to parse non-json request examples as json
This commit is contained in:
parent
87b6dd845e
commit
8c4d7f5051
|
|
@ -34,7 +34,7 @@ def check_parameter(filepath, request, parameter):
|
||||||
example = None
|
example = None
|
||||||
try:
|
try:
|
||||||
example_json = schema.get('example')
|
example_json = schema.get('example')
|
||||||
if example_json:
|
if example_json and not schema.get("format") == "byte":
|
||||||
example = json.loads(example_json)
|
example = json.loads(example_json)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
raise ValueError("Error parsing JSON example request for %r" % (
|
raise ValueError("Error parsing JSON example request for %r" % (
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue