|
|
|
|
@ -158,11 +158,20 @@ class RequestValidationMiddleware(BaseHTTPMiddleware):
|
|
|
|
|
try:
|
|
|
|
|
size_val = int(value)
|
|
|
|
|
if size_val > 50:
|
|
|
|
|
raise HTTPException(status_code=400, detail=f"Pagination size '{key}' cannot exceed 50")
|
|
|
|
|
raise HTTPException(
|
|
|
|
|
status_code=400,
|
|
|
|
|
detail=f"Pagination size '{key}' cannot exceed 50",
|
|
|
|
|
)
|
|
|
|
|
if size_val % 5 != 0:
|
|
|
|
|
raise HTTPException(status_code=400, detail=f"Pagination size '{key}' must be a multiple of 5")
|
|
|
|
|
raise HTTPException(
|
|
|
|
|
status_code=400,
|
|
|
|
|
detail=f"Pagination size '{key}' must be a multiple of 5",
|
|
|
|
|
)
|
|
|
|
|
except ValueError:
|
|
|
|
|
raise HTTPException(status_code=400, detail=f"Pagination size '{key}' must be an integer")
|
|
|
|
|
raise HTTPException(
|
|
|
|
|
status_code=400,
|
|
|
|
|
detail=f"Pagination size '{key}' must be an integer",
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
# -------------------------
|
|
|
|
|
# 4. Content-Type sanity
|
|
|
|
|
|