mirror of
https://github.com/correl/openapi-core.git
synced 2024-11-29 03:00:12 +00:00
15 lines
427 B
Python
15 lines
427 B
Python
|
"""OpenAPI core contrib requests responses module"""
|
||
|
from openapi_core.validation.response.datatypes import OpenAPIResponse
|
||
|
|
||
|
|
||
|
class RequestsOpenAPIResponseFactory(object):
|
||
|
|
||
|
@classmethod
|
||
|
def create(cls, response):
|
||
|
mimetype = response.headers.get('Content-Type')
|
||
|
return OpenAPIResponse(
|
||
|
data=response.raw,
|
||
|
status_code=response.status_code,
|
||
|
mimetype=mimetype,
|
||
|
)
|