Skip to content

Commit d191db7

Browse files
committed
Add include_in_schema
1 parent 8ba004b commit d191db7

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

starlette_plus/core.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,6 +215,7 @@ def __new__(cls, *args: Any, **kwargs: Any) -> Self:
215215
endpoint=member,
216216
methods=member._methods,
217217
name=f"{name}.{member._coro.__name__}",
218+
include_in_schema=member._include_in_schema,
218219
)
219220

220221
new.limits = getattr(member, "_limits", []) # type: ignore
@@ -244,7 +245,13 @@ def add_view(self, view: View | Self) -> None:
244245
new = WebSocketRoute(path, endpoint=route_.endpoint, name=route_.name)
245246
else:
246247
methods: list[str] | None = list(route_.methods) if route_.methods else None
247-
new = Route(path, endpoint=route_.endpoint, methods=methods, name=route_.name)
248+
new = Route(
249+
path,
250+
endpoint=route_.endpoint,
251+
methods=methods,
252+
name=route_.name,
253+
include_in_schema=route_.include_in_schema,
254+
)
248255

249256
new.limits = route_.limits # type: ignore
250257
self.routes.append(new)
@@ -290,6 +297,7 @@ def __new__(cls, *args: Any, **kwargs: Any) -> Self:
290297
endpoint=member,
291298
methods=member._methods,
292299
name=f"{name}.{member._coro.__name__}",
300+
include_in_schema=member._include_in_schema,
293301
)
294302

295303
new.limits = getattr(member, "_limits", []) # type: ignore

0 commit comments

Comments
 (0)