Skip to content

Commit

Permalink
Add include_in_schema
Browse files Browse the repository at this point in the history
  • Loading branch information
EvieePy committed May 5, 2024
1 parent 8ba004b commit d191db7
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion starlette_plus/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit d191db7

Please sign in to comment.