mirror of
https://github.com/correl/openapi-core.git
synced 2024-11-25 11:09:53 +00:00
13 lines
410 B
Python
13 lines
410 B
Python
|
"""OpenAPI core contrib falcon responses module"""
|
||
|
from openapi_core.validation.response.datatypes import OpenAPIResponse
|
||
|
|
||
|
|
||
|
class FalconOpenAPIResponseFactory(object):
|
||
|
@classmethod
|
||
|
def create(cls, resp):
|
||
|
return OpenAPIResponse(
|
||
|
data=resp.body,
|
||
|
status_code=resp.status[:3],
|
||
|
mimetype=resp.content_type.partition(";")[0] if resp.content_type else '',
|
||
|
)
|