Skip to content

Commit 2636a42

Browse files
Merge pull request #2490 from tisnik/proper-description-for-liveness-rest-api-endpoint
Proper description for liveness REST API endpoint
2 parents c8e363f + 6fc1c23 commit 2636a42

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

docs/openapi.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -333,7 +333,7 @@
333333
"operationId": "liveness_probe_get_method_liveness_get",
334334
"responses": {
335335
"200": {
336-
"description": "Successful Response",
336+
"description": "Service is alive",
337337
"content": {
338338
"application/json": {
339339
"schema": {

ols/app/endpoints/health.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,15 @@ def readiness_probe_get_method() -> ReadinessResponse:
117117
return ReadinessResponse(ready=True, reason="service is ready")
118118

119119

120-
@router.get("/liveness")
120+
get_liveness_responses: dict[int | str, dict[str, Any]] = {
121+
200: {
122+
"description": "Service is alive",
123+
"model": LivenessResponse,
124+
},
125+
}
126+
127+
128+
@router.get("/liveness", responses=get_liveness_responses)
121129
def liveness_probe_get_method() -> LivenessResponse:
122130
"""Live status of service."""
123131
return LivenessResponse(alive=True)

0 commit comments

Comments
 (0)