openapi: Remove confusing check for 200 responses.

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 <anders@zulip.com>
This commit is contained in:
Anders Kaseorg 2024-02-01 15:56:33 -08:00 committed by Anders Kaseorg
parent bb699f7ee3
commit 0cee3bee00
1 changed files with 0 additions and 5 deletions

View File

@ -372,11 +372,6 @@ def validate_against_openapi_schema(
# Return true for endpoints with only response documentation remaining # Return true for endpoints with only response documentation remaining
if (endpoint, method) in EXCLUDE_DOCUMENTED_ENDPOINTS: # nocoverage if (endpoint, method) in EXCLUDE_DOCUMENTED_ENDPOINTS: # nocoverage
return True 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 # Code is not declared but appears in various 400 responses. If
# common, it can be added to 400 response schema # common, it can be added to 400 response schema
if status_code.startswith("4"): if status_code.startswith("4"):