mirror of
https://github.com/correl/openapi-core.git
synced 2024-11-25 11:09:53 +00:00
14 lines
415 B
Python
14 lines
415 B
Python
"""OpenAPI core contrib django responses module"""
|
|
from openapi_core.validation.response.datatypes import OpenAPIResponse
|
|
|
|
|
|
class DjangoOpenAPIResponseFactory(object):
|
|
|
|
@classmethod
|
|
def create(cls, response):
|
|
mimetype = response["Content-Type"]
|
|
return OpenAPIResponse(
|
|
data=response.content,
|
|
status_code=response.status_code,
|
|
mimetype=mimetype,
|
|
)
|