File: openapi-3.1.1.patch

package info (click to toggle)
sphinxcontrib-openapi 0.8.4-4
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 880 kB
  • sloc: python: 7,575; makefile: 23
file content (30 lines) | stat: -rw-r--r-- 1,160 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
From: Colin Watson <cjwatson@debian.org>
Date: Mon, 6 Jan 2025 18:15:05 +0000
Subject: Support OpenAPI Specification 3.1.1

OAS 3.1.1 added
https://github.com/OAI/OpenAPI-Specification/blob/main/tests/v3.1/pass/non-oauth-scopes.yaml,
which indicates that it's possible for the `responses` object to be
missing; this caused a test failure.  It seems reasonable enough to
default to an empty dictionary.

Forwarded: https://github.com/sphinx-contrib/openapi/pull/164
Bug-Debian: https://bugs.debian.org/1090307
Last-Update: 2025-01-06
---
 sphinxcontrib/openapi/openapi31.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sphinxcontrib/openapi/openapi31.py b/sphinxcontrib/openapi/openapi31.py
index eb3a7e0..7bc4f06 100644
--- a/sphinxcontrib/openapi/openapi31.py
+++ b/sphinxcontrib/openapi/openapi31.py
@@ -279,7 +279,7 @@ def _httpresource(
 ):
     # https://github.com/OAI/OpenAPI-Specification/blob/3.1.0/versions/3.1.0.md#operation-object
     parameters = properties.get("parameters", [])
-    responses = properties["responses"]
+    responses = properties.get("responses", {})
     query_param_examples = []
     indent = "   "