extract schemas automatically from views

This commit is contained in:
2023-04-04 13:45:18 +03:00
parent fc01bf3d1c
commit a7ac77ce4d
15 changed files with 84 additions and 75 deletions

View File

@ -213,9 +213,9 @@ class Configuration(configparser.RawConfigParser):
if self.has_section(full_section):
return full_section, section
# okay lets just use section as type
if not self.has_section(section):
raise configparser.NoSectionError(section)
return section, section
if self.has_section(section):
return section, section
raise configparser.NoSectionError(section)
def load(self, path: Path) -> None:
"""

View File

@ -173,7 +173,7 @@ class BaseView(View, CorsViewMixin):
Raises:
HTTPMethodNotAllowed: in case if there is no GET method implemented
"""
get_method: Optional[Callable[[], Awaitable[StreamResponse]]] = getattr(self, "get", None)
get_method: Optional[Callable[..., Awaitable[StreamResponse]]] = getattr(self, "get", None)
# using if/else in order to suppress mypy warning which doesn't know that
# ``_raise_allowed_methods`` raises exception
if get_method is not None: