@view_config(route_name='qiwiSearch', request_method='GET', renderer='json')
def qiwiSearchGet(request):
    schema = SchemaQiwiSearchParams()
try:
    params = schema.deserialize(request.GET)
except colander.Invalid as e:
    errors = e.asdict()
request.response.status_code = 400
return dict(code=400, status='error', message=str(errors))
log.debug('qiwiSearchGet: %s' % params)
return dict(code=200, status='success', message='', data=[1, 2, 3])
In pyramid how to return 400 response with json data?