Skip to content

Commit

Permalink
fix responses in openapi documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
Rollmops committed Nov 11, 2020
1 parent c3b05de commit f96dd85
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion docs/conf.py
Expand Up @@ -31,7 +31,7 @@
# The short X.Y version
version = ''
# The full version, including alpha/beta/rc tags
release = '0.2.9'
release = '0.2.10'

# -- General configuration ---------------------------------------------------

Expand Down
2 changes: 1 addition & 1 deletion restit/__init__.py
Expand Up @@ -11,4 +11,4 @@
from .static_directory_resource import StaticDirectoryResource
from .static_file_response import StaticFileResponse

__version__ = "0.2.9"
__version__ = "0.2.10"
5 changes: 3 additions & 2 deletions restit/common.py
@@ -1,5 +1,6 @@
import os
import sys
from copy import deepcopy
from functools import lru_cache
from html import escape
from typing import List
Expand Down Expand Up @@ -53,13 +54,13 @@ def guess_text_content_subtype_string(content: str) -> str:

@lru_cache()
def get_response_status_parameters_for_method(method_object: object) -> List[ResponseStatusParameter]:
response_status_parameters = getattr(method_object.__self__, "__response_status_parameters__", [])
response_status_parameters = deepcopy(getattr(method_object.__self__, "__response_status_parameters__", []))
response_status_parameters.extend(getattr(method_object, "__response_status_parameters__", []))
return response_status_parameters


@lru_cache()
def get_exception_mapping_for_method(method_object: object) -> dict:
exception_mapping: dict = getattr(method_object.__self__, "__exception_mapping__", {})
exception_mapping: dict = deepcopy(getattr(method_object.__self__, "__exception_mapping__", {}))
exception_mapping.update(getattr(method_object, "__exception_mapping__", {}))
return exception_mapping

0 comments on commit f96dd85

Please sign in to comment.