remove response "validation"
It seems somebody wanted to implement response validation, but now it's completely broken: it's done in checked_data method, which takes data either from web input or from data keyword, and second, there is only one validate_response method which it empty. So let's remove it now and if somebody will have spare time in the future, he could implement it from scratch. Change-Id: Ic60236fce11998d76354d3d2707d0260351ca063
This commit is contained in:
parent
535aeec00b
commit
beeeceadf4
@ -279,7 +279,6 @@ def content_json(func, cls, *args, **kwargs):
|
||||
)
|
||||
|
||||
request_validate_needed = True
|
||||
response_validate_needed = True
|
||||
|
||||
resource_type = "single"
|
||||
if issubclass(
|
||||
@ -337,16 +336,6 @@ def content_json(func, cls, *args, **kwargs):
|
||||
web.header('Content-Type', 'text/plain')
|
||||
raise http_error
|
||||
|
||||
if all([
|
||||
settings.DEVELOPMENT,
|
||||
response_validate_needed,
|
||||
getattr(cls.__class__, 'validator', None) is not None
|
||||
]):
|
||||
BaseHandler.checked_data(
|
||||
cls.validator.validate_response,
|
||||
resource_type=resource_type
|
||||
)
|
||||
|
||||
web.header('Content-Type', 'application/json', unique=True)
|
||||
return json_resp(resp)
|
||||
|
||||
|
@ -75,12 +75,6 @@ class BasicValidator(object):
|
||||
)
|
||||
raise errors.JsonValidationError(exc.message)
|
||||
|
||||
@classmethod
|
||||
def validate_response(cls, resp, resource_type,
|
||||
single_schema=None,
|
||||
collection_schema=None):
|
||||
pass
|
||||
|
||||
@classmethod
|
||||
def validate(cls, data):
|
||||
return cls.validate_json(data)
|
||||
|
Loading…
Reference in New Issue
Block a user