Skip to content

Commit

Permalink
Support OpenAPI Specification 3.1.1
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
cjwatson authored and stephenfin committed Jan 8, 2025
1 parent 8705b7f commit f8c9be4
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion sphinxcontrib/openapi/openapi31.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 = " "

Expand Down
2 changes: 1 addition & 1 deletion tests/OpenAPI-Specification

0 comments on commit f8c9be4

Please sign in to comment.