2018-04-18 10:39:03 +00:00
|
|
|
from openapi_core.schema.exceptions import OpenAPIMappingError
|
|
|
|
|
2018-09-06 14:50:16 +00:00
|
|
|
import attr
|
|
|
|
|
2018-04-18 10:39:03 +00:00
|
|
|
|
|
|
|
class OpenAPIResponseError(OpenAPIMappingError):
|
|
|
|
pass
|
|
|
|
|
|
|
|
|
2018-09-06 14:50:16 +00:00
|
|
|
@attr.s
|
2018-04-18 10:39:03 +00:00
|
|
|
class InvalidResponse(OpenAPIResponseError):
|
2018-09-06 14:50:16 +00:00
|
|
|
http_status = attr.ib()
|
|
|
|
responses = attr.ib()
|
|
|
|
|
|
|
|
def __str__(self):
|
|
|
|
return "Unknown response http status: {0}".format(str(self.http_status))
|
2018-04-18 10:39:03 +00:00
|
|
|
|
|
|
|
|
2018-09-06 14:50:16 +00:00
|
|
|
@attr.s
|
2018-04-18 10:39:03 +00:00
|
|
|
class MissingResponseContent(OpenAPIResponseError):
|
2018-09-06 14:50:16 +00:00
|
|
|
response = attr.ib()
|
|
|
|
|
|
|
|
def __str__(self):
|
|
|
|
return "Missing response content"
|