Skip to main content

health-schema-status

Requires the success response schema of a GET health endpoint to define status.

AttributeValue
CategorySchema
MaturityGold
OpenAPISwagger 2.0; OpenAPI 3.0, 3.1, 3.2
StarterOff
Lenient–StrictWarning
CompleteError

Intent

A standard status field gives health-check consumers one predictable signal for service state.

Flags

The first 2xx response schema of the first GET path whose normalized path ends in /health when properties.status is absent.

Does not flag

Other paths, non-GET operations, health endpoints without a 2xx content schema, or schemas that define status.

See it fail

paths:
/health:
get:
responses:
'200':
description: Health
content:
application/health+json:
schema:
type: object
properties: {}

Diagnostic: Health schema should define `status`.

Fix it

paths:
/health:
get:
responses:
'200':
description: Health
content:
application/health+json:
schema:
type: object
properties:
status:
type: string

Configure

profiles:
default:
rules:
extends: [recommended]
override:
health-schema-status: error

Nearby: health-endpoint, health-schema-status-in-required.