TRACE success response is undefined (OpenAPI 3.0)

A supported TRACE operation lacks a documented success response

Description

For an endpoint that supports TRACE, document its normal 200 response. The method reflects the request the server received.

Potential impact

A client or test based on an error-only definition may misinterpret a successful diagnostic response.

Remediation

Describe the status and the format the service actually returns under responses. Remove the TRACE operation from the specification if the endpoint does not support it.

Examples

The example adds a 200 description for an existing TRACE operation. Server configuration controls whether the method is enabled.

Before

json
{
  "openapi": "3.0.0",
  "paths": {
    "/item": {
      "trace": {
        "operationId": "traceItem",
        "responses": {
          "default": {
            "description": "Error"
          }
        }
      }
    }
  }
}

After

json
{
  "openapi": "3.0.0",
  "paths": {
    "/item": {
      "trace": {
        "operationId": "traceItem",
        "responses": {
          "200": {
            "description": "success"
          },
          "default": {
            "description": "Error"
          }
        }
      }
    }
  }
}

References