Skip to content

Commit c892fd9

Browse files
authored
Merge pull request #330 from Seluj78/bugfix/fix-nodict-json
Fixed json error where body isn't a dict
2 parents 1113c71 + e843576 commit c892fd9

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

backend/PyMatcha/utils/decorators.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,9 @@ def wrapper(*args, **kwargs):
2727
if not data:
2828
raise BadRequestError("Missing json body.")
2929

30+
if not isinstance(data, dict):
31+
raise BadRequestError("JSON body must be a dict")
32+
3033
missing = []
3134
for item in required.keys():
3235
# If a key is missing in the sent data

0 commit comments

Comments
 (0)