@sebspark/health-check 1.0.14 → 2.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -100,75 +100,94 @@ app.listen(3000, () => {
100
100
  ```json
101
101
  {
102
102
  "tags": [
103
- { "name": "system", "description": "Operational endpoints." }
103
+ {
104
+ "name": "health",
105
+ "description": "Health endpoints."
106
+ }
104
107
  ],
105
108
  "paths": {
106
- "/health/ping": {
109
+ "/health": {
107
110
  "get": {
108
- "tags": ["system"],
109
- "summary": "Health ping",
110
- "description": "Basic health status.",
111
+ "tags": [
112
+ "health"
113
+ ],
114
+ "summary": "Comprehensive health summary",
115
+ "description": "Combined view of status, system/process metrics, and readiness summary. Includes links to all child endpoints.",
111
116
  "security": [],
112
117
  "responses": {
113
118
  "200": {
114
- "description": "Service responds with basic status.",
119
+ "description": "Health summary envelope.",
115
120
  "content": {
116
121
  "application/json": {
117
- "schema": { "$ref": "#/components/schemas/HealthCheck_Status" }
122
+ "schema": {
123
+ "$ref": "#/components/schemas/HealthCheck_HealthSummary_Entity"
124
+ }
118
125
  }
119
126
  }
120
127
  }
121
128
  }
122
129
  }
123
130
  },
124
- "/health/live": {
131
+ "/health/ping": {
125
132
  "get": {
126
- "tags": ["system"],
127
- "summary": "Liveness",
128
- "description": "Liveness signal with system and process metrics.",
133
+ "tags": [
134
+ "health"
135
+ ],
136
+ "summary": "Status ping",
137
+ "description": "Basic health status. Links back to parent /health.",
129
138
  "security": [],
130
139
  "responses": {
131
140
  "200": {
132
- "description": "Liveness payload.",
141
+ "description": "Status entity.",
133
142
  "content": {
134
143
  "application/json": {
135
- "schema": { "$ref": "#/components/schemas/HealthCheck_Liveness" }
144
+ "schema": {
145
+ "$ref": "#/components/schemas/HealthCheck_Status_Entity"
146
+ }
136
147
  }
137
148
  }
138
149
  }
139
150
  }
140
151
  }
141
152
  },
142
- "/health/ready": {
153
+ "/health/live": {
143
154
  "get": {
144
- "tags": ["system"],
145
- "summary": "Readiness",
146
- "description": "Readiness including dependency checks and summary.",
155
+ "tags": [
156
+ "health"
157
+ ],
158
+ "summary": "Liveness",
159
+ "description": "Liveness signal with system and process metrics. Links back to parent /health.",
147
160
  "security": [],
148
161
  "responses": {
149
162
  "200": {
150
- "description": "Readiness payload.",
163
+ "description": "Liveness entity.",
151
164
  "content": {
152
165
  "application/json": {
153
- "schema": { "$ref": "#/components/schemas/HealthCheck_ReadinessPayload" }
166
+ "schema": {
167
+ "$ref": "#/components/schemas/HealthCheck_Liveness_Entity"
168
+ }
154
169
  }
155
170
  }
156
171
  }
157
172
  }
158
173
  }
159
174
  },
160
- "/health": {
175
+ "/health/ready": {
161
176
  "get": {
162
- "tags": ["system"],
163
- "summary": "Comprehensive health summary",
164
- "description": "Combined view of status, system/process metrics, and readiness summary.",
177
+ "tags": [
178
+ "health"
179
+ ],
180
+ "summary": "Readiness",
181
+ "description": "Readiness including dependency checks and summary. Links back to parent /health.",
165
182
  "security": [],
166
183
  "responses": {
167
184
  "200": {
168
- "description": "Health summary.",
185
+ "description": "Readiness entity.",
169
186
  "content": {
170
187
  "application/json": {
171
- "schema": { "$ref": "#/components/schemas/HealthCheck_HealthSummary" }
188
+ "schema": {
189
+ "$ref": "#/components/schemas/HealthCheck_Readiness_Entity"
190
+ }
172
191
  }
173
192
  }
174
193
  }
@@ -178,139 +197,325 @@ app.listen(3000, () => {
178
197
  },
179
198
  "components": {
180
199
  "schemas": {
200
+ "Verb": {
201
+ "type": "string",
202
+ "enum": [
203
+ "GET",
204
+ "POST",
205
+ "PUT",
206
+ "PATCH",
207
+ "DELETE"
208
+ ],
209
+ "description": "HTTP method for the link."
210
+ },
211
+ "Link": {
212
+ "type": "object",
213
+ "description": "A hypermedia link.",
214
+ "properties": {
215
+ "href": {
216
+ "type": "string",
217
+ "format": "uri-reference",
218
+ "description": "Target URL."
219
+ },
220
+ "method": {
221
+ "$ref": "#/components/schemas/Verb"
222
+ }
223
+ },
224
+ "required": [
225
+ "href",
226
+ "method"
227
+ ]
228
+ },
181
229
  "HealthCheck_StatusValue": {
182
230
  "type": "string",
183
- "enum": ["ok", "degraded", "error"],
231
+ "enum": [
232
+ "ok",
233
+ "degraded",
234
+ "error"
235
+ ],
184
236
  "description": "Health status value."
185
237
  },
186
238
  "HealthCheck_Impact": {
187
239
  "type": "string",
188
- "enum": ["critical", "non_critical"],
240
+ "enum": [
241
+ "critical",
242
+ "non_critical"
243
+ ],
189
244
  "description": "Operational impact if the dependency fails."
190
245
  },
191
246
  "HealthCheck_Mode": {
192
247
  "type": "string",
193
- "enum": ["inline", "polled", "async"],
248
+ "enum": [
249
+ "inline",
250
+ "polled",
251
+ "async"
252
+ ],
194
253
  "description": "How the dependency is checked."
195
254
  },
196
255
  "HealthCheck_Status": {
197
256
  "type": "object",
198
257
  "properties": {
199
- "status": { "$ref": "#/components/schemas/HealthCheck_StatusValue" }
258
+ "status": {
259
+ "$ref": "#/components/schemas/HealthCheck_StatusValue"
260
+ }
200
261
  },
201
- "required": ["status"]
262
+ "required": [
263
+ "status"
264
+ ]
202
265
  },
203
266
  "HealthCheck_System": {
204
267
  "type": "object",
205
268
  "properties": {
206
- "hostname": { "type": "string" },
269
+ "hostname": {
270
+ "type": "string"
271
+ },
207
272
  "platform": {
208
273
  "type": "string",
209
274
  "description": "NodeJS.Platform",
210
- "enum": ["aix","android","darwin","freebsd","linux","openbsd","sunos","win32"]
275
+ "enum": [
276
+ "aix",
277
+ "android",
278
+ "darwin",
279
+ "freebsd",
280
+ "linux",
281
+ "openbsd",
282
+ "sunos",
283
+ "win32"
284
+ ]
285
+ },
286
+ "release": {
287
+ "type": "string"
288
+ },
289
+ "arch": {
290
+ "type": "string",
291
+ "description": "e.g., x64, arm64"
292
+ },
293
+ "uptime": {
294
+ "type": "number",
295
+ "description": "Seconds."
211
296
  },
212
- "release": { "type": "string" },
213
- "arch": { "type": "string", "description": "e.g., x64, arm64" },
214
- "uptime": { "type": "number", "description": "Seconds." },
215
297
  "loadavg": {
216
298
  "type": "array",
217
- "items": { "type": "number" },
299
+ "items": {
300
+ "type": "number"
301
+ },
218
302
  "minItems": 3,
219
303
  "maxItems": 3,
220
304
  "description": "Load averages for 1, 5, 15 minutes."
221
305
  },
222
- "totalmem": { "type": "number" },
223
- "freemem": { "type": "number" },
224
- "memUsedRatio": { "type": "number", "minimum": 0, "maximum": 1 },
306
+ "totalmem": {
307
+ "type": "number"
308
+ },
309
+ "freemem": {
310
+ "type": "number"
311
+ },
312
+ "memUsedRatio": {
313
+ "type": "number",
314
+ "minimum": 0,
315
+ "maximum": 1
316
+ },
225
317
  "cpus": {
226
318
  "type": "object",
227
319
  "properties": {
228
- "count": { "type": "integer", "minimum": 1 },
229
- "model": { "type": "string" },
230
- "speedMHz": { "type": "number" }
320
+ "count": {
321
+ "type": "integer",
322
+ "minimum": 1
323
+ },
324
+ "model": {
325
+ "type": "string"
326
+ },
327
+ "speedMHz": {
328
+ "type": "number"
329
+ }
231
330
  },
232
- "required": ["count"]
331
+ "required": [
332
+ "count"
333
+ ]
233
334
  }
234
335
  },
235
336
  "required": [
236
- "hostname","platform","release","arch","uptime","loadavg",
237
- "totalmem","freemem","memUsedRatio","cpus"
337
+ "hostname",
338
+ "platform",
339
+ "release",
340
+ "arch",
341
+ "uptime",
342
+ "loadavg",
343
+ "totalmem",
344
+ "freemem",
345
+ "memUsedRatio",
346
+ "cpus"
238
347
  ]
239
348
  },
240
349
  "HealthCheck_MemoryUsage": {
241
350
  "type": "object",
242
351
  "description": "Process memory usage (NodeJS.MemoryUsage).",
243
352
  "properties": {
244
- "rss": { "type": "number" },
245
- "heapTotal": { "type": "number" },
246
- "heapUsed": { "type": "number" },
247
- "external": { "type": "number" },
248
- "arrayBuffers": { "type": "number" }
353
+ "rss": {
354
+ "type": "number"
355
+ },
356
+ "heapTotal": {
357
+ "type": "number"
358
+ },
359
+ "heapUsed": {
360
+ "type": "number"
361
+ },
362
+ "external": {
363
+ "type": "number"
364
+ },
365
+ "arrayBuffers": {
366
+ "type": "number"
367
+ }
249
368
  },
250
- "additionalProperties": { "type": "number" }
369
+ "additionalProperties": {
370
+ "type": "number"
371
+ }
251
372
  },
252
373
  "HealthCheck_Process": {
253
374
  "type": "object",
254
375
  "properties": {
255
- "pid": { "type": "integer" },
256
- "node": { "type": "string", "description": "Node.js version string." },
257
- "uptime": { "type": "number", "description": "Seconds." },
258
- "memory": { "$ref": "#/components/schemas/HealthCheck_MemoryUsage" }
376
+ "pid": {
377
+ "type": "integer"
378
+ },
379
+ "node": {
380
+ "type": "string",
381
+ "description": "Node.js version string."
382
+ },
383
+ "uptime": {
384
+ "type": "number",
385
+ "description": "Seconds."
386
+ },
387
+ "memory": {
388
+ "$ref": "#/components/schemas/HealthCheck_MemoryUsage"
389
+ }
259
390
  },
260
- "required": ["pid","node","uptime","memory"]
391
+ "required": [
392
+ "pid",
393
+ "node",
394
+ "uptime",
395
+ "memory"
396
+ ]
261
397
  },
262
398
  "HealthCheck_Liveness": {
263
399
  "allOf": [
264
- { "$ref": "#/components/schemas/HealthCheck_Status" },
400
+ {
401
+ "$ref": "#/components/schemas/HealthCheck_Status"
402
+ },
265
403
  {
266
404
  "type": "object",
267
405
  "properties": {
268
- "timestamp": { "type": "string", "format": "date-time" },
269
- "system": { "$ref": "#/components/schemas/HealthCheck_System" },
270
- "process": { "$ref": "#/components/schemas/HealthCheck_Process" }
406
+ "timestamp": {
407
+ "type": "string",
408
+ "format": "date-time"
409
+ },
410
+ "system": {
411
+ "$ref": "#/components/schemas/HealthCheck_System"
412
+ },
413
+ "process": {
414
+ "$ref": "#/components/schemas/HealthCheck_Process"
415
+ }
271
416
  },
272
- "required": ["timestamp","system","process"]
417
+ "required": [
418
+ "timestamp",
419
+ "system",
420
+ "process"
421
+ ]
273
422
  }
274
423
  ]
275
424
  },
276
425
  "HealthCheck_Freshness": {
277
426
  "type": "object",
278
427
  "properties": {
279
- "lastChecked": { "type": "string", "format": "date-time" },
280
- "lastSuccess": { "type": ["string","null"], "format": "date-time" }
428
+ "lastChecked": {
429
+ "type": "string",
430
+ "format": "date-time"
431
+ },
432
+ "lastSuccess": {
433
+ "type": [
434
+ "string",
435
+ "null"
436
+ ],
437
+ "format": "date-time"
438
+ }
281
439
  },
282
- "required": ["lastChecked","lastSuccess"]
440
+ "required": [
441
+ "lastChecked",
442
+ "lastSuccess"
443
+ ]
283
444
  },
284
445
  "HealthCheck_Observed": {
285
446
  "type": "object",
286
447
  "properties": {
287
- "latencyMs": { "type": ["number","null"] }
448
+ "latencyMs": {
449
+ "type": [
450
+ "number",
451
+ "null"
452
+ ]
453
+ }
288
454
  },
289
455
  "additionalProperties": true
290
456
  },
291
457
  "HealthCheck_CheckError": {
292
458
  "type": "object",
293
459
  "properties": {
294
- "code": { "type": "string" },
295
- "message": { "type": "string" }
460
+ "code": {
461
+ "type": "string"
462
+ },
463
+ "message": {
464
+ "type": "string"
465
+ }
296
466
  },
297
- "required": ["code","message"]
467
+ "required": [
468
+ "code",
469
+ "message"
470
+ ]
298
471
  },
299
472
  "HealthCheck_DependencyCheck": {
300
473
  "allOf": [
301
- { "$ref": "#/components/schemas/HealthCheck_Status" },
474
+ {
475
+ "$ref": "#/components/schemas/HealthCheck_Status"
476
+ },
302
477
  {
303
478
  "type": "object",
304
479
  "properties": {
305
- "impact": { "$ref": "#/components/schemas/HealthCheck_Impact" },
306
- "mode": { "$ref": "#/components/schemas/HealthCheck_Mode" },
307
- "freshness": { "$ref": "#/components/schemas/HealthCheck_Freshness" },
308
- "observed": { "$ref": "#/components/schemas/HealthCheck_Observed" },
309
- "details": { "type": "object", "additionalProperties": true },
310
- "error": { "oneOf": [ { "$ref": "#/components/schemas/HealthCheck_CheckError" }, { "type": "null" } ] },
311
- "since": { "type": ["string","null"], "format": "date-time" }
480
+ "impact": {
481
+ "$ref": "#/components/schemas/HealthCheck_Impact"
482
+ },
483
+ "mode": {
484
+ "$ref": "#/components/schemas/HealthCheck_Mode"
485
+ },
486
+ "freshness": {
487
+ "$ref": "#/components/schemas/HealthCheck_Freshness"
488
+ },
489
+ "observed": {
490
+ "$ref": "#/components/schemas/HealthCheck_Observed"
491
+ },
492
+ "details": {
493
+ "type": "object",
494
+ "additionalProperties": true
495
+ },
496
+ "error": {
497
+ "oneOf": [
498
+ {
499
+ "$ref": "#/components/schemas/HealthCheck_CheckError"
500
+ },
501
+ {
502
+ "type": "null"
503
+ }
504
+ ]
505
+ },
506
+ "since": {
507
+ "type": [
508
+ "string",
509
+ "null"
510
+ ],
511
+ "format": "date-time"
512
+ }
312
513
  },
313
- "required": ["impact","mode","freshness"]
514
+ "required": [
515
+ "impact",
516
+ "mode",
517
+ "freshness"
518
+ ]
314
519
  }
315
520
  ]
316
521
  },
@@ -320,72 +525,272 @@ app.listen(3000, () => {
320
525
  "critical": {
321
526
  "type": "object",
322
527
  "properties": {
323
- "ok": { "type": "integer", "minimum": 0 },
324
- "failing": { "type": "integer", "minimum": 0 }
528
+ "ok": {
529
+ "type": "integer",
530
+ "minimum": 0
531
+ },
532
+ "failing": {
533
+ "type": "integer",
534
+ "minimum": 0
535
+ }
325
536
  },
326
- "required": ["ok","failing"]
537
+ "required": [
538
+ "ok",
539
+ "failing"
540
+ ]
327
541
  },
328
542
  "nonCritical": {
329
543
  "type": "object",
330
544
  "properties": {
331
- "ok": { "type": "integer", "minimum": 0 },
332
- "degraded": { "type": "integer", "minimum": 0 },
333
- "failing": { "type": "integer", "minimum": 0 }
545
+ "ok": {
546
+ "type": "integer",
547
+ "minimum": 0
548
+ },
549
+ "degraded": {
550
+ "type": "integer",
551
+ "minimum": 0
552
+ },
553
+ "failing": {
554
+ "type": "integer",
555
+ "minimum": 0
556
+ }
334
557
  },
335
- "required": ["ok","degraded","failing"]
336
- },
337
- "degradedReasons": {
338
- "type": "array",
339
- "items": { "type": "string" }
558
+ "required": [
559
+ "ok",
560
+ "degraded",
561
+ "failing"
562
+ ]
340
563
  }
341
564
  },
342
- "required": ["critical","nonCritical","degradedReasons"]
565
+ "required": [
566
+ "critical",
567
+ "nonCritical"
568
+ ]
343
569
  },
344
570
  "HealthCheck_ReadinessPayload": {
345
571
  "allOf": [
346
- { "$ref": "#/components/schemas/HealthCheck_Status" },
572
+ {
573
+ "$ref": "#/components/schemas/HealthCheck_Status"
574
+ },
347
575
  {
348
576
  "type": "object",
349
577
  "properties": {
350
- "timestamp": { "type": "string", "format": "date-time" },
351
- "service": {
352
- "type": "object",
353
- "properties": {
354
- "name": { "type": "string" },
355
- "version": { "type": "string" },
356
- "instanceId": { "type": "string" }
357
- },
358
- "additionalProperties": false
578
+ "summary": {
579
+ "$ref": "#/components/schemas/HealthCheck_ReadinessSummary"
359
580
  },
360
- "summary": { "$ref": "#/components/schemas/HealthCheck_ReadinessSummary" },
361
- "checks": {
581
+ "dependencies": {
362
582
  "type": "object",
363
- "additionalProperties": { "$ref": "#/components/schemas/HealthCheck_DependencyCheck" },
364
- "description": "Keyed by dependency name."
583
+ "additionalProperties": {
584
+ "$ref": "#/components/schemas/HealthCheck_DependencyCheck"
585
+ }
365
586
  }
366
587
  },
367
- "required": ["timestamp","summary","checks"]
588
+ "required": [
589
+ "summary"
590
+ ]
368
591
  }
369
592
  ]
370
593
  },
371
594
  "HealthCheck_HealthSummary": {
372
595
  "allOf": [
373
- { "$ref": "#/components/schemas/HealthCheck_Status" },
596
+ {
597
+ "$ref": "#/components/schemas/HealthCheck_Liveness"
598
+ },
374
599
  {
375
600
  "type": "object",
376
601
  "properties": {
377
- "timestamp": { "type": "string", "format": "date-time" },
378
- "summary": { "$ref": "#/components/schemas/HealthCheck_ReadinessSummary" },
379
- "checks": {
380
- "type": "object",
381
- "additionalProperties": { "$ref": "#/components/schemas/HealthCheck_DependencyCheck" }
382
- },
383
- "system": { "$ref": "#/components/schemas/HealthCheck_System" },
384
- "process": { "$ref": "#/components/schemas/HealthCheck_Process" }
602
+ "summary": {
603
+ "$ref": "#/components/schemas/HealthCheck_ReadinessSummary"
604
+ }
385
605
  },
386
- "required": ["timestamp","summary","checks","system","process"]
606
+ "required": [
607
+ "summary"
608
+ ]
387
609
  }
388
610
  ]
611
+ },
612
+ "HealthCheck_Status_Entity": {
613
+ "type": "object",
614
+ "description": "Envelope for the status (ping) resource.",
615
+ "properties": {
616
+ "data": {
617
+ "$ref": "#/components/schemas/HealthCheck_Status"
618
+ },
619
+ "links": {
620
+ "type": "object",
621
+ "properties": {
622
+ "self": {
623
+ "$ref": "#/components/schemas/Link"
624
+ },
625
+ "parent": {
626
+ "$ref": "#/components/schemas/Link"
627
+ }
628
+ },
629
+ "required": [
630
+ "self",
631
+ "parent"
632
+ ]
633
+ }
634
+ },
635
+ "required": [
636
+ "data",
637
+ "links"
638
+ ],
639
+ "example": {
640
+ "data": {
641
+ "status": "ok"
642
+ },
643
+ "links": {
644
+ "self": {
645
+ "href": "/health/ping",
646
+ "method": "GET"
647
+ },
648
+ "parent": {
649
+ "href": "/health",
650
+ "method": "GET"
651
+ }
652
+ }
653
+ }
654
+ },
655
+ "HealthCheck_Liveness_Entity": {
656
+ "type": "object",
657
+ "description": "Envelope for the liveness resource.",
658
+ "properties": {
659
+ "data": {
660
+ "$ref": "#/components/schemas/HealthCheck_Liveness"
661
+ },
662
+ "links": {
663
+ "type": "object",
664
+ "properties": {
665
+ "self": {
666
+ "$ref": "#/components/schemas/Link"
667
+ },
668
+ "parent": {
669
+ "$ref": "#/components/schemas/Link"
670
+ }
671
+ },
672
+ "required": [
673
+ "self",
674
+ "parent"
675
+ ]
676
+ }
677
+ },
678
+ "required": [
679
+ "data",
680
+ "links"
681
+ ],
682
+ "example": {
683
+ "data": {
684
+ "status": "ok",
685
+ "timestamp": "2026-02-24T12:00:00Z"
686
+ },
687
+ "links": {
688
+ "self": {
689
+ "href": "/health/live",
690
+ "method": "GET"
691
+ },
692
+ "parent": {
693
+ "href": "/health",
694
+ "method": "GET"
695
+ }
696
+ }
697
+ }
698
+ },
699
+ "HealthCheck_Readiness_Entity": {
700
+ "type": "object",
701
+ "description": "Envelope for the readiness resource.",
702
+ "properties": {
703
+ "data": {
704
+ "$ref": "#/components/schemas/HealthCheck_ReadinessPayload"
705
+ },
706
+ "links": {
707
+ "type": "object",
708
+ "properties": {
709
+ "self": {
710
+ "$ref": "#/components/schemas/Link"
711
+ },
712
+ "parent": {
713
+ "$ref": "#/components/schemas/Link"
714
+ }
715
+ },
716
+ "required": [
717
+ "self",
718
+ "parent"
719
+ ]
720
+ }
721
+ },
722
+ "required": [
723
+ "data",
724
+ "links"
725
+ ],
726
+ "example": {
727
+ "links": {
728
+ "self": {
729
+ "href": "/health/ready",
730
+ "method": "GET"
731
+ },
732
+ "parent": {
733
+ "href": "/health",
734
+ "method": "GET"
735
+ }
736
+ }
737
+ }
738
+ },
739
+ "HealthCheck_HealthSummary_Entity": {
740
+ "type": "object",
741
+ "description": "Envelope for the root health summary resource. Links to all children.",
742
+ "properties": {
743
+ "data": {
744
+ "$ref": "#/components/schemas/HealthCheck_HealthSummary"
745
+ },
746
+ "links": {
747
+ "type": "object",
748
+ "properties": {
749
+ "self": {
750
+ "$ref": "#/components/schemas/Link"
751
+ },
752
+ "status": {
753
+ "$ref": "#/components/schemas/Link"
754
+ },
755
+ "liveness": {
756
+ "$ref": "#/components/schemas/Link"
757
+ },
758
+ "readiness": {
759
+ "$ref": "#/components/schemas/Link"
760
+ }
761
+ },
762
+ "required": [
763
+ "self",
764
+ "status",
765
+ "liveness",
766
+ "readiness"
767
+ ]
768
+ }
769
+ },
770
+ "required": [
771
+ "data",
772
+ "links"
773
+ ],
774
+ "example": {
775
+ "links": {
776
+ "self": {
777
+ "href": "/health",
778
+ "method": "GET"
779
+ },
780
+ "status": {
781
+ "href": "/health/ping",
782
+ "method": "GET"
783
+ },
784
+ "liveness": {
785
+ "href": "/health/live",
786
+ "method": "GET"
787
+ },
788
+ "readiness": {
789
+ "href": "/health/ready",
790
+ "method": "GET"
791
+ }
792
+ }
793
+ }
389
794
  }
390
795
  }
391
796
  }
@@ -396,64 +801,90 @@ app.listen(3000, () => {
396
801
 
397
802
  ```yaml
398
803
  tags:
399
- - name: system
804
+ - name: health
400
805
  description: Operational endpoints.
806
+
401
807
  paths:
402
- /health/ping:
808
+ /health:
403
809
  get:
404
- tags: [system]
405
- summary: Health ping
406
- description: Basic health status.
810
+ tags: [health]
811
+ summary: Comprehensive health summary
812
+ description: Combined view of status, system/process metrics, and readiness summary. Includes links to all child endpoints.
407
813
  security: []
408
814
  responses:
409
815
  "200":
410
- description: Service responds with basic status.
816
+ description: Health summary envelope.
411
817
  content:
412
818
  application/json:
413
819
  schema:
414
- $ref: '#/components/schemas/HealthCheck_Status'
415
- /health/live:
820
+ $ref: '#/components/schemas/HealthCheck_HealthSummary_Entity'
821
+
822
+ /health/ping:
416
823
  get:
417
- tags: [system]
418
- summary: Liveness
419
- description: Liveness signal with system and process metrics.
824
+ tags: [health]
825
+ summary: Status ping
826
+ description: Basic health status. Links back to parent /health.
420
827
  security: []
421
828
  responses:
422
829
  "200":
423
- description: Liveness payload.
830
+ description: Status entity.
424
831
  content:
425
832
  application/json:
426
833
  schema:
427
- $ref: '#/components/schemas/HealthCheck_Liveness'
428
- /health/ready:
834
+ $ref: '#/components/schemas/HealthCheck_Status_Entity'
835
+
836
+ /health/live:
429
837
  get:
430
- tags: [system]
431
- summary: Readiness
432
- description: Readiness including dependency checks and summary.
838
+ tags: [health]
839
+ summary: Liveness
840
+ description: Liveness signal with system and process metrics. Links back to parent /health.
433
841
  security: []
434
842
  responses:
435
843
  "200":
436
- description: Readiness payload.
844
+ description: Liveness entity.
437
845
  content:
438
846
  application/json:
439
847
  schema:
440
- $ref: '#/components/schemas/HealthCheck_ReadinessPayload'
441
- /health:
848
+ $ref: '#/components/schemas/HealthCheck_Liveness_Entity'
849
+
850
+ /health/ready:
442
851
  get:
443
- tags: [system]
444
- summary: Comprehensive health summary
445
- description: Combined view of status, system/process metrics, and readiness summary.
852
+ tags: [health]
853
+ summary: Readiness
854
+ description: Readiness including dependency checks and summary. Links back to parent /health.
446
855
  security: []
447
856
  responses:
448
857
  "200":
449
- description: Health summary.
858
+ description: Readiness entity.
450
859
  content:
451
860
  application/json:
452
861
  schema:
453
- $ref: '#/components/schemas/HealthCheck_HealthSummary'
862
+ $ref: '#/components/schemas/HealthCheck_Readiness_Entity'
454
863
 
455
864
  components:
456
865
  schemas:
866
+
867
+ # ─── Shared link primitives ───────────────────────────────────────────────
868
+
869
+ Verb:
870
+ type: string
871
+ enum: [GET, POST, PUT, PATCH, DELETE]
872
+ description: HTTP method for the link.
873
+
874
+ Link:
875
+ type: object
876
+ description: A hypermedia link.
877
+ properties:
878
+ href:
879
+ type: string
880
+ format: uri-reference
881
+ description: Target URL.
882
+ method:
883
+ $ref: '#/components/schemas/Verb'
884
+ required: [href, method]
885
+
886
+ # ─── Domain schemas ───────────────────────────────────────────────────────
887
+
457
888
  HealthCheck_StatusValue:
458
889
  type: string
459
890
  enum: [ok, degraded, error]
@@ -655,4 +1086,140 @@ components:
655
1086
  type: integer
656
1087
  minimum: 0
657
1088
  required: [ok, degraded, failing]
1089
+ required: [critical, nonCritical]
1090
+
1091
+ HealthCheck_ReadinessPayload:
1092
+ allOf:
1093
+ - $ref: '#/components/schemas/HealthCheck_Status'
1094
+ - type: object
1095
+ properties:
1096
+ summary:
1097
+ $ref: '#/components/schemas/HealthCheck_ReadinessSummary'
1098
+ dependencies:
1099
+ type: object
1100
+ additionalProperties:
1101
+ $ref: '#/components/schemas/HealthCheck_DependencyCheck'
1102
+ required: [summary]
1103
+
1104
+ HealthCheck_HealthSummary:
1105
+ allOf:
1106
+ - $ref: '#/components/schemas/HealthCheck_Liveness'
1107
+ - type: object
1108
+ properties:
1109
+ summary:
1110
+ $ref: '#/components/schemas/HealthCheck_ReadinessSummary'
1111
+ required: [summary]
1112
+
1113
+ # ─── Entity wrappers ──────────────────────────────────────────────────────
1114
+
1115
+ HealthCheck_Status_Entity:
1116
+ type: object
1117
+ description: Envelope for the status (ping) resource.
1118
+ properties:
1119
+ data:
1120
+ $ref: '#/components/schemas/HealthCheck_Status'
1121
+ links:
1122
+ type: object
1123
+ properties:
1124
+ self:
1125
+ $ref: '#/components/schemas/Link'
1126
+ parent:
1127
+ $ref: '#/components/schemas/Link'
1128
+ required: [self, parent]
1129
+ required: [data, links]
1130
+ example:
1131
+ data:
1132
+ status: ok
1133
+ links:
1134
+ self:
1135
+ href: /health/ping
1136
+ method: GET
1137
+ parent:
1138
+ href: /health
1139
+ method: GET
1140
+
1141
+ HealthCheck_Liveness_Entity:
1142
+ type: object
1143
+ description: Envelope for the liveness resource.
1144
+ properties:
1145
+ data:
1146
+ $ref: '#/components/schemas/HealthCheck_Liveness'
1147
+ links:
1148
+ type: object
1149
+ properties:
1150
+ self:
1151
+ $ref: '#/components/schemas/Link'
1152
+ parent:
1153
+ $ref: '#/components/schemas/Link'
1154
+ required: [self, parent]
1155
+ required: [data, links]
1156
+ example:
1157
+ data:
1158
+ status: ok
1159
+ timestamp: "2026-02-24T12:00:00Z"
1160
+ links:
1161
+ self:
1162
+ href: /health/live
1163
+ method: GET
1164
+ parent:
1165
+ href: /health
1166
+ method: GET
1167
+
1168
+ HealthCheck_Readiness_Entity:
1169
+ type: object
1170
+ description: Envelope for the readiness resource.
1171
+ properties:
1172
+ data:
1173
+ $ref: '#/components/schemas/HealthCheck_ReadinessPayload'
1174
+ links:
1175
+ type: object
1176
+ properties:
1177
+ self:
1178
+ $ref: '#/components/schemas/Link'
1179
+ parent:
1180
+ $ref: '#/components/schemas/Link'
1181
+ required: [self, parent]
1182
+ required: [data, links]
1183
+ example:
1184
+ links:
1185
+ self:
1186
+ href: /health/ready
1187
+ method: GET
1188
+ parent:
1189
+ href: /health
1190
+ method: GET
1191
+
1192
+ HealthCheck_HealthSummary_Entity:
1193
+ type: object
1194
+ description: Envelope for the root health summary resource. Links to all children.
1195
+ properties:
1196
+ data:
1197
+ $ref: '#/components/schemas/HealthCheck_HealthSummary'
1198
+ links:
1199
+ type: object
1200
+ properties:
1201
+ self:
1202
+ $ref: '#/components/schemas/Link'
1203
+ status:
1204
+ $ref: '#/components/schemas/Link'
1205
+ liveness:
1206
+ $ref: '#/components/schemas/Link'
1207
+ readiness:
1208
+ $ref: '#/components/schemas/Link'
1209
+ required: [self, status, liveness, readiness]
1210
+ required: [data, links]
1211
+ example:
1212
+ links:
1213
+ self:
1214
+ href: /health
1215
+ method: GET
1216
+ status:
1217
+ href: /health/ping
1218
+ method: GET
1219
+ liveness:
1220
+ href: /health/live
1221
+ method: GET
1222
+ readiness:
1223
+ href: /health/ready
1224
+ method: GET
658
1225
  ```