mirror of
https://github.com/correl/openapi-core.git
synced 2024-11-22 03:00:10 +00:00
Support for falcon-jsonify
This commit is contained in:
parent
ab3372906b
commit
db80167a79
1 changed files with 6 additions and 1 deletions
|
@ -1,4 +1,6 @@
|
|||
"""OpenAPI core contrib falcon responses module"""
|
||||
import json
|
||||
|
||||
from openapi_core.validation.request.datatypes import OpenAPIRequest, RequestParameters
|
||||
from werkzeug.datastructures import ImmutableMultiDict
|
||||
|
||||
|
@ -26,6 +28,9 @@ class FalconOpenAPIRequestFactory:
|
|||
path_pattern=req.uri_template,
|
||||
method=method,
|
||||
parameters=parameters,
|
||||
body=req.bounded_stream.read(),
|
||||
# Support falcon-jsonify.
|
||||
body=json.dumps(req.json)
|
||||
if getattr(req, "json", None)
|
||||
else req.bounded_stream.read(),
|
||||
mimetype=req.content_type.partition(";")[0] if req.content_type else "",
|
||||
)
|
||||
|
|
Loading…
Reference in a new issue