Closed
Description
I am getting the error while using openapi_core with falcon as middleware. All requests without body give error code 400 and following error message:
{'title': 'Invalid JSON', 'description': 'Could not parse an empty JSON body'}
Looks like fixing the following code fixes this error:
https://github.com/p1c2u/openapi-core/blob/master/openapi_core/contrib/falcon/requests.py#26
body = (
dumps(request.json) if getattr(request, "json", None)
-
else dumps(request.media)
-
else dumps(request.get_media({}))