def validation_error_view(error, request):
    """
    Return Marshmallow :class:`ValidationError`
    as a JSON response with a proper response code.
    :param error: Marshmallow error instance
    :type error: ValidationError
    :param request: Pyramid request
    :type request: pyramid.request.Request
    :return: Error messages
    :rtype: dict[str,list]
    """
    request.response.status_int = 400
    return error.messages