From d191db750e716e8f480fea41ea0d1fd7bc032c52 Mon Sep 17 00:00:00 2001 From: MystyPy Date: Sun, 5 May 2024 14:45:08 +1000 Subject: [PATCH] Add include_in_schema --- starlette_plus/core.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/starlette_plus/core.py b/starlette_plus/core.py index 6212f9f..e525555 100644 --- a/starlette_plus/core.py +++ b/starlette_plus/core.py @@ -215,6 +215,7 @@ def __new__(cls, *args: Any, **kwargs: Any) -> Self: endpoint=member, methods=member._methods, name=f"{name}.{member._coro.__name__}", + include_in_schema=member._include_in_schema, ) new.limits = getattr(member, "_limits", []) # type: ignore @@ -244,7 +245,13 @@ def add_view(self, view: View | Self) -> None: new = WebSocketRoute(path, endpoint=route_.endpoint, name=route_.name) else: methods: list[str] | None = list(route_.methods) if route_.methods else None - new = Route(path, endpoint=route_.endpoint, methods=methods, name=route_.name) + new = Route( + path, + endpoint=route_.endpoint, + methods=methods, + name=route_.name, + include_in_schema=route_.include_in_schema, + ) new.limits = route_.limits # type: ignore self.routes.append(new) @@ -290,6 +297,7 @@ def __new__(cls, *args: Any, **kwargs: Any) -> Self: endpoint=member, methods=member._methods, name=f"{name}.{member._coro.__name__}", + include_in_schema=member._include_in_schema, ) new.limits = getattr(member, "_limits", []) # type: ignore