  
      # Ensure that max_length is passed explicitly as a keyword arg,
      # rather than as a validator.
      max_length = getattr(model_field, 'max_length', None)
      if max_length is not None and isinstance(model_field, models.CharField):
          kwargs['max_length'] = max_length
          validator_kwarg = [
              validator for validator in validator_kwarg
              if not isinstance(validator, validators.MaxLengthValidator)
          ]
 
</s> remove     text_field = models.TextField()
 </s> add     text_field = models.TextField(max_length=100) </s> remove                 text_field = CharField(style={'base_template': 'textarea.html'})
 </s> add                 text_field = CharField(max_length=100, style={'base_template': 'textarea.html'})
    if max_length is not None and (isinstance(model_field, models.CharField) or
                                   isinstance(model_field, models.TextField)):
  
      # Ensure that max_length is passed explicitly as a keyword arg,
      # rather than as a validator.
      max_length = getattr(model_field, 'max_length', None)
    if max_length is not None and (isinstance(model_field, models.CharField) or
                                   isinstance(model_field, models.TextField)):
          kwargs['max_length'] = max_length
          validator_kwarg = [
              validator for validator in validator_kwarg
              if not isinstance(validator, validators.MaxLengthValidator)
          ]
keep keep keep keep replace keep keep keep keep keep
 Map TextField max_length to CharField 
rest_framework/utils/field_mapping.py