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

Method decorator

fastapi/applications.py:1324–1351  ·  view source on GitHub ↗
(func: DecoratedCallable)

Source from the content-addressed store, hash-verified

1322 ),
1323 ) -> Callable[[DecoratedCallable], DecoratedCallable]:
1324 def decorator(func: DecoratedCallable) -> DecoratedCallable:
1325 self.router.add_api_route(
1326 path,
1327 func,
1328 response_model=response_model,
1329 status_code=status_code,
1330 tags=tags,
1331 dependencies=dependencies,
1332 summary=summary,
1333 description=description,
1334 response_description=response_description,
1335 responses=responses,
1336 deprecated=deprecated,
1337 methods=methods,
1338 operation_id=operation_id,
1339 response_model_include=response_model_include,
1340 response_model_exclude=response_model_exclude,
1341 response_model_by_alias=response_model_by_alias,
1342 response_model_exclude_unset=response_model_exclude_unset,
1343 response_model_exclude_defaults=response_model_exclude_defaults,
1344 response_model_exclude_none=response_model_exclude_none,
1345 include_in_schema=include_in_schema,
1346 response_class=response_class,
1347 name=name,
1348 openapi_extra=openapi_extra,
1349 generate_unique_id_function=generate_unique_id_function,
1350 )
1351 return func
1352
1353 return decorator
1354

Callers

nothing calls this directly

Calls 3

add_websocket_routeMethod · 0.80
add_api_routeMethod · 0.45

Tested by

no test coverage detected