Description
HEAD returns resource metadata in headers and has no response body.
Potential impact
Availability checks may treat a successful request as a failure if only errors are documented.
Remediation
Under responses, document the success code the endpoint returns and the headers callers need. Leave out the body schema.
Examples
This OpenAPI 3.0 excerpt adds 200. The example labels default as an error.
Before
json
{
"openapi": "3.0.0",
"paths": {
"/item": {
"head": {
"operationId": "headItem",
"summary": "Head item",
"responses": {
"default": {
"description": "Error"
}
}
}
}
}
}
After
json
{
"openapi": "3.0.0",
"paths": {
"/item": {
"head": {
"operationId": "headItem",
"summary": "Head item",
"responses": {
"200": {
"description": "Success"
},
"default": {
"description": "Error"
}
}
}
}
}
}