      def __init__(self, *args, **kwargs):
          self.binary = kwargs.pop('binary', False)
          self.encoder = kwargs.pop('encoder', None)
          super().__init__(*args, **kwargs)
  
      def get_value(self, dictionary):
          if html.is_html_input(dictionary) and self.field_name in dictionary:
 
</s> remove                 return json.loads(data)
 </s> add                 return json.loads(data, cls=self.decoder) </s> remove         if postgres_fields and isinstance(model_field, postgres_fields.JSONField):
 </s> add         is_django_jsonfield = hasattr(models, 'JSONField') and isinstance(model_field, models.JSONField)
        if (postgres_fields and isinstance(model_field, postgres_fields.JSONField)) or is_django_jsonfield: </s> remove             (postgres_fields and isinstance(model_field, postgres_fields.JSONField)):
 </s> add             (postgres_fields and isinstance(model_field, postgres_fields.JSONField)) or \
            (hasattr(models, 'JSONField') and isinstance(model_field, models.JSONField)):
        self.decoder = kwargs.pop('decoder', None)
      def __init__(self, *args, **kwargs):
          self.binary = kwargs.pop('binary', False)
          self.encoder = kwargs.pop('encoder', None)
        self.decoder = kwargs.pop('decoder', None)
          super().__init__(*args, **kwargs)
  
      def get_value(self, dictionary):
          if html.is_html_input(dictionary) and self.field_name in dictionary:
keep keep add keep keep keep keep
 Add support for Django 3.1 JSONField (#7467)

Django 3.1 adds a new generic JSONField to replace the PostgreSQL-specific one. This adds support for the new field type, which should behave the same as the existing PostgreSQL field.

Django's new JSONField also includes support for a custom "decoder", so add support for that in the serializer field. 
rest_framework/fields.py