Coverage for server / validators / query_params_validators.py: 100%
6 statements
« prev ^ index » next coverage.py v7.13.4, created at 2026-10-04 09:33 +0000
« prev ^ index » next coverage.py v7.13.4, created at 2026-10-04 09:33 +0000
1from fastapi import HTTPException, status
4def validate_query_params(page_num: int, page_size: int):
5 if page_num <= 0:
6 raise HTTPException(
7 status.HTTP_400_BAD_REQUEST,
8 detail="Page number should not be equal or less than to 0",
9 )
11 if page_size <= 0:
12 raise HTTPException(
13 status.HTTP_400_BAD_REQUEST,
14 detail="Page size should not be equal or less than to 0",
15 )