2020SCHEMA_KEY = "_schema"
2121
2222if sys .version_info < (3 , 7 ): # pragma: no cover
23- from typing import GenericMeta
23+ from typing import GenericMeta # type: ignore[attr-defined]
2424
2525 class ControllerResponseMeta (GenericMeta ):
2626 @no_type_check
@@ -42,7 +42,6 @@ class GenericControllerResponse(metaclass=ControllerResponseMeta):
4242 def __new__ (
4343 cls : Type ["ControllerResponse[T]" ], * args : Any , ** kwargs : Any
4444 ) -> "ControllerResponse[T]" :
45-
4645 if cls ._gorg is Generic or "_schema" not in cls .__dict__ :
4746 raise TypeError (
4847 "Type Generic cannot be instantiated; "
@@ -62,10 +61,9 @@ class ControllerResponseMeta(type):
6261 pass
6362
6463 class GenericControllerResponse (metaclass = ControllerResponseMeta ):
65- def __new__ (
64+ def __new__ ( # type:ignore[misc]
6665 cls : Type ["ControllerResponse[T]" ], * args : Any , ** kwargs : Any
6766 ) -> "ControllerResponse[T]" :
68-
6967 if "_schema" not in cls .__dict__ :
7068 raise TypeError (
7169 "Type Generic cannot be instantiated; "
@@ -123,7 +121,7 @@ class Id(ControllerResponse[T]):
123121 ==> 201, {id: "883a1a3d-7b10-458d-bccc-f9b7219342c9"}
124122 """
125123
126- _schema = IdSchema [Any ] # type: ignore
124+ _schema = IdSchema [Any ]
127125 status_code : int = status .HTTP_201_CREATED
128126
129127 def __init__ (self , id : T ) -> None :
@@ -156,7 +154,7 @@ class ASchema(BaseModel):
156154 """
157155
158156 status_code : int = status .HTTP_200_OK
159- _schema = OkSchema [Any ] # type: ignore
157+ _schema = OkSchema [Any ]
160158
161159 def __init__ (self , message : Optional [Any ] = None ) -> None :
162160 super (Ok , self ).__init__ ()
@@ -186,7 +184,7 @@ class ErrorSchema(BaseModel):
186184 """
187185
188186 status_code : int = status .HTTP_200_OK
189- _schema = DetailSchema [Any ] # type: ignore
187+ _schema = DetailSchema [Any ]
190188
191189 def __init__ (
192190 self , message : Optional [Any ] = None , status_code : int = status .HTTP_200_OK
0 commit comments