          if not issubclass(field_class, CharField) and not issubclass(field_class, ChoiceField):
              # `allow_blank` is only valid for textual fields.
              field_kwargs.pop('allow_blank', None)
  
          if postgres_fields and isinstance(model_field, postgres_fields.JSONField):
              # Populate the `encoder` argument of `JSONField` instances generated
              # for the PostgreSQL specific `JSONField`.
              field_kwargs['encoder'] = getattr(model_field, 'encoder', None)
  
          if postgres_fields and isinstance(model_field, postgres_fields.ArrayField):
 
</s> remove             # for the PostgreSQL specific `JSONField`.
 </s> add             # for the model `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)):
        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:
          if not issubclass(field_class, CharField) and not issubclass(field_class, ChoiceField):
              # `allow_blank` is only valid for textual fields.
              field_kwargs.pop('allow_blank', None)
  
        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:
              # Populate the `encoder` argument of `JSONField` instances generated
              # for the PostgreSQL specific `JSONField`.
              field_kwargs['encoder'] = getattr(model_field, 'encoder', None)
  
          if postgres_fields and isinstance(model_field, postgres_fields.ArrayField):
keep keep keep keep replace keep 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/serializers.py