|
|
|
@ -836,10 +836,11 @@ class APIRoute(routing.Route): |
|
|
|
generate_unique_id_function: Callable[["APIRoute"], str] |
|
|
|
| DefaultPlaceholder = Default(generate_unique_id), |
|
|
|
strict_content_type: bool | DefaultPlaceholder = Default(True), |
|
|
|
stream_item_type: Any | None = None, |
|
|
|
) -> None: |
|
|
|
self.path = path |
|
|
|
self.endpoint = endpoint |
|
|
|
self.stream_item_type: Any | None = None |
|
|
|
self.stream_item_type: Any | None = stream_item_type |
|
|
|
if isinstance(response_model, DefaultPlaceholder): |
|
|
|
return_annotation = get_typed_return_annotation(endpoint) |
|
|
|
if lenient_issubclass(return_annotation, Response): |
|
|
|
@ -1360,6 +1361,7 @@ class APIRouter(routing.Router): |
|
|
|
generate_unique_id_function: Callable[[APIRoute], str] |
|
|
|
| DefaultPlaceholder = Default(generate_unique_id), |
|
|
|
strict_content_type: bool | DefaultPlaceholder = Default(True), |
|
|
|
stream_item_type: Any | None = None, |
|
|
|
) -> None: |
|
|
|
route_class = route_class_override or self.route_class |
|
|
|
responses = responses or {} |
|
|
|
@ -1409,6 +1411,7 @@ class APIRouter(routing.Router): |
|
|
|
strict_content_type=get_value_or_default( |
|
|
|
strict_content_type, self.strict_content_type |
|
|
|
), |
|
|
|
stream_item_type=stream_item_type, |
|
|
|
) |
|
|
|
self.routes.append(route) |
|
|
|
|
|
|
|
@ -1789,6 +1792,7 @@ class APIRouter(routing.Router): |
|
|
|
router.strict_content_type, |
|
|
|
self.strict_content_type, |
|
|
|
), |
|
|
|
stream_item_type=route.stream_item_type, |
|
|
|
) |
|
|
|
elif isinstance(route, routing.Route): |
|
|
|
methods = list(route.methods or []) |
|
|
|
|