From 0cee3bee0068438a71c22b480e5105420ff91969 Mon Sep 17 00:00:00 2001 From: Anders Kaseorg Date: Thu, 1 Feb 2024 15:56:33 -0800 Subject: [PATCH] openapi: Remove confusing check for 200 responses. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This error message didn’t make sense for the check as written, and our OpenAPI document already provides the expected format for our 200 responses. Signed-off-by: Anders Kaseorg --- zerver/openapi/openapi.py | 5 ----- 1 file changed, 5 deletions(-) diff --git a/zerver/openapi/openapi.py b/zerver/openapi/openapi.py index 9da070d402..7b6c80eef9 100644 --- a/zerver/openapi/openapi.py +++ b/zerver/openapi/openapi.py @@ -372,11 +372,6 @@ def validate_against_openapi_schema( # Return true for endpoints with only response documentation remaining if (endpoint, method) in EXCLUDE_DOCUMENTED_ENDPOINTS: # nocoverage return True - # Check if the response matches its code - if status_code.startswith("2") and ( - content.get("result", "success").lower() != "success" - ): # nocoverage - raise SchemaError("Response is not 200 but is validating against 200 schema") # Code is not declared but appears in various 400 responses. If # common, it can be added to 400 response schema if status_code.startswith("4"):