openapi-core/openapi_core/schema/content/exceptions.py

17 lines
395 B
Python
Raw Normal View History

import attr
2019-06-18 11:39:07 +00:00
from openapi_core.schema.exceptions import OpenAPIMappingError
2018-05-30 13:46:54 +00:00
class OpenAPIContentError(OpenAPIMappingError):
pass
2019-06-18 11:39:07 +00:00
@attr.s(hash=True)
2018-05-30 13:46:54 +00:00
class MimeTypeNotFound(OpenAPIContentError):
mimetype = attr.ib()
availableMimetypes = attr.ib()
def __str__(self):
return "Mimetype not found: {0}. Valid mimetypes: {1}".format(self.mimetype, self.availableMimetypes)