async def api_validation_exception_handler(request: Request, exc: RequestValidationError) -> JSONResponse:
    """Catch FastAPI validation errors and return a 422 error with the error messages.

    Note: The Pydantic Validation error that happens at the API will be caught here and returned as a 422 error.
    However, the Pydantic Validation error that happens in the core will be caught by the MarqoError handler above and
    converted to an API error in validation_exception_handler
    """
    body = {
        "detail": jsonable_encoder(exc.errors()),
        "code": UnprocessableEntityError.code,
        "type": UnprocessableEntityError.error_type,
        "link": UnprocessableEntityError.link
    }
    return JSONResponse(
        status_code=HTTP_422_UNPROCESSABLE_ENTITY,
        content=body
    )
Catch FastAPI validation errors and return a 422 error with the error messages.

    Note: The Pydantic Validation error that happens at the API will be caught here and returned as a 422 error.
    However, the Pydantic Validation error that happens in the core will be caught by the MarqoError handler above and
    converted to an API error in validation_exception_handler
    
src/marqo/tensor_search/api.py