Description
A default response also covers successful DELETE codes without their own entries.
Potential impact
Callers may report a deletion as complete while it is still queued.
Remediation
Document what the server returns. Use 200 for completed deletion with a body and describe that body. Use 204 for completion without a body or 202 when deletion is still pending.
Examples
This OpenAPI 3.0 excerpt adds 204 to deleteItem.
Before
json
{
"openapi": "3.0.0",
"paths": {
"/item": {
"delete": {
"operationId": "deleteItem",
"summary": "Delete item",
"responses": {
"default": {
"description": "Error"
}
}
}
}
}
}
After
json
{
"openapi": "3.0.0",
"paths": {
"/item": {
"delete": {
"operationId": "deleteItem",
"summary": "Delete item",
"responses": {
"204": {
"description": "Item deleted successfully"
},
"default": {
"description": "Error"
}
}
}
}
}
}