Skip to content

Commit ce6ef4e

Browse files
committed
update type hints for AutoSchema._get_response_bodies to match the ones set by drf-spectacular
1 parent e3f781b commit ce6ef4e

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

drf_standardized_errors/openapi.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,16 @@
11
import inspect
22
from collections import defaultdict
3-
from typing import Any, Dict, List, Set, Type, Union
3+
from typing import Dict, List, Set, Type, Union
44

55
from drf_spectacular.drainage import warn
66
from drf_spectacular.extensions import OpenApiFilterExtension
77
from drf_spectacular.openapi import AutoSchema as BaseAutoSchema
8-
from drf_spectacular.utils import OpenApiExample, PolymorphicProxySerializer
8+
from drf_spectacular.utils import (
9+
Direction,
10+
OpenApiExample,
11+
PolymorphicProxySerializer,
12+
_SchemaType,
13+
)
914
from inflection import camelize
1015
from rest_framework import serializers
1116
from rest_framework.negotiation import DefaultContentNegotiation
@@ -51,7 +56,7 @@
5156

5257

5358
class AutoSchema(BaseAutoSchema):
54-
def _get_response_bodies(self, direction: str = "response") -> Dict[str, Any]:
59+
def _get_response_bodies(self, direction: Direction = "response") -> _SchemaType:
5560
responses = super()._get_response_bodies(direction=direction)
5661
if direction == "response":
5762
error_responses = {}

0 commit comments

Comments
 (0)