MCPcopy
hub / github.com/fastapi/fastapi / decorator

Method decorator

fastapi/routing.py:2826–2834  ·  view source on GitHub ↗
(func: DecoratedCallable)

Source from the content-addressed store, hash-verified

2824 include_in_schema: bool = True,
2825 ) -> Callable[[DecoratedCallable], DecoratedCallable]:
2826 def decorator(func: DecoratedCallable) -> DecoratedCallable:
2827 self.add_route(
2828 path,
2829 func,
2830 methods=methods,
2831 name=name,
2832 include_in_schema=include_in_schema,
2833 )
2834 return func
2835
2836 return decorator
2837

Callers

nothing calls this directly

Calls 5

add_routeMethod · 0.95
add_api_routeMethod · 0.95
add_websocket_routeMethod · 0.95
add_event_handlerMethod · 0.95

Tested by

no test coverage detected