2018-09-06 14:50:16 +00:00
|
|
|
import attr
|
|
|
|
|
2019-06-18 11:39:07 +00:00
|
|
|
from openapi_core.schema.exceptions import OpenAPIMappingError
|
|
|
|
|
2018-04-18 10:39:03 +00:00
|
|
|
|
|
|
|
class OpenAPIParameterError(OpenAPIMappingError):
|
|
|
|
pass
|
|
|
|
|
|
|
|
|
2019-10-20 13:38:41 +00:00
|
|
|
class MissingParameterError(OpenAPIParameterError):
|
|
|
|
"""Missing parameter error"""
|
|
|
|
pass
|
|
|
|
|
|
|
|
|
2019-06-18 11:39:07 +00:00
|
|
|
@attr.s(hash=True)
|
2019-10-20 13:38:41 +00:00
|
|
|
class MissingParameter(MissingParameterError):
|
2018-09-06 14:50:16 +00:00
|
|
|
name = attr.ib()
|
|
|
|
|
|
|
|
def __str__(self):
|
2020-01-17 14:36:14 +00:00
|
|
|
return "Missing parameter (without default value): {0}".format(
|
|
|
|
self.name)
|
2018-04-18 10:39:03 +00:00
|
|
|
|
|
|
|
|
2019-06-18 11:39:07 +00:00
|
|
|
@attr.s(hash=True)
|
2019-10-20 13:38:41 +00:00
|
|
|
class MissingRequiredParameter(MissingParameterError):
|
2018-09-06 14:50:16 +00:00
|
|
|
name = attr.ib()
|
|
|
|
|
|
|
|
def __str__(self):
|
|
|
|
return "Missing required parameter: {0}".format(self.name)
|