2018-09-06 15:50:16 +01:00
|
|
|
import attr
|
|
|
|
|
2019-06-18 12:39:07 +01:00
|
|
|
from openapi_core.schema.exceptions import OpenAPIMappingError
|
|
|
|
|
2018-04-18 11:39:03 +01:00
|
|
|
|
|
|
|
class OpenAPIResponseError(OpenAPIMappingError):
|
|
|
|
pass
|
|
|
|
|
|
|
|
|
2019-06-18 12:39:07 +01:00
|
|
|
@attr.s(hash=True)
|
2018-04-18 11:39:03 +01:00
|
|
|
class InvalidResponse(OpenAPIResponseError):
|
2018-09-06 15:50:16 +01: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 11:39:03 +01:00
|
|
|
|
|
|
|
|
2019-06-18 12:39:07 +01:00
|
|
|
@attr.s(hash=True)
|
2018-04-18 11:39:03 +01:00
|
|
|
class MissingResponseContent(OpenAPIResponseError):
|
2018-09-06 15:50:16 +01:00
|
|
|
response = attr.ib()
|
|
|
|
|
|
|
|
def __str__(self):
|
|
|
|
return "Missing response content"
|