async def test_validation_exception_handler_CorrectResponseBody(self):
        """Ensure that the validation exception handler returns the correct response body when 422 is raised."""
        # Create a mock request
        mock_request = MagicMock(spec=Request)
        # Manually create a RequestValidationError
        errors = [
            {
                "loc": ("body", "name"),
                "msg": "ensure this value has at most 10 characters",
                "type": "value_error.any_str.max_length",
                "ctx": {"limit_value": 10}
            }
        ]
        validation_error = RequestValidationError(errors)

        response = await api_validation_exception_handler(mock_request, validation_error)
        self.assertEqual(422, response.status_code)
        self.assertEqual(
            {
                "detail": jsonable_encoder(validation_error.errors()),
                "code": UnprocessableEntityError.code,
                "type": UnprocessableEntityError.error_type,
                "link": UnprocessableEntityError.link
            },
            response.body
        )
Ensure that the validation exception handler returns the correct response body when 422 is raised.
tests/integ_tests/tensor_search/test_api_exception_handler.py