Skip to content

Commit c6f9c7d

Browse files
Fix encoder and decoder params on JSONField (#304)
params encoder and decoder on JSONField are class types. Similar example on django_stubs https://github.com/typeddjango/django-stubs/blob/b81b1bf3868eaab9fecebdd56ed817ffcb07fad8/django-stubs/db/models/fields/json.pyi#L14-L15
1 parent 3cdc675 commit c6f9c7d

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

rest_framework-stubs/fields.pyi

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -641,8 +641,8 @@ class HStoreField(DictField):
641641

642642
class JSONField(Field[dict[str, Any] | list[dict[str, Any]], dict[str, Any] | list[dict[str, Any]], str, Any]):
643643
binary: bool
644-
encoder: JSONEncoder | None
645-
decoder: JSONDecoder | None
644+
encoder: type[JSONEncoder] | None
645+
decoder: type[JSONDecoder] | None
646646
def __init__(
647647
self,
648648
read_only: bool = ...,
@@ -659,8 +659,8 @@ class JSONField(Field[dict[str, Any] | list[dict[str, Any]], dict[str, Any] | li
659659
allow_null: bool = ...,
660660
*,
661661
binary: bool = ...,
662-
encoder: JSONEncoder | None = ...,
663-
decoder: JSONDecoder | None = ...,
662+
encoder: type[JSONEncoder] | None = ...,
663+
decoder: type[JSONDecoder] | None = ...,
664664
): ...
665665

666666
class ReadOnlyField(Field): ...

0 commit comments

Comments
 (0)