openapi-core/openapi_core/contrib/flask/responses.py

14 lines
376 B
Python
Raw Normal View History

2019-10-19 11:01:50 +00:00
"""OpenAPI core contrib flask responses module"""
2019-10-19 12:35:48 +00:00
from openapi_core.validation.response.datatypes import OpenAPIResponse
2019-10-19 11:01:50 +00:00
2019-10-19 12:35:48 +00:00
class FlaskOpenAPIResponseFactory(object):
2019-10-19 11:01:50 +00:00
2019-10-19 12:35:48 +00:00
@classmethod
def create(cls, response):
return OpenAPIResponse(
data=response.data,
status_code=response._status_code,
mimetype=response.mimetype,
)