From a5f7bc5658fdc97de7478882b3a0f5aa2d765506 Mon Sep 17 00:00:00 2001 From: Matt Miller Date: Tue, 12 May 2026 13:14:50 -0700 Subject: [PATCH] Suppress false-positive Spectral lint on WebSocket endpoint (#13842) The /ws path uses HTTP 101 (Switching Protocols), which is the correct response for a WebSocket upgrade but not a 2xx. The built-in operation-success-response rule fires as a false positive because OpenAPI 3.x has no native WebSocket support. Add a path-scoped override in .spectral.yaml to disable the rule for /ws only, leaving it active for all other operations. --- .spectral.yaml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.spectral.yaml b/.spectral.yaml index 4bb4a4a94..a4b137628 100644 --- a/.spectral.yaml +++ b/.spectral.yaml @@ -89,3 +89,12 @@ rules: then: field: description function: truthy + +overrides: + # /ws uses HTTP 101 (Switching Protocols) — a legitimate response for a + # WebSocket upgrade, but not a 2xx, so operation-success-response fires + # as a false positive. OpenAPI 3.x has no native WebSocket support. + - files: + - "openapi.yaml#/paths/~1ws" + rules: + operation-success-response: off