From a0547ec6970c7c7bf1ba112da1fff7c3fcba383c Mon Sep 17 00:00:00 2001 From: Dolf Andringa Date: Wed, 26 Jul 2023 12:09:08 +0800 Subject: [PATCH] Make the request argument to schemas.openapi.SchemaGenerator.get_schema optional --- rest_framework-stubs/schemas/openapi.pyi | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rest_framework-stubs/schemas/openapi.pyi b/rest_framework-stubs/schemas/openapi.pyi index 0499e436d..64d720986 100644 --- a/rest_framework-stubs/schemas/openapi.pyi +++ b/rest_framework-stubs/schemas/openapi.pyi @@ -1,5 +1,5 @@ from collections.abc import Sequence -from typing import Any, TypedDict +from typing import Any, TypedDict, Optional from rest_framework.fields import Field from rest_framework.pagination import BasePagination @@ -25,7 +25,7 @@ class DRFOpenAPISchema(TypedDict, total=False): class SchemaGenerator(BaseSchemaGenerator): def get_info(self) -> DRFOpenAPIInfo: ... def check_duplicate_operation_id(self, paths: dict[str, dict[str, Any]]) -> None: ... - def get_schema(self, request: Request = ..., public: bool = ...) -> DRFOpenAPISchema: ... # type: ignore[override] + def get_schema(self, request: Optional[Request] = ..., public: bool = ...) -> DRFOpenAPISchema: ... # type: ignore[override] class AutoSchema(ViewInspector): operation_id_base: str | None = ...