Coverage for app/api/v1/endpoints/ready_router.py: 86%

7 statements  

« prev     ^ index     » next       coverage.py v7.14.1, created at 2026-06-16 20:06 +0000

1from fastapi import APIRouter 

2from app.api.v1.dependencies import ReadyServiceDependency 

3from app.schemas.ready import ReadyResponse 

4 

5ready_router = APIRouter() 

6 

7 

8@ready_router.get( 

9 "", 

10 response_model=ReadyResponse, 

11 summary="Check application readiness", 

12 response_description="Indicates whether the application is ready to serve requests.", 

13 description=( 

14 "Perform a readiness check to verify that the application is fully initialized and can handle requests. " 

15 "This endpoint can be used for monitoring and alerting purposes to ensure the service is operational." 

16 ), 

17 responses={ 

18 200: { 

19 "description": "Readiness check successful", 

20 "model": ReadyResponse, 

21 }, 

22 }, 

23) 

24async def ready_check(service: ReadyServiceDependency): 

25 """ 

26 Check the readiness of the application. 

27 """ 

28 return await service.process()